I have rasberrypi 3 and a brickpi, just starting and trying to run the LEGO-Motor_Test.py. The terminal gives feedback “Running Forward / Running Backward”; but our LEGO EV3 motors are not working.
Then I tried running the following commands in the python IDLE, but the “BrickPiSetupSensors()” returns -1.
from BrickPi import *
BrickPiSetup()
BrickPi.MotorEnable[PORT_A] = 1
BrickPiSetupSensors()
That was the issue. I pulled the code from github, then I tried to run the following command, but got the following error.
COMMAND:
sudo python LEGO-Motors.py
ERROR:
Traceback (most recent call last):
File “LEGO-Motors.py”, line 22, in
BP = brickpi3.BrickPi3() # Create an instance of the BrickPi3 class. BP will be the BrickPi3 object.
File “/home/pi/Dexter/BrickPi3/Software/Python/Examples/brickpi3.py”, line 293, in init
manufacturer = self.get_manufacturer()
File “/home/pi/Dexter/BrickPi3/Software/Python/Examples/brickpi3.py”, line 409, in get_manufacturer
raise IOError(“No SPI response”)
IOError: No SPI response
Updating the BrickPi3 SAMD Firmware with '/home/pi/Dexter/BrickPi3/Firmware/brickpi3_firmware.bin’
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named auto_detect_rpi
Using interface file 'rpi1.cfg’
sudo: openocd: command not found
Did you run the installation as described in the README? Those are errors I would expect to see if you haven’t run the install.sh script using sudo bash /home/pi/Dexter/BrickPi3/Install/install.sh.
This is a normal response, should not be a problem.
To @Matt’s point, this should be running if you’re using the SD card that shipped. Everything should be installed correctly.
Can we back up and just confirm which version of the BrickPi you have? Is it a BrickPi3 or a BrickPi+? Until we do that, we won’t know which version of the python software you’re using.
So the SD card that I purchased from DI, should be up to date? I was thinking of downloading the lastest version of Raspbian and install that on a new SD card.
If you’re running Raspbian for Robots (our version of Raspbian with the robot software already installed), you can go to the desktop and run the DI Update utility to make sure the SW is fully up to date. During the update, the RPi needs an internet connection, and the update can take several minutes (it will probably take a few minutes before the GUI comes up). If you prefer to run Raspbian instead of our Raspbian for Robots, you can still install/update BrickPi3 (instructions in the README).
Now that you’ve updated DI Software, you can do 2 things in the following order:
Flash the firmware onto BrickPi3.
Try one of the example programs for the BrickPi3.
The example programs are already loaded on your Raspberry Pi, so you only need to type cd ~/Desktop/GoPiGo3/Software/Python/Examples. If everything is a go, then the command should work.
We’ll be here to assist you in case something else (and hopefully not) goes bad.