Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

LED Glasses Blinking power LED
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LED Glasses Blinking power LED

by steve220 on Sun Nov 28, 2021 2:37 pm

After coding a few things successfully with the LED glasses from ADABOX 020, when I plugged them in this morning, the red LED on the control board is blinking twice in a pattern. I rebooted the computer and reflashed circuitpython to the board, but still getting the same behavior. I pulled the sample googly eye rings project off the site and loaded it. It runs, but I'm getting really weird LED behavior and constant soft resets. I suspect either the accelerometer is acting up or the I2C bus is. Any thoughts on how to troubleshoot?

steve220
 
Posts: 36
Joined: Sat Sep 16, 2017 10:52 pm

Re: LED Glasses Blinking power LED

by dastels on Sun Nov 28, 2021 3:24 pm

Can you post what you see in the REPL when the code runs? That should give a better idea of what's happening.

If you aren't familiar with using the REPL (or even just the serial connection), see
https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console
https://learn.adafruit.com/welcome-to-circuitpython/interacting-with-the-serial-console
https://learn.adafruit.com/welcome-to-circuitpython/the-repl

Further, you could change the final except block to output the exception information before reloading.

Code: Select all | TOGGLE FULL SIZE
 except OSError as err:
        print(err)
        supervisor.reload()

Dave

dastels
 
Posts: 8470
Joined: Tue Oct 20, 2015 3:22 pm

Re: LED Glasses Blinking power LED

by steve220 on Sun Nov 28, 2021 3:46 pm

Here is what is in REPL when I ctrl-c
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 107, in <module>
File "adafruit_is31fl3741/__init__.py", line 233, in show
KeyboardInterrupt:

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit LED Glasses Driver nRF52840 with nRF52840
>>>
>>>
I added the print command,but it seems it never gets there as the only thing I get in the serial console when it is running is the following in a never ending loop
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Code stopped by auto-reload.
soft reboot

steve220
 
Posts: 36
Joined: Sat Sep 16, 2017 10:52 pm

Re: LED Glasses Blinking power LED

by dastels on Sun Nov 28, 2021 3:59 pm

That tells us that it's not reloaded because it's getting an error... so reading the accelerometer over I2C is probably ok. The auto-reload reboots are caused by the same feature that lets you simply update the code files (or any file) and have it restart. Depending on your OS (I find Linux is pretty bad about it) you can see a lot of these as the OS pokes at the drive.

To turn that off use:
Code: Select all | TOGGLE FULL SIZE
import supervisor
supervisor.disable_autoreload()

To turn it back on:
Code: Select all | TOGGLE FULL SIZE
import supervisor
supervisor.enable_autoreload()

Turning it off will get rid of those
Code: Select all | TOGGLE FULL SIZE
Code stopped by auto-reload.
soft reboot

Dave

dastels
 
Posts: 8470
Joined: Tue Oct 20, 2015 3:22 pm

Re: LED Glasses Blinking power LED

by steve220 on Sun Nov 28, 2021 6:20 pm

Making some progress
supervisor.disable_autoreload() does indeed keep the restart loop from happening, however supervisor.enable_autoreload() doesn't restart the autoloading either from code or REPL. Of course, this means updating/saving the code has no effect until I reset the board.

Some additional discoveries - My Circuit Playground Express exhibits the exact same behavior now (constant soft starts). It didn't yesterday, so my guess is that there is something going on with my system that has caused this behavior. It happens regardless of the USB port I'm plugged into. I can read/write to the devices as well as other USB devices such as camera memory cards and USB drives, so the ports seem good.

When plugging the adafruit devices into another system, the behavior is normal.

I have no idea what changed between yesterday and today. Any thoughts?

steve220
 
Posts: 36
Joined: Sat Sep 16, 2017 10:52 pm

Re: LED Glasses Blinking power LED

by dastels on Sun Nov 28, 2021 9:10 pm

That's odd. supervisor.enable_autoreload() shoudl restart the change->reload behavior.

It's not related to the USB port, it's the mounted USB drive/filesystem. Did you update the OS? Install new apps? Do something with anti-virus?

Dave

dastels
 
Posts: 8470
Joined: Tue Oct 20, 2015 3:22 pm

Re: LED Glasses Blinking power LED

by adafruit2 on Mon Nov 29, 2021 2:06 pm

another thing you can try: just reload one of the 'default' demos?
https://learn.adafruit.com/adafruit-eye ... e-lights-2

adafruit2
Site Admin
 
Posts: 20485
Joined: Fri Mar 11, 2005 7:36 pm

Re: LED Glasses Blinking power LED

by steve220 on Tue Nov 30, 2021 2:37 am

Thanks. I had actually already tried one of the default demos and got the same behavior. There is some good news. I ditch circuitpython on the CPX and played around with using the arduino IDE. That worked great. Then I reloaded circuitpython and the board is now working normally. The weird thing is that the glasses are working fine now too. I have no idea what fixed the problem, but for now, all seems to be working. Your help is greatly appreciated!

steve220
 
Posts: 36
Joined: Sat Sep 16, 2017 10:52 pm

Re: LED Glasses Blinking power LED

by adafruit2 on Tue Nov 30, 2021 3:30 pm

hey - we'll take it :)

adafruit2
Site Admin
 
Posts: 20485
Joined: Fri Mar 11, 2005 7:36 pm

Please be positive and constructive with your questions and comments.