Diablo - Powerful motor control for your robots!
Installation issues
- Permission denied, file not found, 404 or similar:
There are a few possible causes of this:- Out of disk space:
We have occasionally seen this with people who have smaller SD cards, check by usingdf
If the Use% column reads 99 or 100% on rootfs you probably need to remove some files to free up space - Unable to find file / 404:
Most likely the internet connection is down or there are problems with the command, check you are connected to the internet okay withping -c4 google.co.uk
If you get errors it is probably the connection, if not check the name is correct.
If there is still a problem it might be an issue with the Linux repositories, trysudo apt-get update
to update where on the internet the Raspberry Pi looks for packages. - Unable to write to the given location:
This should not be the case (instructions use the users own folder), but try running using 'sudo'
- Out of disk space:
- E: Unable to locate package ...
Check your internet connection is okay as above, otherwise trysudo apt-get update
to update where on the internet the Raspberry Pi looks for packages. - PiBorg logo is missing from the desktop (text is there):
sometimes the desktop refresh is a bit temperamental, try restarting the Raspberry Pi.
Use issues
- My motor spins when I am not running any code
The most likely cause for this is a wiring problem, double check all the connections as shown on the Getting Started tab. - My motor runs backwards
Swap the M+ and M- connections for the given motor at the Diablo terminals. - My motor does not work
Check you are not seeing any errors displayed when callingInit()
and the jumper is connected across the two pin EPO / safety switch connector.
Now run the following:import Diablo
DIABLO = Diablo.Diablo()
DIABLO.Init()
DIABLO.ResetEpo()
print DIABLO.GetEpo()
If this printsTrue
then the board thinks the jumper is not attached / the safety switch has tripped and is refusing to allow the motors to move, this can be resolved by either fitting the jumper or adding the following line before theResetEpo()
call:DIABLO.SetEpoIgnore(True)
If it still does not work try all of the above again followed by:DIABLO.SetMotors(0.3)
print DIABLO.GetDriveFault()
If this printsTrue
then the board is reporting a fault, see the GetDriveFault returnsTrue
below.
Otherwise the most likely cause for this is a wiring problem, double check all the connections as shown on the Getting Started tab. - GetDriveFault returns
True
Faults may indicate power problems, such as under-voltage (not enough power), and may be cleared by setting a lower drive power
If a fault is persistent, it repeatably occurs when trying to control the board, this may indicate a wiring problem such as:- The supply is not powerful enough for the motors
The board has a bare minimum requirement of 6V to operate correctly
A recommended minimum supply of 7.2V should be sufficient for smaller motors - The + and - connections for either motor are connected to each other
- Either + or - is connected to ground (
GND
, also known as0V
or earth) - Either + or - is connected to the power supply (
V+
, directly to the battery or power pack) - One of the motors may be damaged
Faults will self-clear, they do not need to be reset, however some faults require both motors to be moving at less than 100% to clear
The easiest way to check is to put both motors at a low power setting which is high enough for them to rotate easily, such as 30%
Note that the fault state may be true at power up, this is normal and should clear when both motors have been driven
If there are no faults but you cannot make your motors move checkGetEpo
to see if the safety switch has been tripped
For more details on correct wiring check the Getting Started tab and double check the wiring instructions - The supply is not powerful enough for the motors
- Permission denied
It is likely that the user you are currently logged in with does not have permission to use the I²C driver, try running the same command with sudo, e.g.sudo python
If that resolves the issue then you can add the user to thei2c
group with:sudo adduser username i2c
- _tkinter.TclError: no display name and no $DISPLAY environment variable
You are running a graphical program on a text only terminal (such as SSH), you need to run from a graphical environment. - I get the error
Diablo was not found
You should see the boards I²C address if you run the following from Python:import Diablo
Diablo.ScanForDiablo()
If no boards are found check that the Diablo is attached correctly as shown on the Getting Started tab.
If a board is shown then set the I²C address to the shown value before callingInit()
, e.g.import Diablo
DIABLO = Diablo.Diablo()
DIABLO.i2cAddress = 0x44
DIABLO.Init()
- Python says it cannot find the Diablo module
make sure you have theDiablo.py
file in the same folder you are in, e.g.cd ~/diablo
python
If you still have problems you can manually add the correct folder to the Python search path:import sys
sys.path.append('/home/pi/diablo')
import Diablo
- I get the error
pygame.error: video system not initialized
There was a mistake in some of our example scripts which can prevent pygame working properly.
This has been fixed and you can re-install the Diablo software to update them using these commands:cd ~
rm -rf diablo
bash <(curl https://www.piborg.org/install-diablo.txt)
Alternatively you can add the line highlighted below into the pygame setup section using a text editor:# Setup pygame os.environ["SDL_VIDEODRIVER"] = "dummy" # Removes ... pygame.init() pygame.joystick.init() pygame.display.set_mode((1,1)) joystick = pygame.joystick.Joystick(0) joystick.init()
- I get the error
pygame.error: Unable to open a console terminal
For some reason pygame is unable to access the dummy screen driver.
Try running the script usingsudo
or logging in as root and running the script. - I am trying to use Python 3 / WebIOPi, help...
See Diablo and Python 3 for more help setting up with Python 3
In the event that you cannot solve your problem, please post here for further assistance.