I am trying to read data from an MLX90640 thermal camera using the GY-MCU90640 board based on this tutorial.
VIN is connected to 5V (4)
GND is connected to GND (6)
RX is connected to TX/GPIO14 (8)
TX is connected to RX/GPIO15 (10)
Serial is enabled without login shell using sudo raspi-config
/Interfacing/Serial.
I2C is disabled using sudo raspi-confi
/Interfacing/I2C.
However, when trying to read some data using the following Python script, I only receive weird characters such as i)2iKbi!��(R�Bi!�(�ke�+ik
. At least the lines are changing when moving my hand above the sensor, so I assume it is kind of working.
#!/usr/bin/env python
import time
import serial
ser = serial.Serial(
port='/dev/serial0',
baudrate = 9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
while 1:
ser.write(serial.to_bytes([0xA5,0x15,0x01,0xBB])) # configure for 9600 kbps baud rate
x=ser.readline()
print x
Not surprisingly the proposed main.py
script to read thermal images fails with ValueError: invalid literal for int() with base 10: '+'
.
while
loop looks particularly suspicious.main.py
script fails with errors likeValueError: invalid literal for int() with base 10: '+'
.