Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with gpiodevice #21

Open
tijmenvandenbrink opened this issue Nov 23, 2023 · 1 comment
Open

Issue with gpiodevice #21

tijmenvandenbrink opened this issue Nov 23, 2023 · 1 comment

Comments

@tijmenvandenbrink
Copy link

Hi,

I'm getting the following error after upgrading pms5003 from 0.0.5 to 1.0.0. I'm running on:

Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian

I get the following error:

Press Ctrl+C to exit!


StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tijmen/projects/enviroplus_exporter/enviroplus_exporter.py", line 52, in <module>
    pms5003 = PMS5003()
  File "/home/tijmen/projects/enviroplus_exporter/.env/lib/python3.9/site-packages/pms5003/__init__.py", line 109, in __init__
    self._pin_enable, self._pin_reset = gpiodevice.get_pins_for_platform(PLATFORMS)
  File "/home/tijmen/projects/enviroplus_exporter/.env/lib/python3.9/site-packages/gpiodevice/__init__.py", line 153, in get_pins_for_platform
    result.append(get_pin(pin, user_label, settings))
  File "/home/tijmen/projects/enviroplus_exporter/.env/lib/python3.9/site-packages/gpiodevice/__init__.py", line 138, in get_pin
    chip = find_chip_by_pins(pin)
  File "/home/tijmen/projects/enviroplus_exporter/.env/lib/python3.9/site-packages/gpiodevice/errors.py", line 45, in wrapper
    errors.append(next(i))
SystemError: <built-in method close of gpiod._ext.Chip object at 0x7fb1f3a850> returned a result with an error set

Any idea how to resolve this?

@Gadgetoid
Copy link
Member

It might be worth updating this library and trying again. I've been busy changing/breaking things.

Use the unstable install from within your virtual environment-

git clone https://github.com/pimoroni/pms5003-python/
cd pms5003-python
pip install .

I ran into this same error just yesterday and I can't quite recall why. I think I was calling 'Chip.request_lines' incorrectly, but the library should not do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants