#Using storage.remount

1 messages · Page 1 of 1 (latest)

dire skiff
#

I need help with storage.remount. I use Thonny to view print outputs in the repl. I am writing a logging program that writes log data to the circuitpython file system. My boot.py file calls storage.remount. Of course I have to disconnect the USB cable and do a reset to get my code running. I have had this working but recently must have broke the code. Without the USB connected there is no way to get a Traceback to debug the problem. Docs say there is a "disable_concurrent_write_protection" parameter when True "allows CircuitPython and a host to write to the same filesystem". Even using this, I still get OSError Read-only filesystem.
Hello all. Is there a way to see repl output after calling storage.remount("/", readonly= not log_enable.value, disable_concurrent_write_protection = True)

pale sundial
#

storage.remount() does not affect the serial connection. But Thonny uses the serial connection instead of writing to CIRCUITPY. So it needs the mount permissions to allow writing from Python.

#

I would usggest not using Thonny unless you are using a device that does not present CIRCUITPY (like a plain ESP32).

#

it's easy to get a corrupted filesystem if you disable concurrent write protection. The readonly filesystem may be due to it being the wrong mode, or it may be due to corruption.

dire skiff
#

If not Thonny, is there another app that will display the repl shell output. I need a way to see the Traceback after calling
storage.remount("/", readonly= False). Is this possible?

#

My processor is a RP2040

pale sundial
#

what OS are you using?

dire skiff
#

The PC host is Windows10

#

Adafruit CircuitPython 8.2.9 on 2023-12-06; Waveshare RP2040-Zero with rp2040

pale sundial
#

Tera Term is a nice serial terminal program

dire skiff
#

I have Mu. Is there a way to run boot.py without a RP2040 reset? Resetting causes Mu to drop the serial port.

#

I assume CP mode

#

I can't get past this error Traceback (most recent call last): File "<stdin>", line 15, in when visible via USB.: Cannot remount '/'

#

Line 15 is the call to storage.remount("/", readonly=False)

pale sundial
dire skiff
#

Well, I managed to fix my code error even without a Traceback. I have my logger working again, yea. It's tough to debug python when there is no debugger or access to print output, but near impossible without Tracebacks. Anyway, thanks for the advice. Any chance that there is a minimal CP debugger in the works (at least for the devices that have enough memory)?