-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All sensors output 0.0 #79
Comments
Solved. It was a permissions issue. Default:
After implementing a
|
Aside/comment: in trying to troubleshoot this, there are a lot of examples online where
This led me to think it was an issue with my devices or modules vs. permissions. Finally it dawned on me to just try Could the error message be improved to help users understand if it's device existence vs. permissions? |
sudo shouldn't be needed if the Pi is configured correctly. I see you're using Python 3.6 which is not the standard in Raspbian. Are you not using Raspbian? How are you using Python 3.6? The apt package |
@bennuttall running into this issue on an RPi that I needed to run Ubuntu Server on. I'm trying to use the Python module to validate my own Sense driver I'm writing in another language, and unfortunately I'm getting all zeroes back for only the Python code. Where can I find out more about what's in the |
@theckman, I'm encountering the same issue. I'm running Ubuntu Server, just like you, and all my sensor values are 0. This is what I did:
Some guidance on how to get this to work / what to try next would be appreciated. Thanks! |
@beamerblvd Thank you for clarifying your steps; I probably did pretty much the same as you. |
RTIMULib (and forks) seem to have no issues for whatever reason, and that trend continues with the recently discovered RTIMULib2, though one does. I just posted an inquiry there to see if we can find out why none of the sensors are working. If you look at my post there, you can see an attempt to manually walk through the sense hat initialization of pressure/humidity sensors here. I can't get them to initialize. I have the same experience as @beamerblvd : accel reads, lights can be changed, but none of the other sensors are outputting. Depending on how I do it, I get 0 or the |
I am encountering the same issue. I am running Ubuntu Server 20.04.1. It is a fresh install. Issues
Debug steps
|
@fjctp I think we're at the mercy of someone with |
Does this help, notice the blacklist (ubuntu user)
https://github.com/J-Pai/EnvTrackerNode
…On Sun, 1 Nov 2020 at 14:03, fjctp ***@***.***> wrote:
I am encountering the same issue. I am running *Ubuntu Server 20.04.1*.
It is a fresh install.
Issues
1. I got this error when I run get_temperature(), get_humidity(), or
get_pressure().
OSError: XXXX Init Failed
1. I got zeros reading when I run get_accelerometer_raw(),
get_gyroscope(), and get_compass()
Debug steps
1. Check if i2c is working
***@***.***:~$ ls -al /dev/i2c-1
crw-rw---- 1 root i2c 89, 1 Apr 1 2020 /dev/i2c-1
***@***.***:~$ cat /boot/firmware/syscfg.txt
# This file is intended to be modified by the pibootctl utility. User
# configuration changes should be placed in "usercfg.txt". Please refer to the
# README file for a description of the various configuration files on the boot
# partition.
enable_uart=1
dtparam=audio=on
dtparam=i2c_arm=on
dtparam=spi=on
cmdline=cmdline.txt
***@***.***:~$ i2cdetect -F 1
Functionalities implemented by /dev/i2c-1:
I2C yes
SMBus Quick Command yes
SMBus Send Byte yes
SMBus Receive Byte yes
SMBus Write Byte yes
SMBus Read Byte yes
SMBus Write Word yes
SMBus Read Word yes
SMBus Process Call yes
SMBus Block Write yes
SMBus Block Read no
SMBus Block Process Call no
SMBus PEC yes
I2C Block Write yes
I2C Block Read yes
***@***.***:~$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- 5f
60: -- -- -- -- -- -- -- -- -- -- 6a -- -- -- -- --
70: -- -- -- -- -- -- -- --
1. add user to i2c group
sudo addgroup ubuntu input
sudo addgroup ubuntu i2c
1.
Tried to access sensor data with sudo python3 test_script.py. Still
had the same issues
2.
Build RTIMULib from source
git clone https://github.com/RPi-Distro/RTIMULib
cd RTIMULib/Linux/python
python setup.py build
python setup.py install
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#79 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYAXN4X3RQCAAZ4OXZH6YDSNVTCJANCNFSM4D4IBPWQ>
.
|
@bsimmo Thank you very much! The blacklist solved the problem. |
Correct. I complied some examples in |
@bsimmo and @fjctp I tried the blacklisting on arch and it did not work for me. It does work as root, however. This is a little bit annoying as I have to install python libs to the system folders, and I generally use This was pretty cool to see after years of not being able to do so:
Now, that said... other than this, what else can I check with respect to why this would only work as root?
The EnvTrackerNode readme states "Application requires sudo" as a possible problem, but doesn't state how to fix it. I'm posting an issue there, but would appreciate any other suggestions here. I'm actually not sure if it was the blacklisting or root use that actually fixed this for me in the end. |
Just wanted to leave my $0.02 here. The reason for the blacklist is b/c the RPi build of Ubuntu Server 20.04.1 comes with the Industrial I/O modules preloaded. To resolve this issue the blacklist disables those drives and allows the Sense HAT drivers (rpisense_fb) to actually pick up the sensors. I figured this out via lsmod. Since @jwhendy is using Arch (not Ubuntu), this may not actually impact his use case since I'm not sure if arch has those modules pre-installed. Example lsmod output:
If you notice the module names noted in the output above, they are associated with the problematic sensors that fail to be initialized. With the blacklist, these modules will not be loaded and the sensehat_fb (and associated modules) will be able to work as expected. Not sure why the ARM/RPi version of Ubuntu has this module pre-installed, but at least we have the option of disabling them. |
I'll try un-blacklisting those on arch to see if I note any effect. With the insight on root and i2c permissions, I haven't A/B tested to check the black list. I can confirm from memory that |
K. Confirming blacklist matters on arch as well.
Woohoo, I think this can actually be closed! tl;dr for the future:
|
Greetings,
I'm just getting started with the sense hat and am likely doing something wrong. I was working through this guide and controlling the LEDs was going great. I moved on to try the accelerometer example and just get zeros.
When running the above, I just get this:
Examples from the prompt showing other sensor behavior:
I'm using arch ARM.
Does anything look awry above, or would you have tips on finding out what's wrong?
The text was updated successfully, but these errors were encountered: