Git Product home page Git Product logo

Comments (9)

bpmurray avatar bpmurray commented on August 15, 2024

The real issue here is that it's based on node-dht-sensor which uses the bcm2835 library which itself requires root access. Probably the simplest solution is to rewrite my node to use the WiringPi library - that can now be initialised without being superuser. However, that will require some free time. I'll see what I can do in the near future. In the meantime, if you run node-red as root, it'll work OK.

from node-red-contrib-dht-sensor.

shooftie avatar shooftie commented on August 15, 2024

Nice, thanks for that. I was hoping you'd say otherwise but at least I now know.

from node-red-contrib-dht-sensor.

bpmurray avatar bpmurray commented on August 15, 2024

I've tried a bunch of things, and I can get it to work not using the BCM library. However, because of timing issues, there's no way to do it without being root. One possible alternative is to separate out the task to monitor the sensors, writing the data to a file, while the NodeRED part would then only have to read the file.

from node-red-contrib-dht-sensor.

bpmurray avatar bpmurray commented on August 15, 2024

For the time being, I'm closing this as a software limitation. When I get time, I'll redo this using a daemon that provides the information in the background.

from node-red-contrib-dht-sensor.

shooftie avatar shooftie commented on August 15, 2024

Thanks mate. I've put the RPi away for the time being but will pick it up again in the future for sure...

from node-red-contrib-dht-sensor.

TTVert avatar TTVert commented on August 15, 2024

Any progress on this? I'm in a weird situation where with my other Pi3 install it worked but on this new install i get the same issue "bcm2835_init: Unable to open /dev/mem: Permission denied" I tried to give that file 777 as a test then I got "bcm2835_init: Unable to open /dev/mem: Operation not permitted
31 Dec 22:50:18 - [error] [rpi-dht22:f5826526.273b68] TypeError: failed to initialize"

Dave

from node-red-contrib-dht-sensor.

whatifwhatelse avatar whatifwhatelse commented on August 15, 2024

got same problem and managed to solved that way :
I noticed that bcm2835 release 1.52 solved the problem allowing to use /dev/memgpio instead of /dev/men, thus not requiring root access.
so to make node-red-contrib-dht-sensor work i ha d to do this :

uninstall old bcm2835.1.38 (simply remove directory
install and make new release 1.52
uninstall node-red-contrib-dht-sensor using :
sudo npm uninstall --unsafe-perm -g node-red-contrib-dht-sensor
uninstall node-red-dht-sensor using :
sudo npm uninstall --unsafe-perm -g node-dht-sensor
reinstall both items above using
sudo npm install --unsafe-perm -g node-dht-sensor
sudo npm install --unsafe-perm -g node-red-contrib-dht-sensor

after these operations, node-red dht node worked perfectly.

from node-red-contrib-dht-sensor.

bpmurray avatar bpmurray commented on August 15, 2024

Thanks for the info - I'll add that to the doc.

from node-red-contrib-dht-sensor.

pakair avatar pakair commented on August 15, 2024

installed bcm release 1.52 but I still get errors on sudo npm install -g node-dht-sensor Tried the latest bcm 1.56, still errors on the npm command. Is there a solution?

from node-red-contrib-dht-sensor.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.