I'm working on this project with a arduino that has a moisture sensor attached. On the raspi I'm reading the serial/usb connection with python. 2 Things.
- sometimes, I know what digit to expect, but sometimes when starting the app and it seems the first read of the serial port, I get extra numbers.
expecting 1042\r\n
getting on first call 101042\r\n
- I've also noticed sometime I get this
▒95
Then python crashes.
This is basically the serial code.
serialPort = '/dev/ttyACM0'
ser = serial.Serial(serialPort, 9600, timeout=1)
sensor_data = ser.readline()
print sensor_data
Thanks in advance for any help.