Fourletter-phat examples countdown.py fails after random time

fourletter-phat examples countdown.py fails after random time.
No more than 30 minutes after led goes off.
Sometimes at 14 minutes to the end of countdown sometimes about 20 minutes to the end, random…

The 14 segment led goes off and python reports I/O error.
I am using Raspberry pi 3A+ on latest raspbian.
I am using fourletter library with rainbow hat.

I discover the solution here…


‘IOError: [Errno 5] Input/output error’ while using SMBus for analog reading through RPi

https://stackoverflow.com/questions/30325351/ioerror-errno-5-input-output-error-while-using-smbus-for-analog-reading-thr

I experienced this problem when driving a 7-segment serial display over I2C with a model b+ rpi. I corrected the problem by adjusting the baud rate to match the device setting (9600). I believe the default is 100000.

To change the baud rate, I added the following line to /etc/modprobe.d/i2c.conf:

options i2c_bcm2708 baudrate=9600
After reboot, I verified the setting had taken effect with:

prompt$ sudo cat /sys/module/i2c_bcm2708/parameters/baudrate
9600
Since then, I’ve had no problems with intermittent I/O errors.

answered Jun 21 2017 at 21:44

Micah Larson


On latest raspbian (2019) the solution to random I/O problems with fourletter-phat 14 segment display is…

sudo nano /boot/config.txt

dtparam=i2c_arm=on,i2c_baudrate=9600

Now, examples fourletter-phat countdown.py works perfect without ramdom errors to led go off.

Hope this helps someone.

After 3 days I have discovered that it continues to fail but less frequently using a low baudrate value for example 9600.
I think the fault is related to the bluetooth being activated and it is safer to set the core_freq=250 as it seems that the baudrate is regulated from there.

I am going to test this configuration in the /boot/config.txt and I will continue to report if it is stable …

sudo nano /boot/config.txt

dtparam=i2c_arm=on,i2c_baudrate=4800
core_freq=250
enable_uart=0
dtoverlay=pi3-disable-bt

I have tried everything and more and if I use rainbow hat with the examples from fourletterphat library, the display turns off after a random time that can be minutes or more than 8 hours.
No matter parameters on /boot/config.txt.

This fault only occurs on rpi-3A+ and rpi-3B+ (very similar electrically) on pi-zero-wh and rpi-4B does not happen the problem.
In all situations I have used the official PSU and the rainbow hat is directly connected to the rpi making good contact at all times.
Any ideas are welcome.
Anyway now I am using the rainbow hat on the rpi-4B and it is working ok after several days of continous use.