Hi, I have little problem with data transfer to NR from RPI. Have installed nodejs serialport and open serial port. I tryed read data use USB and this work perfectly. I want transfer data from Modbus with RPI. I use UART connect and NR don't accept to read and write, data debug give this error. Serial port send data to AMA0 and BT was deactivated.
Please don't link to exterior sites unless the text it too large to paste in here. You can paste images and text directly into the forum. When pasting logs and code use the </> button at the top of the forum entry window.
From the log 22 Jan 05:19:14 - [error] [modbusSerialConfig:8d3002c3.2570a] Error: {"name":"Po rtNotOpenError","message":"Port Not Open","errno":"ECONNREFUSED"}
That suggests either the port is already in use by another application (perhaps you have been testing the port using the command line or other client) or possibly the node red user does not have permission to access the port.
Is this running on a pi? If so then I think the node red user needs to be in the dialout group?
Yes, i'm running NR on pi user, but give permissions NR for access dialout with command (sudo usermod -a -G dialout pi). And adduser to acces dialout with(sudo adduser pi dialout).
That suggests you need to be in the tty group rather than dialout. I suggest rebooting after adding a user to a group to make sure the session node red is using understands that.
Have you read this, including the section on disabling the linux console? Also where it says "You must also disable the system service that initialises the modem, so it does not connect to the UART". Also possibly other bits in that document. UART configuration - Raspberry Pi Documentation
Mine looks like the below, and I'm accessing the port fine.
[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
#dtoverlay=vc4-fkms-v3d
#Disable Bluetooth
dtoverlay=pi3-disable-bt