Top Phat NeoPixel problems

I am trying to use a Top Phat card with a RPi 4 running 5.15.32. I am using the python3 test programs for the neopixels. Sometimes, immediately after turning on the RPi and the Top Phat, the neopixels work as expected for a minute or two. Then their responses become erratic (for example, the wrong led will turn on with the wrong color) or they simply stop responding to any commands to change color.

No errors are ever reported, but the only thing that seems to work at all (even if only for a minute or two) is to turn everything off and wait an hour before turning the system back on. By the way, simply rebooting without turning off the power does not help.

I do not understand what could be causing the problem. It is almost as if something about the RPi or the Top Phat is changing after the system has been powered up for a minute or so. Any ideas?

It sounds like something might be wrong in the code; share the program being used and we can take a look at it

I used the code from:

https://learn.sparkfun.com/tutorials/sp … 2812b-leds

If power off the RPi 4 and wait long enough before turning it back on, the Top Phat neopixels will work as expected for a minute or so. After that, they usually become erratic or completely unresponsive to commands (can’t turn them on or off or change their color).

I launch the neopixel test program using the following command:

sudo python3 neotest.py

I don’t know if this is relevant, but in addition to the Top Phat, I also have a usb mouse and keyboard attached to the RPi. There is also a V2 camera and an hdmi display connected to the RPi. I am also using the wifi connection. And I have wired up connections to a couple of micro controllers including an Adafruit Feather Sense (but the Feather is NOT booted and I don’t think it is drawing power from the Pi). I was wondering if there is a chance the Feather or one of the other controllers might interfere with the operation of the Top Phat? Or some how affect the Pi just enough to account for my problem with the neopixels? (I don’t expect you to debug my HW setup, I am just asking some sort of interference is plausible and worth investigating?)

-Franklin


Import Dependencies

import board

import neopixel

Create the class object

pixels = neopixel.NeoPixel(board.D12, 6, auto_write=False)

Set Pixel Configuration

pixels[0] = (10, 0, 0)

pixels[3] = (0, 10, 0)

pixels[4] = (0, 0, 10)

Display Configuration

pixels.show()

I used the same Top pHAT with a Raspberry Pi 3B+ (and an older Raspberry Pi OS) but the same neopixel library and everything works as expected. Is there something about the RPi 4, perhaps its throttling, that might account for the problems I am having when I try to use the Top pHAT with a RPi 4?