Closed rsnitsch closed 4 years ago
Similar issue here; works fine on a Raspberry Pi 4, but fails on a Zero W. The blinka library is installed and passes the test script, but using adafruit_dht, I get:
RuntimeError: Timed out waiting for PulseIn message. Make sure libgpiod is installed.
Similar issue here on Raspberry Pi B+ v1.2 on an up to date Raspbian (buster 10) OS. Test script shows all ok but running the dht_simpletest.py configured for GPIO pin 4 I get:
Traceback (most recent call last): File "dht_simpletest.py", line 6, in <module> dhtDevice = adafruit_dht.DHT22(board.D4) File "/usr/local/lib/python3.7/dist-packages/adafruit_dht.py", line 273, in __init__ super().__init__(False, pin, 1000) File "/usr/local/lib/python3.7/dist-packages/adafruit_dht.py", line 69, in __init__ self.pulse_in = PulseIn(self._pin, 81, True) File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 71, in __init__ message = self._wait_receive_msg() File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 89, in _wait_receive_msg "Timed out waiting for PulseIn message. Make sure libgpiod is installed." RuntimeError: Timed out waiting for PulseIn message. Make sure libgpiod is installed.
Hi, it looks like you may not have libgpiod installed. Try running sudo apt install libgpiod2
.
Hi, it looks like you may not have libgpiod installed. Try running
sudo apt install libgpiod2
.
That is not the problem for me:
# apt search libgpiod2
Sorting... Done
Full Text Search... Done
libgpiod2/stable,now 1.2-3+rpi1 armhf [installed]
C library for interacting with Linux GPIO device - shared libraries
Ok, my problem looks to be resolved and the cause for me must be some suspect wiring to the sensor. I just happened to move the unit and sensor and it started working again.
"ladyada closed this 15 hours ago"
Please reopen the issue. I have opened this issue originally. It was hijacked by other guys that encountered (and apparently solved) entirely DIFFERENT problems.
My problem is still unsolved, therefore this issue should be reopened.
@rsnitsch please try raspbian - in case that solves it. we have not tested with ubuntu :)
@rsnitsch make sure your user is part of 'gpio' group.
If not, then run:
sudo usermod -aG gpio <your_username>
Then logout and login again, or just reboot the board.
I tried it again with Raspbian / Raspberry Pi OS and now it works.
Although I get:
DHT sensor not found, check wiring
But this is another issue, of course.
It seems to be related to 64-bits. I'm running Ubuntu 20.04 64-bits on my RPi 4B, and the libgpiod_pulsein
library shipped with adrafruit_blinka
Python package is 32-bits.
$ file ~/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein
/home/ubuntu/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=356bb870cf3f5a35b0862d12a708b782a9c365f6, not stripped
So basically I had to recompile the library for arm64
architecture, here are the steps:
$ sudo apt install libgpiod-dev git build-essential
$ git clone https://github.com/adafruit/libgpiod_pulsein.git
$ cd libgpiod_pulsein/src
$ make
$ cp libgpiod_pulsein ~/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein
It seems to be related to 64-bits. I'm running Ubuntu 20.04 64-bits on my RPi 4B, and the
libgpiod_pulsein
library shipped withadrafruit_blinka
Python package is 32-bits.$ file ~/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein /home/ubuntu/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=356bb870cf3f5a35b0862d12a708b782a9c365f6, not stripped
So basically I had to recompile the library for
arm64
architecture, here are the steps:$ sudo apt install libgpiod-dev git build-essential $ git clone https://github.com/adafruit/libgpiod_pulsein.git $ cd libgpiod_pulsein/src $ make $ cp libgpiod_pulsein ~/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein
This works, thanks. Working on manjaro for raspberry PI 3B.
I am running Ubuntu Server 20.04 LTS 64-bit on a Raspberry Pi 3 B. I have a DHT11 sensor module.
I am following the instructions from https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/python-setup but the code does not work for me.
I have successfully executed these commands beforehand:
This is my code:
This is the error I get:
I have also followed the instructions for "Setup your Linux Board for using CircuitPython Libraries". The script blinkatest.py completes successfully (Link to code: https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi#blinka-test-3-15). Output:
The file libgpiod_pulsein does exist. The Python code seems to try and run it with subprocess.Popen. That's strange IMHO since the "lib" prefix does imply that it is a library, not an executable, right? On the other hand, a library should have a suffix of ".so". I am dumbfounded by that file name. By the way, this is ldd output for the file:
This is the stat output:
I have tried to reinstall the packages, but it did not fix my problem.