Raspberry pi pca968

I 've loaded the drivers web page Adafruit.ADAFRUIT_PCA9685
CODE installed on raspberry pi 4. sudo spt-get install git cd
git clone https:// github.com /cd Adafruit_python_PCA9685
sudo python setup.py install
I couldn’t give all the code at the top as its covered by the copy button .
When I run the simpletest.py thats cd into ADAFRUIT_PCA9685 pyhon simpletest.py

I get returned no module name Adafruit_GPIO ?
This is from MAKE TUTOR YOUTUBE it works in her video
Anyone help please
This is to run the Pca9685 with raspberry pi r4 to run 4 servo motors or more

Hi James,

Any project with lots of servos has me interested.

I assume that this is the video you have watched?

To get started, I have found a source of many Pi issues comes done to an OS mismatch so if you could share what version you are running that would also be appreciated.

We’re happy to help but need some more info to do so.

What does this mean ??
The GitHub page or the Video.

Note: Since the video was made the Library has been deprecated by Adafruit.
Possibly the Adafruit_GPIO module no longer exists. You would have to check the script output from
sudo python setup.py install

This highlights the problem of making a video and then the manufacture or software developer changes things.
All YouTube how to videos should be viewed as information only, not a definitive how to.

Is it necessary to use a Pi 4 ??
Adafruit have gone the Circuit Python way, maybe a Pico or other RP2040 devices might work just as good.

Cheers
Jim

EDIT: As a side note rant, I hate the way YouTube now makes me watch ads that never seem to stop.
I know a way around it, but it is very annoying compared to how YouTube used to work.

1 Like

Ran through the GitHub install instructions on Pi 4B.
git clone https://github.com/adafruit/Adafruit_Python_PCA9685.git
Did not look the same as the video.
There were missing files in folder compared with the video.

sudo python setup.py install
Did not work either, said ‘file is not a zipfile’.

Tried sudo pip install adafruit-pca9685 as suggested by the GitHub page.
This seemed to work ok and one of the installs was Adafruit-GPIO.

You could try contacting Adafruit, probably they will say it is ‘deprecated’ and no longer supported.
No idea if this is what you experienced or if pip will work for you.
The problems I experienced could be due to the version of Pi OS.
But overall it is not looking good.

Regards
Jim

EDIT: Had another go with a clean install of latest Pi OS, didn’t get much further.
The script messages say it is ‘deprecated’ and to use Build and PIP and other standard based tools.
Considering the GitHub library is 7 years old, was deprecated 2 years ago and the video is 3 years old.
I would give up on trying to get this to work, there will be no support for it.

The PCA9685 is an I2C interface so other libraries on GitHub should work.
There is nothing special about the Adafruit board that you have to use their software.
There are other versions of the board, much cheaper than Adafruit.

1 Like

I didn’t buy adaruit pca9685
I got cheaper one of amazon Ill give it a go.with other libraies

If come up with the best way to get my servo working
Please send information please thanks james

The best library I could find is Adafruit_CircuitPython_PCA9685 on GitHub.

You will need Bullseye installed on the Pi, Bookworm did not work.

Pi OS

From GitHub:
To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-pca9685

Check the last message from the script says Successfully installed Adafruit-Blinka … and other packages.

When I ran the example
sudo python3 pca9685_simpletest.py
it replied with No I2C device at address: 0x40.
Which is expected as I don’t have a PCA9685 board.
Thats about the closest I can get it to running.

Cheers
Jim

EDIT: The no device message occurred at Line 17 of the python script.
pca = PCA9685(i2c_bus)
which means all the imports worked and is the first point in the script where it wants to talk to the board.

1 Like

Hi James,

Thanks for the having a crack at it, the pip commands don’t work on Bookworm so this line won’t work.

sudo pip3 install adafruit-circuitpython-pca9685

We are actively looking for a fix ourselves as the PiicoDev libraries also use it. At some point there will be a workaround or libraries will adapt.

Unfortunately it will be developers like Core with PiicoDev that will adapt.
The GitHub page Python on Raspberry Pi details the changes with Bookworm and Python.

Therefore from Bookworm onwards, packages installed via pip must be installed into a Python virtual environment using venv . A virtual environment is a container where you can safely install third-party modules so they won’t interfere with, or break, your system Python.

Probably will make for more stable environments. In the past; if something screws up with my project, I have found it easier to just load a new Pi OS and start again. Maybe virtual environments will solve this.

But it is a massive change and will be hard to deal with.
Bookworm will get blamed when its the Python community that has initiated it.

This has been introduced by the Python community, not Raspberry Pi

Regards
Jim

EDIT: I ran through the process using a virtual python environment in Bookworm. So far all good and not too hard to setup.
Adafruit PCA9685 libraries installed ok using pip3.
Thonny is pretty easy to setup to access this virtual environment too. Thonny remembers the virtual environment on next boot. I could also install the PiicoDev libraries from Thonny.
If using the command line you just need to activate the environment first.

Might be a good idea for a guide.

2 Likes

Hey James,

This is something we are actively looking into currently as it obviously affects our Piicodev examples.

There is also the process of using the --break-system-packages parameter to install the package, but it can be a bit risky.

Cheers,
Blayden

1 Like