adafruit/Adafruit_Python_DHT

Can accessing gpio with sudo, still have Make sure program is run as root with sudo

amiceli opened this issue · 3 comments

I'ml trying to use my DHT11 sensor.
When I simpletest.py file, like this

sudo python simpletest.py

I always have this error : Make sure program is run as root with sudo

Thank you for your help

@amiceli :
Try this:
sudo simpletest.py

Does that work?

No I've the same error.

Are you using the latest Raspbian Jessie release? I can't repro the same issue with Jessie. The code tries to do memory mapped access to the Pi's GPIO registers and if that fails then it can throw an error like you see warning to run as root with sudo (the most common reason for memory mapped GPIO to fail). If you're using a different Linux distro perhaps the root user doesn't have access to memory mapped GPIO (which would be really odd). Try the latest Raspbian Jessie release, thanks!