astro-pi / python-sense-hat

Source code for Sense HAT Python library
https://sense-hat.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
505 stars 253 forks source link

SenseHat LED matrix not responding #138

Closed DMHas closed 1 year ago

DMHas commented 1 year ago

Hello all,

I have the problem that on both of my Raspberry Pi (2 &4) the Sense Hat LED matrix is no longer responsive. After powering on the Pi, the LED matrix lights up in rainbow colors. But then the LED matrix does not respond to any commands - that is, it does not display anything when you want to display text on the LED matrix. No error message is displayed. At first I thought it was a hardware defect. For testing I connected the Sense Hat to my old Raspberry Pi 2 - it worked as usual. Then I updated the Raspberry Pi 2 (sudo apt update && suso apt upgrade). After that, the error also occurred on the Raspberry Pi 2 - as described above. It must be a software / driver problem. The error occurs with a Sense Hat V1 like Sense Hat V2.

Have any of you experienced the same phenomenon or have an idea how I can narrow down or fix the error? (Temperature, humidity and pressure sensor are working normally).

Greetings DMHas

Translated with www.DeepL.com/Translator (free version)

Update: With a fresh image (without updates - created with Raspberry Pi Imager) works the LED-Matrix fine. (I guess the new firmware update for the Raspberry Pi is the problem.)

aldenmoreton commented 1 year ago

I have experienced the same problem on a Raspberry Pi 4 with a Sense Hat V2. I can also trace back my initial problems to updates I have made in the last few days.

I have not tried to re-flash my SD card with a fresh image yet, though I suspect that would solve my problem as well.

Currently I am attempting to determine which updates break the LED matrix API so that I can roll them back. Please let me know if you determine which updates affect the Sense Hat, and which versions are stable to use currently.

XECDesign commented 1 year ago

That would've been the kernel update. Something broke in the move to 6.1.

tx73github commented 1 year ago

Same here, seems only to affect the LED matrix. Confirmed not working with 6.1.19-v8+ #1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023 aarch64 GNU/Linux.

DMHas commented 1 year ago

Thanks all for confirming. I open a new issue here: https://github.com/raspberrypi/firmware/issues/1798

pelwell commented 1 year ago

This has been fixed today. You can install a beta kernel with sudo rpi-update.

davidbradway commented 1 year ago

This has been fixed today. You can install a beta kernel with sudo rpi-update.

@pelwell , @DMHas : I just installed the beta kernel. It fixed the LED matrix but seems to have broken the temperature and humidity measurements. The pressure sensor is still reading something, while the other two are "0". Can anyone reproduce my experience?

Update: after another reboot I think things are working properly.

pelwell commented 1 year ago

It has also been pointed out that the mmap support got broken back in 5.18, but https://github.com/raspberrypi/linux/pull/5404 should fix that.

DMHas commented 1 year ago

@pelwell , @DMHas : I just installed the beta kernel. It fixed the LED matrix but seems to have broken the temperature and humidity measurements. The pressure sensor is still reading something, while the other two are "0". Can anyone reproduce my experience?

I can't confirm the zero values after firmware update.

But my both RasPi's (2B & 4 with 8GB) and both SenseHat's (V1 & V2) shows this behavior sometimes. Turn off and turn on fix it (restart change nothing). The RasPi 2 shows the zero values often as the RasPi 4. It happens more, when 2 program's have access to temperature, air pressure and humidity at the same time. (May be it is depending from the CPU load or GPIO load.) I guess this is behavior is fixed too (comment from pelwell).

pelwell commented 1 year ago

I guess this is behavior is fixed too (comment from pelwell).

The only issues that have been addressed are the cancelling of deferred I/O on close and the mmap() breakage. Please open a new issue if you are seeing other problems.

DMHas commented 1 year ago

The only issues that have been addressed are the cancelling of deferred I/O on close and the mmap() breakage. Please open a new issue if you are seeing other problems.

I will observe the behavior. If it happens again, I will open a new thread

pelwell commented 1 year ago

...ideally at our kernel repo: https://github.com/raspberrypi/linux/issues

DMHas commented 1 year ago

@pelwell: I will do so.