adafruit / Adafruit_CircuitPython_DHT

CircuitPython support for DHT11 and DHT22 type temperature/humidity devices
MIT License
179 stars 62 forks source link

libgpiod_pulsein is armhf 32-bits, doesn't work on 64-bits OS #51

Open goldyfruit opened 3 years ago

goldyfruit commented 3 years ago

I'm running Ubuntu 20.04/Raspberry Pi OS 10 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