bash Traceback (most recent call last): File "/home/raspberry/radio.py", line 11, in <module> CS = DigitalInOut(board.CE1) ^^^^^^^^^^^^^^^^^^^^^^^ (redacted traceback stuff) File "/usr/lib/python3/dist-packages/lgpio.py", line 458, in _u2i raise error(error_text(v)) lgpio.error: 'GPIO busy'code:
python import time import busio from digitalio import DigitalInOut, Direction, Pull import board import adafruit_rfm9x btnA = DigitalInOut(board.D17) btnA.direction = Direction.INPUT btnA.pull = Pull.UP CS = DigitalInOut(board.CE1) RESET = DigitalInOut(board.D25) spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO) iter = 0 def send_data(): global iter print("send %s"%iter) iter+=1 def get_data(): global iter print("get %s"%iter) iter+=1 def main(): try: while True: if not btnA.value: # Button pressed send_data() else: get_data() except KeyboardInterrupt: pass if __name__ == '__main__': main()
from smbus2 import SMBus, i2c_msg # Single transaction writing two bytes then read two at address 80 write = i2c_msg.write(80, [40, 50]) read = i2c_msg.read(80, 2) with SMBus(1) as bus: bus.i2c_rdwr(write, read)I got error below
Traceback (most recent call last): File "/home/example.py", line 62, in <module> bus.i2c_rdwr(write, read) File "/home/.local/lib/python3.12/site-packages/smbus2/smbus2.py", line 658, in i2c_rdwr ioctl(self.fd, I2C_RDWR, ioctl_data) BlockingIOError: [Errno 11] Resource temporarily unavailableand checking the i2c device by running
sudo dmesg | grep i2ci got this message
[22341.795707] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
dts /dts-v1/; /plugin/; / { compatible = "brcm,bcm2711"; fragment@0 { target = <&i2c1>; __overlay__ { status = "okay"; }; }; fragment@1 { target = <&i2c1>; __overlay__ { pcm1862: pcm1862@4a { compatible = "ti,pcm1862"; reg = <0x4a>; status = "okay"; }; }; }; };This one is working ok, when I use the i2cdetect -y 1 I can see that the corresponding address turns into UU. The next piece is where the issue starts, i can run this dtoverlay without kernel errors, but it's not adding them as a valid audio device, I could check this by using aplay-l and arecord-l and alsamixer: