# RPI4B vs DHT22 vs Node-Red

**URL:** https://discourse.nodered.org/t/rpi4b-vs-dht22-vs-node-red/50346
**Category:** General
**Created:** [29 August 2021 05:13 UTC](https://discourse.nodered.org/t/rpi4b-vs-dht22-vs-node-red/50346 "2021-08-29T05:13:34Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![millsienz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/millsienz/32/47166_2.png) [@millsienz](https://discourse.nodered.org/u/millsienz)
#### Post date: [29 August 2021 05:13 UTC](https://discourse.nodered.org/t/rpi4b-vs-dht22-vs-node-red/50346/1 "2021-08-29T05:13:34Z")

</div>

Platform: pi 4 model B+  
OS: Raspios 21-05-07  
Node-RED: 1.3.4  
node: v14.17.5  
nodejs: v10.24.0  
npm: 6.14.14  
bcm2385 libs 1.69

problem node: node-red-contrib-dht-sensor v1.0.4

Hey team, I'm having problems with my DHT22 on Node-Red

I've followed the instructions @ [node-red-contrib-dht-sensor (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-dht-sensor)

However it seems to continually spit out errors like:

 ![2021-08-29-170319_1024x768_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/8/4813e6cd6fab19cb602f3fbdf332db7e0ce8a9c5.png)

I've also tested my DHT22 sensor on the RPI4B with a simple python script and it seems to be connected and outputting correctly

Can anyone help point to me towards where I've cooked it?

In my mind it could be an issue of BCM2385 vs BCM2711 for the later rpi4b versions but honestly at this point I'm unsure

EDIT: I'm going to try and connect up my SCD30 to see if that interfaces with node-red

EDIT2: This is my flow, with the only two edits being in timestamp (regular intervals) and in debug node to make the output include the complete msg object

 ![2021-08-29-171441_1024x768_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/90d80c969a5cc5cedfb008b6025f2f9b4bef5dd5.png)

---

<div class="post-metadata">

### Author: ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)
#### Post date: [29 August 2021 05:38 UTC](https://discourse.nodered.org/t/rpi4b-vs-dht22-vs-node-red/50346/2 "2021-08-29T05:38:39Z")

</div>

> [@millsienz](#):
>
> I've also tested my DHT22 sensor on the RPI4B with a simple python script and it seems to be connected and outputting correctly

That should eliminate incorrect wiring (wrong GPIO and/or power)... but good to doublecheck.

The fact that it is seeing "0.00" for both reading tells me it is simply not connecting... I honestly don't know if that node would pass on the more traditional NAN error, or if "0.00" is the equivalent.

Are you running Node-Red with the correct root permissions? as indicated in the directions. However, I will admit to a lack of NR knowledge on how to confirm that 😊 ... all I know it that I must be, as my DHT sensor works fine with same node/settings, although I am using GPIO 26.

---

<div class="post-metadata">

### Author: ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)
#### Post date: [29 August 2021 05:44 UTC](https://discourse.nodered.org/t/rpi4b-vs-dht22-vs-node-red/50346/3 "2021-08-29T05:44:18Z")

</div>

> [@millsienz](#):
>
> In my mind it could be an issue of BCM2385 vs BCM2711 for the later rpi4b versions but honestly at this point I'm unsure

Just noticed this... I am running an RPi3b so my results may not compare to yours.

---

<div class="post-metadata">

### Author: ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)
#### Post date: [29 August 2021 13:31 UTC](https://discourse.nodered.org/t/rpi4b-vs-dht22-vs-node-red/50346/4 "2021-08-29T13:31:39Z")

</div>

If the Dht is hooked up wrong you will get 00.00 on the output not NaN. The single hardest thing is figuring out which pin to hook up to.  
I use node-red-contrib-dht-sensor and the node does work. I use the BCM GPIO pin numbering scheme. Find a good website that lists out all the different pin numbering schemes and sort out which pin you need to hook to. The chip is pretty robust I've hooked them up backwards and they survived. I suspect you have the data on the wrong pin and it may take some research to get it right but once you do it should work. There are so many pin numbering schemes it's tough to slog through them.  
[EDIT]  
I'm sure you realize you are way behind on Node Red version. My DHT ran fine on that version but sooner or later consider an upgrade to new version.

---

<div class="post-metadata">

### Author: ![millsienz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/millsienz/32/47166_2.png) [@millsienz](https://discourse.nodered.org/u/millsienz)
#### Post date: [29 August 2021 14:11 UTC](https://discourse.nodered.org/t/rpi4b-vs-dht22-vs-node-red/50346/5 "2021-08-29T14:11:05Z")

</div>

> Are you running Node-Red with the correct root permissions?

Thanks for making this comment mate, sent me down an absolute rabbit hole from superusers/root, docker, yarn'in, and various git libraries

I'm unsure if my DHT22 sensor will work now but I did get my SCD30 sensor working in the end with a tiny bit of trial and error

 ![2021-08-30-015612_1024x768_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/c/ec66724f8e2d98a6edac1c38c158297bb9a0135f.png)

Now I'm really unsure how or where to throw these few lines of code, I have to try and see how accurate the sensor is tomorrow

 ![2021-08-30-020849_1024x768_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/7/d7de8d0fda3a37baab82c6c1617c614c8aed90fa.png)

Now I'mma try to implement a relay 🙂  
Thanks again for your help

---

<div class="post-metadata">

### Author: ![millsienz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/millsienz/32/47166_2.png) [@millsienz](https://discourse.nodered.org/u/millsienz)
#### Post date: [29 August 2021 14:14 UTC](https://discourse.nodered.org/t/rpi4b-vs-dht22-vs-node-red/50346/6 "2021-08-29T14:14:26Z")

</div>

Roger the DHT sensor does seem like a bit of buggery, I might a have a look around for more high quality / reliable sensors like the SCD30

Ha good catch on that Node Red version! I copy pasted that problem template changed all other versions but not the NR one

---

<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: [28 October 2021 14:15 UTC](https://discourse.nodered.org/t/rpi4b-vs-dht22-vs-node-red/50346/7 "2021-10-28T14:15:24Z")

</div>

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