I installed a Seeed RS-485 Shield for Raspberry Pi on a new raspberry Pi4, ran sudo raspi-config, selected “3” interface options, selected P6 serial port, disabled shell, enabled serial port hardware.
I goto into node-red on the pi and am using the node-red-contrib-modbus “modbus read node” and it now finds dev/ttyS0 which I believe is the 485 shield.
The debug msg below shows my errors.
I know my slave settings (baud, data bit, stop bit, parity) are good as I have another modbus master which which works fine with this slave.
Debug msg.
12/18/2020, 4:18:16 PMnode: 88a2045f.091c28
polling : msg : Object
object
topic: "polling"
from: ""
payload: ""
queueLengthByUnitId: object
unitId: 1
queueLength: 0
queueUnitId: 1
unitId: 1
error: object
name: "TransactionTimedOutError"
message: "Timed out"
errno: "ETIMEDOUT"
nodeStatus: "timeout"
_msgid: "626fb5ee.5115ac"
any helpful ideas? I'd love to make this work & I'm really stumped here.
thank you in advance.
this test does nothing.
[{"id":"d32d366e.2f8c88","type":"serial in","z":"d7b3fdd7.b470a","name":"","serial":"28624537.d44aca","x":250,"y":280,"wires":[["492b1c0d.d20e24"]]},{"id":"9c8b9130.8e265","type":"serial out","z":"d7b3fdd7.b470a","name":"","serial":"28624537.d44aca","x":510,"y":420,"wires":[]},{"id":"492b1c0d.d20e24","type":"debug","z":"d7b3fdd7.b470a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":490,"y":280,"wires":[]},{"id":"214e3fea.bc61e","type":"inject","z":"d7b3fdd7.b470a","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Hello World","payloadType":"str","x":240,"y":420,"wires":[["9c8b9130.8e265"]]},{"id":"28624537.d44aca","type":"serial-port","serialport":"/dev/ttyS0","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","waitfor":"","newline":"0x0d","bin":"false","out":"char","addchar":"","responsetimeout":"10000"}]
this is my modbus code, gives error
[{"id":"db4ad0d4.09fa7","type":"modbus-read","z":"d7b3fdd7.b470a","name":"","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":false,"unitid":"","dataType":"InputRegister","adr":"1019","quantity":"1","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"3e181657.796eda","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"x":190,"y":280,"wires":[["88a2045f.091c28"],["88a2045f.091c28"]]},{"id":"3e181657.796eda","type":"modbus-client","name":"","clienttype":"serial","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyS0","serialType":"RTU","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]
This is another modbus master (hardware and software) configured and tested on the same ModBus slave tied to tied Pi w NodeRed. Obviously not at the same time. It works fine, I'm sharing it to show a successful configuration.