circuitpython: MagTag Vaccination tracker crash in magtag.network.connect() between 7alpha3 and 7alpha4
CircuitPython version
Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit MagTag with ESP32S2
Code/REPL
Demo code can be fetched from here: https://learn.adafruit.com/adafruit-magtag-covid-vaccination-percent-tracker/code-the-vaccination-tracker
Behavior
MagTag Vaccination tracker crash in magtag.network.connect() between 7alpha3 and 7alpha4
I tested MagTag Covid percentage tracker with 7.0.0-alpha.3 and 7.0.0-alpha.4.
Somewhere in between the two it crash in loop in magtag.network.connect()
With Adafruit CircuitPython 7.0.0-alpha.3 on 2021-06-03; Adafruit MagTag with ESP32S2
It kind of work, it does not display the properly, but the progress bar are there and the network fetch work:
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable. code.py output: Connecting to AP NEO Retrieving data…Reply is OK! Response is [‘United States’, ‘2021-07-18’, ‘"Johnson&Johnson’, ’ Moderna’, ’ Pfizer/BioNTech"', ‘https://covid.cdc.gov/covid-data-tracker/COVIDData/getAjaxData?id=vaccination_data’, ‘337740358’, ‘186038501’, ‘161232483’] Sleeping for 86400 seconds
Code done running.
Press any key to enter the REPL. Use CTRL-D to reload. Pretending to deep sleep until alarm, CTRL-C or file write.
With Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit MagTag with ESP32S2
it bootloop in
It reset/boot in loop somewhere inside magtag.network.connect()
:
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable. code.py output: Connecting to AP NEO
^^^ And here bootlook reseting the serial ^^^
So somewhere between 7.0.0-alpha.3 and 7.0.0-alpha.4 the network call of
I guess I need to bisec and find where it stated to behave like that.
Demo code can be fetched from here: https://learn.adafruit.com/adafruit-magtag-covid-vaccination-percent-tracker/code-the-vaccination-tracker
Description
No response
Additional information
This test is done with the learn guide library… except for manual update to the latest version from GIT of:
- adafruit_portalbase
- adafruit_magtag
Using the py (not mpy) version of those library (in an attempt to debug that further).
This is also mean using https://github.com/adafruit/Adafruit_CircuitPython_MagTag/pull/63 that I was trying to validate.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (11 by maintainers)
Commits related to this issue
- SocketPool: Initially allocate these as long-lived objects I cannot give a satisfactory account of _why_, but the crash in #5021 goes away when this object is initially allocated in the long-lived po... — committed to jepler/circuitpython by jepler 3 years ago
- gc.c: Ensure a gap of one byte before the finaliser table. .. or, for !MICROPY_ENABLE_FINALISER, before the first block of the pool. Closes: adafruit/circuitpython#5021 Closes: micropython/micropyth... — committed to jepler/circuitpython by jepler 3 years ago
- py/gc: Ensure a gap of one byte after the ATB. Closes: adafruit/circuitpython#5021 Closes: micropython/micropython#7116 Signed-off-by: Jeff Epler <jepler@gmail.com> — committed to dpgeorge/micropython by jepler 3 years ago
- py/gc: Ensure a gap of one byte after the ATB. Closes: adafruit/circuitpython#5021 Closes: micropython/micropython#7116 Signed-off-by: Jeff Epler <jepler@gmail.com> — committed to dpgeorge/micropython by jepler 3 years ago
- py/gc: Ensure a gap of one byte after the ATB. Prior to this fix the follow crash occurred. With a GC layout of: GC layout: alloc table at 0x3fd80428, length 32001 bytes, 128004 blocks ... — committed to dpgeorge/micropython by jepler 3 years ago
- py/gc: Ensure a gap of one byte after the ATB. Prior to this fix the follow crash occurred. With a GC layout of: GC layout: alloc table at 0x3fd80428, length 32001 bytes, 128004 blocks ... — committed to jcernato/micropython by jepler 3 years ago
- py/gc: Ensure a gap of one byte after the ATB. Prior to this fix the follow crash occurred. With a GC layout of: GC layout: alloc table at 0x3fd80428, length 32001 bytes, 128004 blocks ... — committed to karfas/micropython by jepler 3 years ago
- py/gc: Ensure a gap of one byte after the ATB. Prior to this fix the follow crash occurred. With a GC layout of: GC layout: alloc table at 0x3fd80428, length 32001 bytes, 128004 blocks ... — committed to alphonse82/micropython-wch-ch32v307 by jepler 3 years ago
@jfurcean Thanks for the minimal example! We used it to debug.
It must be some kind of object that is moved but can’t be moved safely, making this change causes the crash to go away for me:
Commenting out the
gc.collect()
line innetwork.py
ofadafruit_circuitpython_portalbase
allows the shortened example to work. The longer example still doesn’t work. I think there is some interaction withgc.collect()
and the network connection.I tested this with the simple magtag example in
adafruit_circuitpython_magtag
and addedmagtag.network.connnect()
. It would crash unless I also commented out thegc.collect()
inadd_text
andset_text
in__init__.py
inadafruit_circuitpython_portalbase
.