Smart Home Automation Forum

Full Version: Read Serial (RS485) Data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hello,

I have no success to read data from RS485 port (orange one). I use NODE-RED for building flows.

To make sure that it is not issue in any configuration I used USB->RS485 adapter and I had success to read data.

There are two serial available when execute

Code:
dmesg | grep tty

  1. /dev/ttyS0
  2. /dev/ttyAMA0

I assume that /dev/ttyAMA0 is the right one to use but when I try to read data the response isĀ "Modbus Failure On State sending Get More About It By Logging"

Could someone help me with that? I can read data if I use USB->RS485 adapter but not trought the built-in RS-485 port (orange one).
if you use KC868-Server for RS485 modbus by Node-Red:
1. Enable serial port on Raspberry Pi CM4
The enable it you need to check in /boot/config.txt the line enable_uart

enable_uart=1

2. use "/dev/ttyS0", not "/dev/ttyAMA0"

today we will upload YouTube video about Node-Red control output by RS485 demo.
I have checked the config file and the serial port is enabled there.

I switched from /dev/ttyAMA0 to /dev/tty/ttyS0 but with no success.

It shows that port is connected but when I try to read data then I get error -> "Modbus Failure On State sending Get More About It By Logging"

[attachment=1068]

Could u help me with that?
do you have installed home assistant, or KC868-Server only installed Node-Red?
I have only NODE-RED running in docker container. The operation system is latest Ubuntu Core.
do you using KC868-Server ?
(06-10-2022, 10:55 AM)admin Wrote: [ -> ]do you using KC868-Server ?

Yes I am using KC868-Server with CM4 on it. CM4 has Ubuntu Core running and NODE-RED is running in docker container. Everything works fine with USB-RS485 adapter but not with integrated port (orange one)
you can use serial port node for a test, firstly not use modbus, test whether "serial" node work well when use "/dev/tty/ttyS0". when you use "serial " , press scan button, will auto scan your hardware's serial , see whether can list the serial device.
(06-10-2022, 11:16 AM)admin Wrote: [ -> ]you can use serial port node for a test, firstly not use modbus, test whether "serial" node work well when use "/dev/tty/ttyS0". when you use "serial " , press scan button, will auto scan your hardware's serial , see whether can list the serial device.

do I need to install some package? I dont have serialport node available.
Pages: 1 2 3