I've got one of the new I2C->Neopixel driver boards (https://www.adafruit.com/product/5766) and I keep having to manually "reset" the board (unplug) when a write operation is interrupted. If I do not, the board-identification request comes back with unrecognized device codes. This makes starting/stopping applications a bit precarious and I'm worried that those STEMMA wires/connectors are going to break on me.
I have tried putting the Seesaw device constructor in a loop (wait until it doesn't fail), but that sometimes goes into an infinite loop.
Since there doesn't seem to be any interrupt breakout on the board, is there another software solution to reset?
Seesaw and interrupted writes causes board failures
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- edgjr
- Posts: 143
- Joined: Mon Jan 16, 2012 6:18 pm
- danhalbert
- Posts: 4650
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Seesaw and interrupted writes causes board failures
Could you post the simplest example with a recipe about how to cause the hang-up? We would want to look at this.
- edgjr
- Posts: 143
- Joined: Mon Jan 16, 2012 6:18 pm
Re: Seesaw and interrupted writes causes board failures
Code: Select all
#!/usr/bin/python3
import board
import adafruit_seesaw.neopixel as np
import adafruit_seesaw.seesaw
from rainbowio import colorwheel
from time import sleep
i2c = board.I2C()
seesaw = adafruit_seesaw.seesaw.Seesaw(i2c,0x60)
strip = np.NeoPixel(seesaw, 15, 30)
while True:
try:
for color in range(255):
for pixel in range(len(strip)):
pixel_index = (pixel * 256 // len(strip)) + color * 5
strip[pixel] = colorwheel(pixel_index & 255)
strip.show()
sleep(5)
except Exception as e:
print(e)
break
- danhalbert
- Posts: 4650
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Seesaw and interrupted writes causes board failures
What board are you running this code on? Is it an RPi using Blinka? If so, what version of Raspberry Pi OS are you using?
- edgjr
- Posts: 143
- Joined: Mon Jan 16, 2012 6:18 pm
Re: Seesaw and interrupted writes causes board failures
Oh, sorry - Raspberry Pi 4 (4Gb) running "bullseye" (I had just) realized that I had neglected that information.
Also, the I2C interface is via the SparkFun Qwiic pHAT v2.0 and I'm powering a 60 LED/meter / 0.5 Meter via the hat's 5v output. It works just fine - but it's kind of a PITA when I need to stop/start applications.
Also, the I2C interface is via the SparkFun Qwiic pHAT v2.0 and I'm powering a 60 LED/meter / 0.5 Meter via the hat's 5v output. It works just fine - but it's kind of a PITA when I need to stop/start applications.
- adafruit2
- Posts: 22148
- Joined: Fri Mar 11, 2005 7:36 pm
Re: Seesaw and interrupted writes causes board failures
yeah we could see how interrupting it would get it into a wierd state. but it shoudln't be too bad to 'fix' it - what if you 'try:' to re-init a few times? eventually you would 'clear' the i2c buffer and get back to normal state?
- edgjr
- Posts: 143
- Joined: Mon Jan 16, 2012 6:18 pm
Re: Seesaw and interrupted writes causes board failures
I put it into an infinite retry loop and got a little concerned when stuff scrolled off the monitor (so more than 100 tries?). I'll try to reproduce this again and keep track of the number of re-init it takes, up to 1024.
Please be positive and constructive with your questions and comments.