0

MagTag Circuit Python hard crashes
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MagTag Circuit Python hard crashes

by robtsuk on Sat Apr 03, 2021 2:31 pm

I've got a CircuitPython script running on a MagTag that fetches data from https://magtag-gateway.herokuapp.com/next every minute and displays it. Everyone so often, but at least once a day, I check the MagTag to see it showing a screen describing a hard crash in CircuitPython. Is there any useful way to diagnose or report this problem?
robtsuk
 
Posts: 11
Joined: Tue Jan 15, 2013 1:17 am

Re: MagTag Circuit Python hard crashes

by danhalbert on Sat Apr 03, 2021 3:11 pm

What version are you running? Try updating to 6.2.0-rc.0 if you have not already, and also update all the libraries.

If that does not help, you could leave this connected to a host computer and add some print statements at various points to narrow down where it crashes.

danhalbert
 
Posts: 2430
Joined: Tue Aug 08, 2017 12:37 pm

Re: MagTag Circuit Python hard crashes

by robtsuk on Sat Apr 03, 2021 3:26 pm

I had seen the same thing on 6.2.0-beta4, but I will give rc0 and updated libraries a try.

I'm not sure I've ever seen it happen when hooked up to a host, but I can certainly leave it attached and see.

This is the code https://gist.github.com/rtsuk/4dabd9c2902c1634f4202c2490c32790. Would more prints help?
robtsuk
 
Posts: 11
Joined: Tue Jan 15, 2013 1:17 am

Re: MagTag Circuit Python hard crashes

by robtsuk on Sat Apr 03, 2021 3:27 pm

Also, thanks!
robtsuk
 
Posts: 11
Joined: Tue Jan 15, 2013 1:17 am

Re: MagTag Circuit Python hard crashes

by danhalbert on Sat Apr 03, 2021 3:38 pm

Since you are doing a deep sleep, it's possible the error is caused by that. Leaving the board connected to host does a simulated deep sleep (so the USB connection doesn't drop), so that may be why you haven't seen the problem in that case.

Nevertheless, you might try leaving it connected to the host for some number of hours to see if that seems to prevent the crash. That would narrow it down to a sleep problem rather than a wifi connection problem.

danhalbert
 
Posts: 2430
Joined: Tue Aug 08, 2017 12:37 pm

Re: MagTag Circuit Python hard crashes

by robtsuk on Sun Apr 04, 2021 12:49 pm

More than a day and no hard crashes when connected to the host. I'll try connected to just power.
robtsuk
 
Posts: 11
Joined: Tue Jan 15, 2013 1:17 am

Re: MagTag Circuit Python hard crashes

by robtsuk on Tue Apr 06, 2021 9:50 am

Good news, it ran for more than a day on just power without a crash. I guess one of the six things I changed at the same time fixed it. :)
robtsuk
 
Posts: 11
Joined: Tue Jan 15, 2013 1:17 am

Please be positive and constructive with your questions and comments.