# Modbus temperature sensor

**URL:** <https://discourse.nodered.org/t/modbus-temperature-sensor/26818>\
**Category:** General\
**Created:** [17 May 2020 18:42 UTC](https://discourse.nodered.org/t/modbus-temperature-sensor/26818 "2020-05-17T18:42:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@Luca](https://discourse.nodered.org/u/Luca)\
**Post date:** [17 May 2020 18:42 UTC](https://discourse.nodered.org/t/modbus-temperature-sensor/26818/1 "2020-05-17T18:42:30Z")

</div>

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](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/](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

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [17 May 2020 19:24 UTC](https://discourse.nodered.org/t/modbus-temperature-sensor/26818/2 "2020-05-17T19:24:22Z")

</div>

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](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![Luca](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@Luca](https://discourse.nodered.org/u/Luca)\
**Post date:** [17 May 2020 20:02 UTC](https://discourse.nodered.org/t/modbus-temperature-sensor/26818/3 "2020-05-17T20:02:21Z")

</div>

Sorry!!

```auto
[{"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}]

```

---

<div class="post-metadata">

**Author:** ![rromele](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rromele/32/18431_2.png) [@rromele](https://discourse.nodered.org/u/rromele)\
**Post date:** [18 May 2020 21:57 UTC](https://discourse.nodered.org/t/modbus-temperature-sensor/26818/4 "2020-05-18T21:57:28Z")

</div>

![11](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/94b2ad49ab014dd28919d011cbad078288b21046.jpeg)

 ![22](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/1/810e0ff519b072994adbca8bb3178097475e9124.jpeg)

---

<div class="post-metadata">

**Author:** ![Luca](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@Luca](https://discourse.nodered.org/u/Luca)\
**Post date:** [19 May 2020 16:27 UTC](https://discourse.nodered.org/t/modbus-temperature-sensor/26818/5 "2020-05-19T16:27:34Z")

</div>

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

```auto
[{"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 😄

Thank you!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 July 2020 16:27 UTC](https://discourse.nodered.org/t/modbus-temperature-sensor/26818/6 "2020-07-18T16:27:44Z")

</div>

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