Python PCA_9685 library stopped working on Raspbian

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Holmes78
 
Posts: 3
Joined: Mon Apr 14, 2014 8:00 am

Python PCA_9685 library stopped working on Raspbian

Post by Holmes78 »

I'd been using the Adafruit Python PCA9685 library for some time now without any problems like this. And then, just as of the last week or so, I'm getting this error:

Code: Select all

File "./lights005", line 20, in <module>
    pwm = Adafruit_PCA9685.PCA9685()
  File "build/bdist.linux-armv6l/egg/Adafruit_PCA9685/PCA9685.py", line 74, in __init__
  File "build/bdist.linux-armv6l/egg/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
  File "build/bdist.linux-armv6l/egg/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
RuntimeError: Could not determine default I2C bus for platform.
I reinstalled the library, to no avail. I suspect it's something to do with a recent RPi update, since I haven't touched this script recently.
I'm running Raspbian Jessie on an RPi 2B.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Python PCA_9685 library stopped working on Raspbian

Post by adafruit_support_mike »

What output do you get from `i2cdetect -y 1`?

User avatar
Holmes78
 
Posts: 3
Joined: Mon Apr 14, 2014 8:00 am

Re: Python PCA_9685 library stopped working on Raspbian

Post by Holmes78 »

Code: Select all

pi@Garage:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- --                         

User avatar
Holmes78
 
Posts: 3
Joined: Mon Apr 14, 2014 8:00 am

Re: Python PCA_9685 library stopped working on Raspbian

Post by Holmes78 »

Okay, well I was trying to run through snippets of the library code from Adafruit_I2C.py (in a Python shell) in order to narrow down the problem, and I got "no module named Adafruit_GPIO.Platform ...

Long story short, I installed the Adafruit_Python_GPIO library and it works again.

It's too late for me to try to figure out exactly what happened, but I'd still like to see if I can do so (not at 2am) sometime.

I can't imagine how it could've worked if I hadn't previously installed that library ... nor how I could've managed to uninstall it. Maybe I can sort through some logs later.

Anyway, all's well that ends well!

User avatar
santorcuato
 
Posts: 12
Joined: Mon May 22, 2017 5:46 pm

Re: Python PCA_9685 library stopped working on Raspbian

Post by santorcuato »

[SOLVED]

Holmes,

I'm getting the same error after an update...

"Long story short, I installed the Adafruit_Python_GPIO library and it works again"

Nice but, How do you reinstall the Adafruit_Python_GPIO library?

Thanks in advance!

R

EDIT ========

The reinstall does nothing positive for me... But, first remove:

Code: Select all

sudo pip uninstall adafruit-gpio
and then reinstall. Done!

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”