Communication to BrickPi3 lost

**BrickPi3 on a PI3 **
Raspbian GNU/Linux 9 (stretch)

Summary

My problem is that my PI and BrickPi were working perfectly well together and are now not for no apparent hardware reason.

I started to get the IO error:No SPI response when I ran my Python script (which imports brickpi3 and creates a BrickPi3 class and had been working up to this point).
I found I could fix this by flashing the firmware , my program ran, the motors moved, etc. I had, however, to do reflash each time I booted the Pi. I then tried an update of the BrickPi package. This seem to install correctly ( but with some errors , see below) but I still had the same IO error message. Worse, now reflashing .sh file does not run, reporting an unsupported RPI version. This means I have lost communication totally with the BrickPi3.

So several mysteries : firstly, why did reflashing suddenly overcome the IO error and why was the fix not permanent? Why has the so called update mean that Stretch is no longer recognised?

Any help greatly appreciated.

More detail
Python script fails creating BrickPi3 class

self.BP = brickpi3.BrickPi3()
File ā€œbuild/bdist.linux-armv7l/egg/brickpi3.pyā€, line 299, in init
IOError: No SPI response

BrickPi update completed

curl -kL dexterindustries.com/update_brickpi3 | bash

seemed to finish but with many errors like this:

Err:1 Index of /raspbian stretch/main armhf libdotconf0 armhf 1.3-0.2
404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]
Err:2 Index of /raspbian stretch/main armhf libspeexdsp1 armhf 1.2~rc1.2-1
404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]

This is perhaps why Stretch is not recognised? Why is this IP incorrect?

Firmware flash now fails

sudo bash /home/pi/Dexter/BrickPi3/Firmware/brickpi3samd_flash_firmware.sh

Traceback (most recent call last):
File ā€œā€, line 1, in
ImportError: No module named ā€˜auto_detect_rpiā€™
Found +
Unsupported RPi version ā€˜ā€™. Please report to support@dexterindustries.com

No communication with BrickPi3

sudo python /home/pi/Dexter/BrickPi3/Software/Python/Examples/Read_Info.py
No SPI response

2 Likes

This is good advice your board is telling you.

You also should try burning a Buster 32-bit ā€œold Legacyā€ PiOS (not the latest Legacy Bullseye PiOS) and performing the install of the BrickPi+ software. There were some firmware update issues and also IIRC some false ā€œneed firmware updateā€ conditions that were cleared up in the latest BrickPi+ software release - but I could be confusing things because it been a long ā€œStretchā€ since then.

I think this is the old Buster Legacy 32-bit with Desktop:

https://downloads.raspberrypi.com/raspios_oldstable_armhf/images/raspios_oldstable_armhf-2023-05-03/2023-05-03-raspios-buster-armhf.img.xz

And there is a new Raspberry Pi Imager: Raspberry Pi OS ā€“ Raspberry Pi

1 Like

Thanks for your help.
So a BrickPi update means I need to reinstall my PI OS? And the updater did not give that information before I went ahead?
I have software (such as opencv and ROS) on the Pi that will be a real hassle to reinstall.

2 Likes

The relevant code of /home/pi/Dexter/BrickPi3/Firmware/brickpi3samd_flash_firmware.sh that results in error: ImportError: No module named ā€˜auto_detect_rpiā€™ is:

check the RPi version

RPI_VERSION=$(python3 -c ā€œimport auto_detect_rpi; print (auto_detect_rpi.getRPIGenerationCode())ā€)

echo "Found "+$RPI_VERSION

INTERFACE_FILE=ā€œnoneā€
if [ ā€œ$RPI_VERSIONā€ == ā€œRPI1ā€ ] || [ ā€œ$RPI_VERSIONā€ == ā€œRPI0ā€ ]; then
# use rpi1 interface config file
INTERFACE_FILE=ā€œrpi1.cfgā€
elif [ ā€œ$RPI_VERSIONā€ == ā€œRPI2ā€ ] || [ ā€œ$RPI_VERSIONā€ == ā€œRPI3ā€ ] || [ ā€œ$RPI_VERSIONā€ == ā€œRPI3B+ā€ ] || [ ā€œ$RPI_VERSIONā€ == ā€œRPI3A+ā€ ] ; then
# use rpi2 interface config file
INTERFACE_FILE=ā€œrpi2.cfgā€
elif [ ā€œ$RPI_VERSIONā€ == ā€œRPI4ā€ ] ; then
echo ā€œFlashing the firmware using a Pi4 is not currently supportedā€
exit
INTERFACE_FILE=ā€œrpi4.cfgā€
fi

Why the module ā€˜auto_detect_rpiā€™ is missing is unclear. However, its purpose just seems to be to detect the Pi version. I should be able to bypass that check and directly set $RPI_VERSION to "RPI3 " (my model pi).

2 Likes

That worked. BrickPi is back!

2 Likes

But only until I reboot. Then I have to reflash. How weird.

2 Likes

Sometimes the SDCard becomes read only and will act like that.

Duplicate the card, and apply your fixes to the new card.

To prove read only create a new file somewhere, then reboot. If it is not there the card is toast - duplicate it and the toss.

1 Like

Good tip. Iā€™ll try that. Thanks.

2 Likes

Although ā€¦ I edited the firmware flash script ( hardcoding PI3) and that change is permanent.

2 Likes

Yes, I can create new files.

2 Likes

@rob-buttrose

What brand/rating of SD card are you using?

Some of the later Raspberry Piā€™s are quite particular about the quality of the card.

In my case, I was doing some experiments with Charlie using a strange, no-name DS card, and there were a bunch of weird, difficult to reproduce, things happening.

I did EVERYTHING - burned brown rice, sacrificed small (invasive) rodents to the Computer Gods, offered libations of expensive imported vodka, said novenas to The Blessed Mother - you name it!  Nothing helped until I accidentally rolled my office chair over the SD card, breaking it in half.

I ended up replacing it with an expensive SanDisk Extreme SD card and, volia!, my problems disappeared!

I tried again with another of the same bonzoid-brand cards and the problems returned.

So, try a different, better branded, card if youā€™re using an el-cheapo brand.

1 Like