Skip to content

lgpio.error: 'GPIO busy' #135

@feurig

Description

@feurig

It seems that somewhere between bookworm and trixie my time and temperature sensors stopped working with a fresh raspberrian install (requirements are at https://github.com/feurig/merlot/blob/main/requirements.txt) The code is at https://github.com/feurig/merlot/.

root@bedroom:/usr/local/merlot# bin/analogclock.py
Traceback (most recent call last):
  File "/usr/local/merlot/bin/analogclock.py", line 15, in <module>
    cs_pin = digitalio.DigitalInOut(board.CE0)
  File "/usr/local/lib/python3.13/dist-packages/digitalio.py", line 209, in __init__
    self.direction = Direction.INPUT
    ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/dist-packages/digitalio.py", line 239, in direction
    self._pin.init(mode=Pin.IN)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/dist-packages/adafruit_blinka/microcontroller/generic_linux/rpi_gpio_pin.py", line 41, in init
    GPIO.setup(self.id, GPIO.IN)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 696, in setup
    _check(lgpio.gpio_claim_input(_chip, gpio, {
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
        PUD_OFF:  lgpio.SET_PULL_NONE,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        PUD_DOWN: lgpio.SET_PULL_DOWN,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        PUD_UP:   lgpio.SET_PULL_UP,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    }[pull_up_down]))
    ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/lgpio.py", line 755, in gpio_claim_input
    return _u2i(_lgpio._gpio_claim_input(handle&0xffff, lFlags, gpio))
  File "/usr/lib/python3/dist-packages/lgpio.py", line 458, in _u2i
    raise error(error_text(v))
lgpio.error: 'GPIO busy'

The solution in the following post solved the issue.
https://forums.adafruit.com/viewtopic.php?p=909765#p909765

However..
1 .The above suggests that "it is a temporary issue. It's been fixed, but not officially released, except in an alpha version."
2. The issue is larger than the previous issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions