Testing modules without uploading to µC
-
I'm using pymakr for VSCode and looking for a way to test my modules without uploading them manually to the Microcontroller after every single change.
i use rshell from within the VSCode-Console to upload my module to the ESP32 because the "Upload"-Button uploads all Files and Folders of my entire workspace.
Unfortunately the module needs to be on the µC for using/testing it (while in opposite the main.py can be run from REPL).
It's very anoying, to disconnect board, rshell into board, maneuver to the right directory und cp to the µC.
Is there any other/ faster way?
-
@Felix-Siegmeier i have recently found a netrc file for upload easy (by ftp). Extract of the netrc file (wich called "NETRC_UPLOAD" on my computer) :
machine 192.168.4.1 login micro password python macdef init cd /flash put circuit.mpy put commande.mpy put main.py mkdir lib put lib/logging.mpy
And for use this file with ftp (tnftp) use the following command (run for me):
ftp -N NETRC_UPLOAD 192.168.4.1
In this way, the upload was done alone (by wifi) in the right path.
-
@Felix-Siegmeier You can use pyboard.py to run a file on the target device without copying it to the target file system: https://github.com/micropython/micropython/blob/master/tools/pyboard.py
pyboard.py is also used by rshell and another nice not-yet-published tool mpr.py: https://github.com/micropython/micropython/pull/6375Use
pyboard.py --help
for short usage hints. For mpr.py, look at the PR.Just running a script would by:
pyboard.py -d DEVICE <script_name>
or
mpr connect <device> run <script_name>
There are short cuts for the connect part, like
u0
forconnect /dev/ttyUSB0