Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read Serial (RS485) Data
#1
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).
Reply
#2
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.
Reply
#3
Reply
#4
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"

   

Could u help me with that?
Reply
#5
do you have installed home assistant, or KC868-Server only installed Node-Red?
Reply
#6
I have only NODE-RED running in docker container. The operation system is latest Ubuntu Core.
Reply
#7
do you using KC868-Server ?
Reply
#8
(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)
Reply
#9
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.
Reply
#10
(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.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)