Serial Sensor not recognizing data sent from Serial

Hi,

Is there anyone face the same issue as me for the serial sensor. I am using home assistant 0.91.3 running at Raspberry Pi 3B+ as homeassistant user.

I have arduino uno set up, and above to transmit json data to serial port.

From Pi, i can read serial port data by command: # picocom -b 9600 /dev/ttyUSB0

json%20data

I tried configuration

sensor:

  • platform: serial
    serial_port: ‘/dev/ttyUSB0’
    name: ‘USBserial’
    baudrate: 9600

also tried
sensor:

  • platform: serial
    serial_port: ‘/dev/ttyUSB0’

both way, I can get the Serial Sensor entity, but it always showns as unknown, and is not reading data from serial.

Is there anybody have a similar issue, and how is it resolved?

Thanks,
Nanguo Xuecheng

Someone else had a similar problem and it was due to the received data missing a newline character (\n) at the end of each transmitted string. Check the arduino’s code to confirm the data is terminated by a newline.

Hi,

Thanks for response. But in my arduino code, the new line char is there. Otherwise, the picocom receiving data cannot be shown in lines.

@nanguoxuecheng Did you ever find a fix for this?

1 Like