Raspberry Pi GPIO - device or resource busy

37 Views Asked by At

I'm on a Raspberry Pi 4, and using a Navigator hat from Blue Robotics. When using their library, suddenly the initialization script has started throwing errors.

➜  python git:(master) ✗ python3 rainbow.py
thread '<unnamed>' panicked at 'Error: Error during CS2 export: Io(Os { code: 16, kind: ResourceBusy, message: "Device or resource busy" })', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/navigator-rs-0.3.1/src/lib.rs:313:23
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/home/pi/navigator-lib/examples/python/rainbow.py", line 33, in <module>
    main()
  File "/home/pi/navigator-lib/examples/python/rainbow.py", line 21, in main
    navigator.init()
pyo3_runtime.PanicException: Error: Error during CS2 export: Io(Os { code: 16, kind: ResourceBusy, message: "Device or resource busy" })

See: https://github.com/bluerobotics/navigator-rs/blob/bf5734f00244c26f06037457fe2179b33409a94a/src/lib.rs#L310-L317

I cannot do "echo 16 > /sys/class/gpio/export" or unexport. It also says

➜  python git:(master) ✗ echo 16 > /sys/class/gpio/export
echo: write error: device or resource busy

The issue specifically occurred after I removed their Docker containers, but I also think this should be unrelated. I'm using their default image, and have tried reverting to their kernel (after doing the usual apt update and apt upgrades).

Does anyone know what is going on and how to fix this? What more information can I provide to help you? I am totally befuddled since this is the first time I saw this specific issue.

Thanks

0

There are 0 best solutions below