got my BrickPi few days ago. Having problems maintaining communication with motors. If I run an Example: Run a motor back and forth script from

after few cycles i get this error:

('Unexpected error: ', <class 'serial.serialutil.SerialException'>)
Traceback (most recent call last):
  File "", line 13, in <module>
  File "", line 11, in run_motors
  File "build/bdist.linux-armv7l/egg/", line 553, in BrickPiUpdateValues
  File "build/bdist.linux-armv7l/egg/", line 701, in BrickPiRx
  File "/usr/lib/python2.7/dist-packages/serial/", line 435, in inWaiting
    s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
IOError: [Errno 5] Input/output error

sometimes I get:

  File "", line 13, in <module>
  File "", line 8, in run_motors
  File "build/bdist.linux-armv7l/egg/", line 551, in BrickPiUpdateValues
  File "build/bdist.linux-armv7l/egg/", line 680, in BrickPiTx
  File "/usr/lib/python2.7/dist-packages/serial/", line 489, in write
    raise SerialException('write failed: %s' % (v,))
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error

Have tried running on batteries, 12W iPad charger, 10W random USB charger… Always the same.

So you’re using idle with Python?

Are you using Raspbian for Robots or another operating system?

Also, if you run this python script from the command line:

Does the program run continuously?

Thanks for the link Keymaster. I was able to resolve the issue:

I am running a Raspbian Jessie. Setup script run fine, but was not able to disable getty.

disabled getty with

sudo systemctl disable serial-getty@ttyAMA0.service

edited /boot/cmdline.txt

All examples now work as expected.

Great to hear. Thanks for letting us know.