Python "Resource temporarily not available"

January 1, 2024, 00:45

brokeskill

py
pi@ROS:~/Desktop $ python pl.py
Traceback (most recent call last):
  File "/home/pi/Desktop/pl.py", line 5, in <module>
    kit = ServoKit(channels=16)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_servokit.py", line 92, in __init__
    self._pca.frequency = frequency
    ^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_pca9685.py", line 176, in frequency
    old_mode = self.mode1_reg  # Mode 1
               ^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_register/i2c_struct.py", line 81, in __get__
    i2c.write_then_readinto(buf, buf, out_end=1, in_start=1)
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_bus_device/i2c_device.py", line 140, in write_then_readinto
    self.i2c.writeto_then_readfrom(
  File "/home/pi/.local/lib/python3.11/site-packages/busio.py", line 224, in writeto_then_readfrom
    return self._i2c.writeto_then_readfrom(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 98, in writeto_then_readfrom
    readin = self._i2c_bus.read_i2c_block_data(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/Adafruit_PureIO/smbus.py", line 264, in read_i2c_block_data
    ioctl(self._device.fileno(), I2C_RDWR, request)
BlockingIOError: [Errno 11] Resource temporarily unavailable
I get this error when trying to run my script which should move the servos connected with my pca9685

k9t33n

I can't help but to help you get help from others I'd suggest you give the code that's giving this error

oops.se

Please read https://discord.com/channels/818384379197784084/1189386838788542464 and edit your question accordingly.

brokeskill

done

brokeskill

py
pi@ROS:~ $ dmesg | grep i2c
[  354.811529] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration