I need help. I bought a PivotPi base kit a few weeks ago and I have been unable to control a servo or the LEDs on the PivotPi board with either Scratch or Python. Here is where I am at:
I attached the PivotPi board to a Raspberry Pi 3 Model B. On the PivotPi board, the blue power light and the eight yellow LED lights all come on and never go out, while the Raspberry Pi is powered.
I tried attaching a small servo to various ports on the PivotPi board.
When I attach the battery pack to the PivotPi board, the green battery light goes on and the servo makes a âclickâ sound.
The two dipswitches on the PivotPi board are at 0.
Used the Scratch example program to pivot the cats head 180 degrees and turn its eyes yellow and red, but the servo did not budge.
Used python. At the python command line, I entered âimport pivotpiâ and then âmy_pivot = pivotpi.PivotPi()â and then received the error message âIOError: PivotPi not connectedâ from line 44 of pivotpi.py.
I donât know where to go from here. I have a feeling that either my PivotPi board is fried or the instructions on the Dexter Industries web site is missing some critical step for my model of the Raspberry Pi. Please help.
Sorry it isnât working, thatâs frustrating. Are you using raspbian for robots? If not that could explain it. And thanks for taking the time to describe your problem!
I tried âcd ~/Desktop/PivotPi/Installâ and âsudo bash install.shâ before. I tried again to no avail.
I traced the error that I receive with the python command âmy_pivot = pivotpi.PivotPi()â to the command âimport smbusâ in I2C.py. Perhaps the libraries that I downloaded at GitHub (âgit clone https://github.com/DexterInd/PivotPi.gitâ) are not for the Raspberry Pi 3?
I started downloading the 1.5GB zip file for Raspbian for Robots, though it will probably be a few weeks before I have enough time to install this new OS.
thank you for the tracing of this error. Much appreciated.
(the following is no longer needed:
Would you mind trying the following? sudo apt-get install libi2c-dev python-serial i2c-tools python-smbus python3-smbus -y
and letting us know whether it helps?
But this is still valid:
The files you have on your SD card are meant to be compatible with the Raspberry Pi 3, so thatâs not a worry. It looks more like a step is missing in the install script.
Cleo
Hello @SquareRoots
I just created a new SD card from the ânakedâ Rasbpian (not Raspbian for Robots) and I have no issue with pivotpi.
I just noticed the instructions said: cd /home/pi mkdir Dexter cd Dexter git clone https://github.com/DexterInd/PivotPi.git cd Install sudo bash install.sh
but thereâs one line thatâs missing.
It should be
cd /home/pi mkdir Dexter cd Dexter git clone https://github.com/DexterInd/PivotPi.git cd PivotPi cd Install sudo bash install.sh
When you run the install script, it should end with a reboot. Did you get to that ?
It works! I tried your suggestion of installing the five software packages:
sudo apt-get install libi2c-dev python-serial i2c-tools python-smbus python3-smbus -y
The newest version of python-serial had already been installed, but the other four packages were new. Before I ran the above command, I found those four packages under /var/cache/apt/archives/ already, so I wonder whether my original installation of the PivotPi software was interrupted before it finished.
Anyway, after those four packages were installed, I was able to pivot the servo and turn on/off the LEDs on the PivotPi board with Python commands. Great! Now on to building stuff with these servos.
Thanks for letting me know youâre now up and running!
Those libraries are installed by the install script. It seems it was run properly.
Hereâs a link to the install script. You can see that the libraries get installed on line 48
There are other things that the install script does so you may get some issues if the installation ismât run properly.
What happens when you run it?