All sensors output 0.0
See original GitHub issueGreetings,
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.
$ cat acc-example.py
from sense_hat import SenseHat
sense = SenseHat()
while True:
acceleration = sense.get_accelerometer_raw()
x = acceleration['x']
y = acceleration['y']
z = acceleration['z']
x=round(x, 0)
y=round(y, 0)
z=round(z, 0)
print("x={0}, y={1}, z={2}".format(x, y, z))
When running the above, I just get this:
$ python acc-example.py
x=0.0, y=0.0, z=0.0
x=0.0, y=0.0, z=0.0
x=0.0, y=0.0, z=0.0
x=0.0, y=0.0, z=0.0
...
Examples from the prompt showing other sensor behavior:
$ python
Python 3.6.2 (default, Jul 22 2017, 21:19:22)
[GCC 7.1.1 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sense_hat import SenseHat
>>> s = SenseHat()
>>> s.set_imu_config(True, True, True) ## just to be sure
>>> s.get_orientation_radians()
{'roll': 0.0, 'pitch': -0.0, 'yaw': -0.0}
>>> s.get_compass()
-0.0
>>> s.get_gyroscope()
{'roll': 0.0, 'pitch': -0.0, 'yaw': -0.0}
>>> s.get_accelerometer_raw()
{'x': 0, 'y': 0, 'z': 0}
Iβm using arch ARM.
$ cat /boot/config.txt
# See /boot/overlays/README for all available options
gpu_mem=128
initramfs initramfs-linux.img followkernel
start_file=start_x.elf
fixup_file=fixup_x.dat
dtparam=i2s=on
dtparam=spi=on
dtparam=i2c_arm=on
dtoverlay=rpi-sense
$ cat /etc/modules-load.d/raspberrypi.conf
snd-bcm2835
i2c-dev
bcm2835-v4l2
Does anything look awry above, or would you have tips on finding out whatβs wrong?
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (1 by maintainers)
Top Results From Across the Web
When reading from multiple sensors i get all values to 0.0 ...
I want to collect Accelerometer,Accelerometer (Without Gravity) and Gyroscope data from my phone and send it to a TCP socket in my PC....
Read more >Products | All Sensors
The CPM 502 Series offers a ceramic, media isolated pressure sensor with ... Offset, - 0.4 to 0.0 mV/V (Other nominal values available...
Read more >PM Sensor always reading 0.0 - #24 by victor - Hardware
When I ask for a reading on the CLI, I see the fan on the PM sensor spin. Some CLI output, including version,...
Read more >ADXL362 output data "0.0,0" - Q&A - MEMS Inertial Sensors
The ADXL362 Acceleration Sensor is continuously generating 0,0,0 data during operation even on activation status. ("0,0,0" data come out all ...
Read more >lm_sensors - ArchWiki
Users wish to rename the output of some sensors. The cores might be displayed in an incorrect order. All of the above (and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Does this help, notice the blacklist (ubuntu user) https://github.com/J-Pai/EnvTrackerNode
On Sun, 1 Nov 2020 at 14:03, fjctp notifications@github.com wrote:
K. Confirming blacklist matters on arch as well.
Woohoo, I think this can actually be closed! tl;dr for the future:
/etc/udev/rules.d/*
for/dev/i2c-1
access, also consider thei2c
group method referenced here. A symptom of this will be the ability to run theEnvTrackerNode/scripts/sense_hat_demo.py
only as root/with sudo