# Node-red, raspberry pi and arduino communication issues

**URL:** <https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [10 February 2022 22:01 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115 "2022-02-10T22:01:59Z")\
**Posts on this page:** 9\
**Page:** 3

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [26 February 2022 19:23 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115/41 "2022-02-26T19:23:23Z")

</div>

![20220226_112247.jpg](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/3/c31ea62ba40a2f91123655513e73436d0827c15b.jpeg)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 February 2022 19:45 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115/42 "2022-02-26T19:45:16Z")

</div>

Which contrib node are you using to read the ds18b20?  
add a `debug` node to it's output and look at the result, paste a copy to a reply

Also why not use one switch node to check for each sensor and then have the outputs go to the appropriate next node?

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [26 February 2022 20:00 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115/43 "2022-02-26T20:00:55Z")

</div>

```auto
[{"id":"6a6c83b8.bb185c","type":"inject","z":"1f851c1.28701e4","name":"","repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":160,"y":100,"wires":[["13ef1dd3.a2cf62"]]},{"id":"13ef1dd3.a2cf62","type":"rpi-ds18b20","z":"1f851c1.28701e4","topic":"","array":false,"name":"","x":350,"y":100,"wires":[["1f01bf2a.2f3b71"]]},{"id":"1f01bf2a.2f3b71","type":"debug","z":"1f851c1.28701e4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":550,"y":100,"wires":[]},{"id":"d2bb6889.0e9c88","type":"comment","z":"1f851c1.28701e4","name":"Body: Tempature Probes","info":"diagram of map link here ","x":170,"y":160,"wires":[]},{"id":"78b46331.d9ff7c","type":"comment","z":"1f851c1.28701e4","name":"sensor1 Boil Kettle","info":"{\"_msgid\":\"67e54d37.7e7e34\",\"payload\":19.375,\"topic\":\"2F4407D6013C\",\"file\":\"28-3c01d607442f\",\"dir\":\"w1_bus_master1\",\"family\":\"28\"}\n","x":270.00003814697266,"y":252.00002098083496,"wires":[]},{"id":"796619bd.d06898","type":"comment","z":"1f851c1.28701e4","name":"edit when changing sensor","info":"","x":790,"y":200,"wires":[]},{"id":"1a32f115.43a18f","type":"change","z":"1f851c1.28701e4","name":"format topic to mqtt header","rules":[{"t":"set","p":"topic","pt":"msg","to":"topic.sensor1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":260,"wires":[["1bc19f2079840ced"]]},{"id":"4a0ae719.de3f58","type":"inject","z":"1f851c1.28701e4","name":"30sec","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":146.00000762939453,"y":203.00001907348633,"wires":[["a780bcc.d212b4"]]},{"id":"1abb841e.5a146c","type":"switch","z":"1f851c1.28701e4","name":"If = 2F4407D6013C","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"2F4407D6013C","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":260,"wires":[["1a32f115.43a18f"],["b619ce5b.8681a"]]},{"id":"a780bcc.d212b4","type":"rpi-ds18b20","z":"1f851c1.28701e4","topic":"","array":false,"name":"","x":356,"y":151.00000190734863,"wires":[["1abb841e.5a146c"]]}]

```

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [26 February 2022 20:04 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115/44 "2022-02-26T20:04:58Z")

</div>

2/26/2022, 12:04:37 PM[node: 1f01bf2a.2f3b71]82B307D6013C : msg : Object

{ \_msgid: "292fbe2dacc01c10", payload: 15.375, topic: "82B307D6013C", file: "28-3c01d607b382", dir: "w1\_bus\_master1" … }

2/26/2022, 12:04:37 PM[node: 1f01bf2a.2f3b71]B7EC07D6013C : msg : Object

{ \_msgid: "292fbe2dacc01c10", payload: 15.25, topic: "B7EC07D6013C", file: "28-3c01d607ecb7", dir: "w1\_bus\_master1" … }

2/26/2022, 12:04:37 PM[node: 1f01bf2a.2f3b71]2F4407D6013C : msg : Object

{ \_msgid: "292fbe2dacc01c10", payload: 15.125, topic: "2F4407D6013C", file: "28-3c01d607442f", dir: "w1\_bus\_master1" … }

2/26/2022, 12:04:38 PM[node: 1f01bf2a.2f3b71]D9D796F0013C : msg : Object

{ \_msgid: "292fbe2dacc01c10", payload: -1.5, topic: "D9D796F0013C", file: "28-3c01f096d7d9", dir: "w1\_bus\_master1" … }

2/26/2022, 12:04:38 PM[node: 1f01bf2a.2f3b71]1B5507D6013C : msg : Object

{ \_msgid: "292fbe2dacc01c10", payload: 17.75, topic: "1B5507D6013C", file: "28-3c01d607551b", dir: "w1\_bus\_master1" … }

2/26/2022, 12:04:38 PM[node: 1f01bf2a.2f3b71]9DFD07D6013C : msg : Object

{ \_msgid: "292fbe2dacc01c10", payload: 18.25, topic: "9DFD07D6013C", file: "28-3c01d607fd9d", dir: "w1\_bus\_master1" … }

2/26/2022, 12:04:38 PM[node: 1f01bf2a.2f3b71]AA5A07D6013C : msg : Object

{ \_msgid: "292fbe2dacc01c10", payload: 15, topic: "AA5A07D6013C", file: "28-3c01d6075aaa", dir: "w1\_bus\_master1" … }

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 February 2022 20:20 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115/45 "2022-02-26T20:20:22Z")

</div>

So just send the output of the `node-red-contrib-ds18b20-sensor` node to a `switch` node. In the switch test msg.payload != -127 and then pass that output to your flow.

As I said, I'd combine the following set if switched into one like this:

```auto
[{"id":"273e3c301c54b29e","type":"switch","z":"fdcb57b723139a0f","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"1B5507D6013C","vt":"str"},{"t":"eq","v":"2F4407D6013C","vt":"str"},{"t":"eq","v":"82B307D6013C","vt":"str"},{"t":"eq","v":"9DFD07D6013C","vt":"str"},{"t":"eq","v":"B7EC07D6013C","vt":"str"},{"t":"eq","v":"D9D796F0013C","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":7,"x":270,"y":660,"wires":[[],[],[],[],[],[],[]]}]

```

 ![Screen Shot 2022-02-26 at 3.19.15 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/ca98d48cb76b06fc35ddb5d14f49c3551ded0cc8.png)

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [28 February 2022 07:51 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115/46 "2022-02-28T07:51:33Z")

</div>

ok so that is same as what i did on the other but i used multiple switch nodes.

Im not understanding how to

> In the switch test msg.payload != -127 and then pass that output to your flow.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 February 2022 09:52 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115/47 "2022-02-28T09:52:58Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/943f6112dfdc5627233baaf26909555143e9b384.png)

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [28 February 2022 17:33 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115/48 "2022-02-28T17:33:45Z")

</div>

Ok that makes sense.  
So basically any one sensor that has that message is basically thrown away before I send the goods readings to each gauge flow.

Ty , cheers

---

<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:** [29 April 2022 17:33 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115/49 "2022-04-29T17:33:54Z")

</div>

Closed on 29 April 2022 17:33 UTC

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

[Previous page](https://discourse.nodered.org/t/node-red-raspberry-pi-and-arduino-communication-issues/58115.md?page=2)
