richardhughes
Posts: 4
Joined: Thu Jun 04, 2015 7:47 pm

Unable to take humidity reading

Thu Jun 04, 2015 7:53 pm

I have copied over the sample code from the gifthub page for the humidity sensor readings (as it is required in my idea), however whenever I try to run it I get an error saying that there is a "False OSError Humidity Init Failed, please run as root / use sudo"
What does this mean and how can I use sudo in the code to make it work.
Thanks,

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1665
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: Unable to take humidity reading

Thu Jun 04, 2015 8:26 pm

It means you just need to run the code as the super user, the please run as root / use sudo bit is telling you what to do.
The notes you received with the Astro Pi explain this. Just open a terminal window and type in this command:

Code: Select all

sudo idle3 &
Think of sudo as super-user-do, it's like Run as Administrator in Windows.
That will then launch the Python 3 programming environment under the root user, load up your code and then it should work.

richardhughes
Posts: 4
Joined: Thu Jun 04, 2015 7:47 pm

Re: Unable to take humidity reading

Fri Jun 05, 2015 6:30 am

Thank you :D

Return to “Astro Pi”