senft44
December 13, 2023, 11:39pm
1
I am using an UP Board to run the Enviro+, PM, and CO2 sensors and so far I got the BME280 sensors and light sensor reading just fine, but all the other sensors require RPi.GPIO pip package, and that refuses to run on x86.
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
Is there anyway to use the other modules on the enviro on an SBC that is NOT a raspberry pi?
hel
December 14, 2023, 11:02am
2
Check out the updated Pi 5 drivers - they use a new kernel library for interacting with the GPIO that might be more accommodating of other SBCs?
pimoroni:main
← pimoroni:feature/repackage
opened 11:53AM - 23 Oct 23 UTC
## Using This Branch
Hey ho, this is the first Pimoroni Python product - igno… ring all of its library dependencies - to make a full transition to gpiod, virtual environments and the shiny new Pi 5.
As such, I'd really like your feedback!
To use this library:
```
git clone https://github.com/pimoroni/enviroplus-python -b feature/repackage
cd enviroplus-python
./install.sh
```
A venv *should* be created for you, though this step will be skipped if you're already inside one (in theory).
Things to look out for:
1. Any errors writing `/boot/firmware/config.txt`
2. Make sure `/boot/config.txt` is still a symlink to `/boot/firmware/config.txt` - I think `sed` breaks this horribly
3. Examples and such are copied to `~/Pimoroni`
4. No missing packages or heinous compile steps during install
Some debugging steps:
1. Run `gpioinfo` to see the state of your IO (needs `apt install gpiod`)
2. Run `cat /proc/device-tree/model` since `gpiodevice` looks here to try and do per-platform pin setup
## TODO
### Pre-requisites
1. [x] libgpiod / gpiod applied & released
6. [x] sounddevice, does it still work?
7. [ ] Get the "venv" stuff right- pending some direction from Pi maybe? - https://github.com/raspberrypi/bookworm-feedback/issues/100
* I really don't know if what we're doing is strictly *right* but it's at least close enough
8. [ ] Smooth over libgpiod differences between platforms (https://github.com/pimoroni/gpiodevice-python)
* Still some issues in `gpiodevice-python` where it will fail quite cryptically if you try to look up a number rather than a pin label, eek!
### Need porting (maybe)
1. [x] pimoroni-bme280 - WIP https://github.com/pimoroni/bme280-python/pull/26
9. [x] pms5003 - WIP https://github.com/pimoroni/pms5003-python/pull/19
10. [x] ltr559 - https://github.com/pimoroni/ltr559-python/pull/17 (merged, and released v1.0.0)
11. [x] st7735 - WIP https://github.com/pimoroni/st7735-python/pull/33
12. [x] ads1015 - https://github.com/pimoroni/ads1015-python (merged, and released v1.0.0)
### Gotchas
Caught in this port, `raspi-config nonint do_serial` has now changed to ignore the nonint flag and show a UI. Seems to have been split into `do_serial` and `do_serial_pi5` - https://github.com/RPi-Distro/raspi-config/blob/9ccd4bbe5eccaf09137cc42eefd18f95072c70f2/raspi-config#L1174-L1218
senft44
December 14, 2023, 5:30pm
3
Thanks for the reply!
I was actually poking around GPIOd.
I’ll have to take a look at the new scripts
The install script has never worked for me, x86 SBC and Debian 12.