Smart Home Automation Forum
Read Serial (RS485) Data - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=1)
+--- Forum: KC868-Server Raspberry Pi4 local server (https://www.kincony.com/forum/forumdisplay.php?fid=17)
+--- Thread: Read Serial (RS485) Data (/showthread.php?tid=1977)

Pages: 1 2 3


Read Serial (RS485) Data - v1rtus - 06-09-2022

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).


RE: Read Serial (RS485) Data - admin - 06-10-2022

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.


RE: Read Serial (RS485) Data - admin - 06-10-2022




RE: Read Serial (RS485) Data - v1rtus - 06-10-2022

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?


RE: Read Serial (RS485) Data - admin - 06-10-2022

do you have installed home assistant, or KC868-Server only installed Node-Red?


RE: Read Serial (RS485) Data - v1rtus - 06-10-2022

I have only NODE-RED running in docker container. The operation system is latest Ubuntu Core.


RE: Read Serial (RS485) Data - admin - 06-10-2022

do you using KC868-Server ?


RE: Read Serial (RS485) Data - v1rtus - 06-10-2022

(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)


RE: Read Serial (RS485) Data - admin - 06-10-2022

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.


RE: Read Serial (RS485) Data - v1rtus - 06-10-2022

(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.