supervisor and SD data question

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
williamsikkema
 
Posts: 5
Joined: Sat Sep 24, 2022 7:55 pm

supervisor and SD data question

Post by williamsikkema »

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.

User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

Re: supervisor and SD data question

Post by tannewt »

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.
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 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.
We have started working on this. The latest info for it is here: https://github.com/adafruit/circuitpython/pull/6555

User avatar
williamsikkema
 
Posts: 5
Joined: Sat Sep 24, 2022 7:55 pm

Re: supervisor and SD data question

Post by williamsikkema »

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.

User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

Re: supervisor and SD data question

Post by tannewt »

What exception is occurring? try/catch should be able to catch things.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”