BrickPi on RPi3 newbie - communication only works for a few seconds

Hi forum!
i am testing the (old) BrickPi of my school. i downloaded the latest raspbian for robots and did the apt-get update and upgrade and rpi-upgrade.

I still have problems with the BrickPi-Communication.

from BrickPi import *
BrickPiSetup()
BrickPi.MotorEnable[PORT_A] = 1
BrickPiSetupSensors()
def run_motors():
 while True:
  BrickPi.MotorSpeed[PORT_A] = 200
  BrickPiUpdateValues()
  time.sleep(1)
  BrickPi.MotorSpeed[PORT_A] = -150
  BrickPiUpdateValues()
  time.sleep(1)
run_motors()

this program only works for a few seconds, after that it crashes with this message

pi@dex:~ $ sudo python bp1sensor.py 
Traceback (most recent call last):
  File "bp1sensor.py", line 13, in <module>
    run_motors()
  File "bp1sensor.py", line 8, in run_motors
    BrickPiUpdateValues()
  File "build/bdist.linux-armv7l/egg/BrickPi.py", line 582, in BrickPiUpdateValues
  File "build/bdist.linux-armv7l/egg/BrickPi.py", line 698, in BrickPiFlush
  File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 572, in inWaiting
    return self.in_waiting
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 456, in in_waiting
    s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
IOError: [Errno 5] Input/output error

i am running python 2.7.13

I read something about another update procedure on my raspbian - but this is the latest image. Another strange thing: the BrickPi Python Module was not installed. I got this from GitHub. Bluetooth is not activated on my Pi3 Model.

And I read something about a brickpi firmware update via an arduino. This would not be a big problem, but i guess this is time consuming to set up.

Am i missing something? I wasn’t able to find this behaviour in the internet or this forum…

Can someone help me?

Regards
Peter

I found a Raspberry 2 :slight_smile:

But…same error. After a few seconds I got the same error as described above.

Can someone put me into the right direction? BrickPi firmware update procedure?

Peter

The original BrickPi and the BrickPi+ are not supported on Raspbian Stretch. You will need to use an older version of Raspbian, such as Jessie or Wheezy.

From your description and output message, it seems like an issue with the RPi software, not the BrickPi firmware.

I’m also facing the same problem when tried to test my motor and left with following error message:

pi@raspi001:~ $ python motor_sensor.py
Traceback (most recent call last):
File “motor_sensor.py”, line 7, in
BrickPiSetupSensors()
File “build/bdist.linux-armv7l/egg/BrickPi.py”, line 492,
in BrickPiSetupSensors
File “build/bdist.linux-armv7l/egg/BrickPi.py”, line 698,
in BrickPiFlush
File “/usr/lib/python2.7/dist-packages/serial/serialutil.py”,
line 572, in inWaiting
return self.in_waiting
File “/usr/lib/python2.7/dist-packages/serial/serialposix.py”,
line 456, in in_waiting
s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
IOError: [Errno 25] Inappropriate ioctl for device

Please help me!!

Hi @sumanth.gokapai,

Reading @Matt’s reply, are you somehow running this on a Stretch? Because by his words, this won’t work for you.

Thank you!

Hi @RobertLucian
Thanks for the reply.
As you said I’m running “Raspbian/Linux 9”(Stretch). Is there a way that I can make this work or Do I have to download an older version such as Jessie or Wheezy? If so, where can I find those ??

Thanks a lot Matt for your Reply! I will download an older Version!

Hi @sumanth.gokapai,

Yeah, exactly. Can you try running the BrickPi on an older image? You can find these images here:
https://sourceforge.net/projects/dexterindustriesraspbianflavor/files/Archive/

Thanks!

Hi @RobertLucian
I have downloaded the Raspbian for Robots(Jessie) version by Dexter Industries and wrote the image on SD card but when I load the SD card onto the pi, it leaves me with a rainbow colored screen.
What I have to do now?
Is it due to the model of Raspberry Pi (Raspberry Pi 3 Model B+) that I’m using now ?
All it appears is rainbow colored screen. What I have to do now??
Help me!!!
Thanks.

RPi 3B+ won’t boot Jessie, as it requires the very latest version of Stretch. BrickPi+ isn’t supported on Stretch. Effectively RPi 3B+ and BrickPi+ are incompatible.

Hi @Matt,
Thanks for the reply,
Just to make sure, I’m using Brick Pi 3 and RPi 3B+ . Are they incompatible??
and also can I know what are the OS and their versions which are compatible with Brick Pi 3.

Thanks,

BrickPi3 works with RPi 3B+ and Stretch. Since you posted in a thread about the old BrickPi, I assumed you were using BrickPi or BrickPi+, not BrickPi3.

Looking at your previously posted error, you are trying to use BrickPi+ code. For the BrickPi3, you need to use BrickPi3 code.