Unable to pivot PivotPi[SOLVED]


#1

Hi,

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:

  1. 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.
  2. I tried attaching a small servo to various ports on the PivotPi board.
  3. When I attach the battery pack to the PivotPi board, the green battery light goes on and the servo makes a “click” sound.
  4. The two dipswitches on the PivotPi board are at 0.
  5. I followed the instructions about how to “Get the PivotPi Code on Your Own Card” at https://www.dexterindustries.com/pivotpi-tutorials-documentation/pivotpi-program-the-servo-controller-for-the-raspberry-pi/.
  6. 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.
  7. 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.

Regards,
SquareRoots


#2

Sorry it isn’t working, that’s frustrating. :frowning: Are you using raspbian for robots? If not that could explain it. And thanks for taking the time to describe your problem! :smiley:


#3

Sorry you’re experiencing a difficult start.
Here are a couple of things:

  1. Scratch is only supported if you’re using Raspbian for Robots.
  2. Python will work on any flavour of Raspbian, However you must run the install script:
    cd ~/Desktop/PivotPi/Install sudo bash install.sh

Let me know if this gets you further, please
Cleo


#4

Hi,

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.

Regards,
SquareRoots


#5

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


#6

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 ?


#7

Hi,

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 the help,
SquareRoots


#8

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?


#9

This topic was automatically closed after 24 hours. New replies are no longer allowed.