Errors


#1

Hi,

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 http://www.dexterindustries.com/program-it/python/brickpi-python-idle/

after few cycles i get this error:

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

sometimes I get:

  File "robo.py", line 13, in <module>
    run_motors()
  File "robo.py", line 8, in run_motors
    BrickPiUpdateValues()
  File "build/bdist.linux-armv7l/egg/BrickPi.py", line 551, in BrickPiUpdateValues
  File "build/bdist.linux-armv7l/egg/BrickPi.py", line 680, in BrickPiTx
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", 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.


#2

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:

https://github.com/DexterInd/BrickPi_Python/blob/master/Sensor_Examples/LEGO-Motor_Test.py

Does the program run continuously?


#3

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.


#4

Great to hear. Thanks for letting us know.