node-dht-sensor icon indicating copy to clipboard operation
node-dht-sensor copied to clipboard

Using wiringPi instead bcm2835

Open Xento opened this issue 10 years ago • 8 comments

Makes node-dht-sensor compatible with banana pi.

Xento avatar Dec 15 '14 09:12 Xento

This is very good! I was thinking of using wiringPi for sometime now. Unfortunately I do not have a Banana Pi to test it but I have, however, tested it on a Raspberry Pi and it is no longer being able to read the sensor. My feeling is that it could be the delay functions. I will debug it further and get back to you as soon as I get an patch that works for the Raspberry Pi and It would be nice if you could validade it against the BananaPi (assuming you have one...) Thanks!

momenso avatar Dec 16 '14 00:12 momenso

Yes I have a Banana Pi and it works like a charm. I wondered that it worked with such a small change. Did you adjust the pin number? WiringPi uses a different numbering.

Xento avatar Dec 16 '14 09:12 Xento

Yeah, you're right! It was the pin numbering that is different. I'll leave it working for a while to see if I notice any problems. Thank you.

momenso avatar Dec 17 '14 00:12 momenso

What about my fix?

Xento avatar Feb 01 '15 20:02 Xento

Why are you using wiringPi, instead of BCM2835 directly?

momenso avatar Feb 02 '15 21:02 momenso

Because i have an banana pi ;)

Am 02.02.2015 um 22:09 schrieb David Jose Momenso [email protected]:

Why are you using wiringPi, instead of BCM2835 directly?

— Reply to this email directly or view it on GitHub.

Xento avatar Feb 03 '15 05:02 Xento

Ok, I understand. You have a fair point and your implementation is good. The problem is that wiringPi not only adds another dependency to the project but also breaks compatibility with existing GPIO numbering convention. Therefore, this change would affect many applications already deployed out there and I really want to avoid this problem.

Because the bananaPi also uses the BCM2835 chip it should be possible to access the GPIO in a similar way without requiring wiringPi but so far I did not find any references to this approach. Perhaps a closer look into wiringPi may reveal how to implement this.

momenso avatar Feb 03 '15 22:02 momenso

Thanks for the changes Xento, based on them I can now run my script without sudo. I forked this repository, made the same changes as you and made wiringPi to use GPIO numbering. See https://github.com/HardwareProjects/node-dht-sensor

inouiw avatar Feb 23 '16 17:02 inouiw