I have two questions - how do I call supervisor.set_next_code_file() from within my code.py? When I call it from the REPL, it works, but for some reason, it doesn't adjust the settings when I call it from within the code.
Second, is there a way to expose the SD card's (on an adalogger) filesystem from the circuitpy drive, so I can read it's contents from a computer connected by USB? Having it print everything to the REPL is a bit tedius.
supervisor and SD data question
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- tannewt
- Posts: 3304
- Joined: Thu Oct 06, 2016 8:48 pm
Re: supervisor and SD data question
Please explain what it does when setting it from code.py. It may be a bug.williamsikkema wrote: ↑Sun Dec 04, 2022 11:19 pm I have two questions - how do I call supervisor.set_next_code_file() from within my code.py? When I call it from the REPL, it works, but for some reason, it doesn't adjust the settings when I call it from within the code.
We have started working on this. The latest info for it is here: https://github.com/adafruit/circuitpython/pull/6555williamsikkema wrote: ↑Sun Dec 04, 2022 11:19 pm Second, is there a way to expose the SD card's (on an adalogger) filesystem from the circuitpy drive, so I can read it's contents from a computer connected by USB? Having it print everything to the REPL is a bit tedius.
- williamsikkema
- Posts: 5
- Joined: Sat Sep 24, 2022 7:55 pm
Re: supervisor and SD data question
When I call supervisor.set_next_code_file("code.py", reload_on_error = True, sticky_on_error = True, sticky_on_reload = True, reload_on_success = True) from the REPL, it autoreloads when the code encounters an error (usually a read/write error from one of the i2c devices). After I use the physical reset button, and call the exact same line from the main code, it does not reload after it encounters an error. I have to send the command from the REPL for it to reload automatically again. Is there another way to get this behaviour? I've also tried a try catch, but that doesn't seem to be effective at all either.
- tannewt
- Posts: 3304
- Joined: Thu Oct 06, 2016 8:48 pm
Re: supervisor and SD data question
What exception is occurring? try/catch should be able to catch things.
Please be positive and constructive with your questions and comments.