Motor Problems with BrickPi


#1

Hi! I’ve recieved my BrickPi today and have assembled the case and connected motors as shown in instructions. Then, I’ve clone the BrickPi_Python to my raspberry pi and installed setup.py successfully. But when I try to run LEGO-Motor_Test_Timeout.py (I’ve copied BrickPi.py to examples folder) nothing happens and console just oputputs this:
BrickPiSetTimeout Status : -1

Running Forward
Running Reverse
Running Forward
Running Reverse
Running Forward
Running Reverse
Running Forward
Running Reverse
Traceback (most recent call last):
  File "LEGO-Motor_Test_Timeout.py", line 38, in <module>
    BrickPiUpdateValues()       # Ask BrickPi to update values for sensors/motors
  File "/home/TimboKZ/BrickPi_Python/BrickPi.py", line 413, in BrickPiUpdateValues
    BrickPiTx(BrickPi.Address[i], tx_bytes, Array)
  File "/home/TimboKZ/BrickPi_Python/BrickPi.py", line 497, in BrickPiTx
    ser.write(tx_buffer)
  File "/usr/local/lib/python2.7/dist-packages/pyserial-2.7-py2.7.egg/serial/serialposix.py", line 518, in write
    raise SerialException('write failed: %s' % (v,))
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error

I’m using 5v usb supply + 9v battery.


#2

Hey Timbo, sorry to hear about the challenges with the BrickPi. A few quick questions/suggestions:


#3

Hi, thanks for the reply. I have tried using the touch sensor and and didn’t work too. I’ve order 8xAA battery pack and I hope this will fix the problem. On the image, the RaspberryPi is powered using a usb 5v adapter and a 9v battery at the same time - isn’t this enough to power the motors?


#4

Timbo,

The setup you mention here should be enough to power both, so this is a little surprising.

I also should have asked: what are you doing for the Raspberry Pi image. Did you download our version of Raspbian, or are you using your own? If you’re using your own, did you make the changes we outline on our getting started guide?

Sicne you’re not getting any response from motors or sensors, it sounds like you might have communications problems; those can be because the image isn’t setup correctly.


#5

Hello.

I’ve definitely followed all the steps here http://www.dexterindustries.com/BrickPi/program-it/python/
and received no errors in process. I’m using default Raspbian that was offered by NOOBS with Apache server installed on it.

I tried to run setup.py again and test a motor and a touch sensor, still no luck.

Doesn’t this error say anything to you? (it’s is thrown when LEGO-Motor_Test_Timeout.py finishes the process)

Traceback (most recent call last):
  File "LEGO-Motor_Test_Timeout.py", line 31, in <module>
    BrickPiUpdateValues()       # Ask BrickPi to update values for sensors/motors
  File "/home/TimboKZ/BrickPi_Python/BrickPi.py", line 413, in BrickPiUpdateValues
    BrickPiTx(BrickPi.Address[i], tx_bytes, Array)
  File "/home/TimboKZ/BrickPi_Python/BrickPi.py", line 497, in BrickPiTx
    ser.write(tx_buffer)
  File "/usr/local/lib/python2.7/dist-packages/pyserial-2.7-py2.7.egg/serial/serialposix.py", line 518, in write
    raise SerialException('write failed: %s' % (v,))
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error


#6

Okay, my 8xAA battery pack arrived today and I tried to get motors working again but still no success. Same with sensors.


#7

Timbo,
Yeah, it still looks like you might be having a system problem, not a BrickPi or software problem. That exception means that the serial line isn’t working on the Raspberry Pi (I believe!). Is there any way you can test the BrickPi with our distro, just to be sure?

This line:
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error
Indicates that the Raspberry Pi isn’t able to access the serial line. I think the easiest way to test, if you have a spare SD card around, is to try running an example sensor and motor program on the BrickPi image.

We’re working on an install script right now to simplify the installation of the necessary changes on other distros.


#8

Thanks for your reply.

I’ll try saving my disk image and using your distro with the brickpi.

I’ll post my results here as soon as there are any results.


#9

Timbo, awesome. Please let me know asap; we want to see your success!