Modbus temperature sensor

Hi everyone,

I'm trying to read temperature and humidity using my Raspberry pi4 form a Modbus sensor http://www.bizkit.ru/wp-content/uploads/2018/11/Temperature-and-humidity-transmitter-SHT20-sensor-Modbus-RS485.pdf
using this rs485 Hat I bought here
https://www.hwhardsoft.de/english/projects/rs485-shield/.
I've enabled the serial port and tried a simple flow
[{"id":"3b180a5b.d295d6","type":"modbus-read","z":"e1207341.1c3be","name":"","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"1","dataType":"InputRegister","adr":"0","quantity":"2","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"df79ccb6.da1de","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":160,"y":120,"wires":[["6cd15ba8.778df4"],]},{"id":"df79ccb6.da1de","type":"modbus-client","z":"","name":"","clienttype":"simpleser","bufferCommands":false,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/serial0","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":1,"commandDelay":100,"clientTimeout":100,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true}
It seems there is something wrong: at the beginning I see below the read node a green icon connected but when it tries to polling I get an error "Modbus Failure On State connected Get More About It By Logging".
I didin't wire the shield ground since the sensor works with a different powre supply and I measured 4 Volts between the sensor power supply ground and shield ground, but from what I've read that should work even without groud wire.
Could someone help me?

Thank you

Your flow is not importable. Please edit your post above (pencil icon) and format your flow as per the forum guide - How to share code or flow json

Sorry!!

[{"id":"3b180a5b.d295d6","type":"modbus-read","z":"e1207341.1c3be","name":"","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"1","dataType":"InputRegister","adr":"0","quantity":"2","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"df79ccb6.da1de","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":160,"y":120,"wires":[["6cd15ba8.778df4"],[]]},{"id":"df79ccb6.da1de","type":"modbus-client","z":"","name":"","clienttype":"simpleser","bufferCommands":false,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/serial0","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":1,"commandDelay":100,"clientTimeout":100,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true}]

11

Hi rromele,
First of all thank's for your reply!!
I tried to modify as per your suggestion

[{"id":"e1207341.1c3be","type":"tab","label":"Test","disabled":false,"info":""},{"id":"3b180a5b.d295d6","type":"modbus-read","z":"e1207341.1c3be","name":"","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"1","dataType":"InputRegister","adr":"2","quantity":"2","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"df79ccb6.da1de","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":150,"y":100,"wires":[[],["2d255fca.a8626"]]},{"id":"2d255fca.a8626","type":"modbus-response","z":"e1207341.1c3be","name":"","registerShowMax":20,"x":470,"y":180,"wires":[]},{"id":"df79ccb6.da1de","type":"modbus-client","z":"","name":"","clienttype":"serial","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":true,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/serial0","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"4","commandDelay":"100","clientTimeout":"100","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

But it still doesn't work

The strange thing is that as soon as I start node red I got those error messages

19 May 18:17:36 - [warn] [modbus-read:3b180a5b.d295d6] Modbus Failure On State sending Get More About It By Logging
19 May 18:17:36 - [error] [modbus-read:3b180a5b.d295d6] Timed out
19 May 18:17:36 - [error] [modbus-read:3b180a5b.d295d6] TypeError: Cannot read property 'status' of undefined

then it returns on connected until it tries to ask for data again..

I'm very new at this world and I have no idea on what is happening and I'm getting depressed :smile:

Thank you!!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.