pvint / CHIP-Scripts

Some scripts for controlling things with a NextThing C.H.I.P.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PCA9685.py error after device idle for hours

pvint opened this issue · comments

After a period of time (minimum 8 hours - likely was ~18h), when setting the duty cycle I got the following:

Traceback (most recent call last):
  File "./PCA9685_PWM.py", line 78, in <module>
    freq = pwm.get_pwm_freq()
  File "build/bdist.linux-armv7l/egg/Adafruit_PCA9685/PCA9685.py", line 124, in get_pwm_freq
  File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 150, in readU8
  File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 155, in read_byte_data
IOError: [Errno 5] Input/output error

Adding -r to the same command resolved it. It would be nice to catch this and reset automatically.