Developing in VS Code using mpremote
mount option - Read only when running script?
#9735
-
I have recently started working with MicroPython with a W5500_EVB-Pico dev board (Raspberry Pico RP2040 + WIZNET W5500 Ethernet). I've tried the Thonny IDE as recommended, but I've been spoiled by VS Code and the various extensions provided there. I could deal with Thonny if my project were limited to one py file, but the nature of the project I'm working on will be much easier to manage if I were to split it into multiple files. I also like to keep my code in a git repo. It seems Thonny is designed to either edit the py files on the Pico (I have to transfer the files back so I can update my git repo) or on the local computer (I have to transfer each file updated over to the Pico to test)... neither option is ideal IMHO. I ran across the There are two problems that I currently have run into that I'm hoping there is an easy solution to that somebody can enlighten me with:
If I manually copy my files to the dev board (in Thonny) and run main.py from that IDE, I can interact with the CLI as expected. If I copy all of the files to the dev board and restart it (main.py auto-started by MicroPython), then connect to the board via a tool like Putty, I can interact with the CLI as expected. Does anybody else have a better solution for working in VS Code (on Windows) with MicroPython? I have tried the Pico-Go-W extension for VS Code, but it had problems connecting to my board (it auto-connected with a Bluetooth device and ignored settings to connect to a specific device - I tried both COM port and the ID). I was able to get it working by changing the COM port number of my device so that it was the first device in line for Pico-Go-W to detect and connect, but there were other problems that I also ran into (but don't remember at the moment). The mpremote mount option seems to be the best solution available to meet my needs at the moment. If I can figure out how to keep the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I replied to #9734 -- use I do agree this is a bit awkward... I wonder if this should be automatic (or maybe an option, e.g.
With In this case what you want is possibly
which will start the script and then immediately switch to repl mode instead. |
Beta Was this translation helpful? Give feedback.
I replied to #9734 -- use
/remote/lib
I do agree this is a bit awkward... I wonder if this should be automatic (or maybe an option, e.g.
mpremote mount --add-lib-path
)With
mpremote run
(or exec/eval) the terminal is read-only (it's designed just to print any output until the script/command finishes).In this case what you want is possibly
mpremote .... run --no-follow foo.py repl
which will start the script and then immediately switch to repl mode instead.