Data from RPI with UART to NR

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.

Here is log and port setting on RPI.

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

And group on check with coomnad ls -l /dev/ttyAMA0 is tty.Result crw--w---- 1 root tty 204, 64 Jan 22 11:36 /dev/ttyAMA0

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.

Already do this but doesn't work. Log 26 Jan 14:33:26 - [error] serial port /dev/ttyAMA0 error: Error: Error Resource temporarily unavailable Cannot lock port 26 Jan 14:33:27 - [error] [modbusSerialConfig:8d3002c3.2570a] Error: {"name":"TransactionTimedOutError","message":"Timed out","errno":"ETIMEDOUT"} 26 Jan 14:34:27 - [error] [modbusSerialConfig:8d3002c3.2570a] Error: {"name":"TransactionTimedOutError","message":"Timed out","errno":"ETIMEDOUT"} 26 Jan 14:35:27 - [error] [modbusSerialConfig:8d3002c3.2570a] Error: {"name":"TransactionTimedOutError","message":"Timed out","errno":"ETIMEDOUT"}

Have you disabled bluetooth on the Pi? I seem to recall that needs doing to free up the port.
I did the following;

sudo nano /boot/config.txt

Add to the end of the file


You also need to stop BT modem trying to use UART

sudo systemctl disable hciuart

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

Yeah sure, it's first step.

# Disable Bluetooth

Mine looks like the below, and I'm accessing the port fine.

# Enable DRM VC4 V3D driver on top of the dispmanx display stack


#Disable Bluetooth

Sure, when enable serial port, linux console was selected disable.

your model RPI ?

Raspberry Pi 3 Model B Plus Rev 1.3

Give me please code on cmdline.txt

Tried connect Modbus with USB he's work perfectly.

console=tty1 root=PARTUUID=03749e36-02 rootfstype=ext4 elevator=deadline rootwait quiet splash plymouth.ignore-serial-consoles

dwc_otg.lpm_enable=0 console=tty1 console=serial0(or ttyAMA0),115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

I have there errors ?

I tried delete console=serial0(or ttyAMA0) this same error give NR

NR don't have acces to UART port, how resolve this problem? I giving permissions with sudo usermod -a -G dialout pi.