Error when running diddyweb

Hey guys.
After i have assembled most of the piborg, i decided to connect my raspberry pi to a screen and run some of your cool guiding scripts.
But i am getting some annoying errors.
1. It said that i haven't install cv2 when i ran sudo ~/diddyborg-web/diddyWeb.py. The same error was thrown at me even after "sudo apt-get install cv2" i tried installing openCV aswell.
I then commented the section with cv2 out in the script, which led to an error i don't understand:

pi@raspberrypi ~ $ sudo ~/diddyborg-web/diddyWeb.py
Loading PicoBorg Reverse on bus 1, address 44
Missing PicoBorg Reverse at 44
PicoBorg Reverse was not found
Trying bus 0 instead
Loading PicoBorg Reverse on bus 0, address 44
Traceback (most recent call last):
File "/home/pi/diddyborg-web/diddyWeb.py", line 38, in
PBR.Init()
File "/home/pi/diddyborg-web/PicoBorgRev.py", line 264, in Init
self.Init(False)
File "/home/pi/diddyborg-web/PicoBorgRev.py", line 234, in Init
self.bus = smbus.SMBus(self.busNumber)
IOError: [Errno 2] No such file or directory

Would be much appreciated if anyone could clarify these errors for me.

Could it simply be, that the outputs need to be fulfilled in order for the script to work?

piborg's picture

For the cv2 errors you need OpenCV installed for python like this:
sudo apt-get -y install libcv-dev libopencv-dev python-opencv
Without this it will not be able to display the camera image.

The error you are now seeing is that the script cannot talk to the PicoBorg Reverse.
This is most likely a problem with the 3-wire cables connecting the Raspberry Pi to the PicoBorg Reverse.

The DiddyBorg kit should have a spare 3-wire cable for the PcioBorg Reverse connection.
I would try swapping each of the cables in turn with the spare cable and see if the problem is solved.

Thanks for the quick answer.
I thought i could simulate the process without connecting to the picoborg reverse. Looking forward to try again!

What can I do to test the connectivity of my reverse chip? I notice a red led blink every time I unplug and plug in the connectors from the reverse board to the pi board.

BTW, I was able to run this code and the motors turned without issue:

#!/usr/bin/env python
# coding: Latin-1

import PicoBorgRev
PBR = PicoBorgRev.PicoBorgRev()
PBR.Init()
PBR.ResetEpo()
print PBR.GetEpo()

PBR.SetMotors(0.3)
print PBR.GetDriveFault()
print PBR.GetDriveStatus()

piborg's picture

It sounds like the PicoBorg Reverse is still working if that set of commands work fine. My guess is that the problem is due to the GitHub repository not having our recent fixes for an I2C issue that was found.

I have just updated the code in GitHub, you should be able to get these changes using:

cd ~/diddyborg-web
git pull

If that does not work you should be able to force an update using:

cd ~/diddyborg-web
git fetch origin
git reset --hard origin/master

On a separate note your email mentioned some smoke after a possible miss-wiring of the battery to the PicoBorg Reverse. Be aware this may have damaged the board in unexpected ways and we do not recommend continuing to run the board. In the worst case a damaged board might cause further damage!

Subscribe to Comments for "Error when running diddyweb"