question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

libgpiod_pulsein64 not found

See original GitHub issue

I tried running test of pulseIn on a 64 Bit RaspiOS system and it complained that libgpiod_pulsein64 is not found.

Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import pulseio
>>> pulses = pulseio.PulseIn(board.D18)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 74, in __init__
    self._process = subprocess.Popen(cmd)
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64'
>>> 

I created my own

sudo apt install libgpiod-dev
git clone https://github.com/adafruit/libgpiod_pulsein.git
cd libgpiod_pulsein/src
make 
sudo cp libgpiod_pulsein /usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64

and it now works fine - even ran the dht22 simpletest!

pi@gjnpi4test64bit:~/libgpiod_pulsein/src $ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import pulseio
>>> pulses = pulseio.PulseIn(board.D18)
>>> 
pi@gjnpi4test64bit:~ $ python3 dht.py 
Temp: 77.0 F / 25.0 C    Humidity: 33.0% 
Temp: 76.5 F / 24.7 C    Humidity: 22.5% 
Temp: 76.3 F / 24.6 C    Humidity: 22.4% 

However, I see that libgpiod_pulsein64 is in the repository but it is not installed via sudo pip3 install adafruit-blinka https://github.com/adafruit/Adafruit_Blinka/tree/main/src/adafruit_blinka/microcontroller/bcm283x/pulseio

does this line have to be modified to include libgpiod_pulsein64? https://github.com/adafruit/Adafruit_Blinka/blob/main/setup.py#L70

If that is sll it needs, I’ll be happy to create a PR. I just wanted to check that there was not more that needed to be done.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
makermelissacommented, Feb 9, 2022

Hmm, ok. I didn’t realize Pip was not installing the binary, which is a problem. I’ll take a look into if there’s a way to remedy that. As for libgpiod-dev, we can update our raspberry pi blinka installer script, which might also be the answer for the missing binary.

1reaction
StevenAFCcommented, Feb 6, 2022

I am also having this issue, I have had to do the following in my Dockerfile:

# Hack
RUN wget https://github.com/adafruit/Adafruit_Blinka/raw/main/src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64
RUN cp libgpiod_pulsein64 /opt/venv/lib/python3.10/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64
RUN chmod u=rwx,g=rwx,o=rwx /opt/venv/lib/python3.10/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64
Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
I am running Ubuntu Server 20.04 LTS 64-bit on a Raspberry Pi 3 B. I have a DHT11 ... Hi, it looks like...
Read more >
GPIO character device v1 API not enabled in kernel
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party...
Read more >
CircuitPython Libraries on Linux and Google Coral
use the python libgpiod bindings. ... ttymxc2 does not exist) so these pins cannot be used for GPIO ... You can use these...
Read more >
Applications - Pin Control and GPIO - Developer Help
The libgpiod was created a better way to access the GPIO driver. There are six commands in libgpiod tools: gpiodetect: list all gpiochips...
Read more >
Read out DHT11/22 with RaspberryPi 4 and Ubuntu Server
I recently bought a RaspberryPi 4 and installed Ubuntu Server 20.04 64 Bit on it. There are many tutorials available how to read...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found