Trying to run this chain and getting nothing in reply:
mpremote connect COM2 exec "import os; os.listdir()"
but when I add mount to this after changing setup chain then it works: mpremote connect COM2 mount . exec "import os; os.listdir()"
also tried to first run this: mpremote connect COM2
and received:
Connected to MicroPython at COM2
Use Ctrl-] to exit this shell
next I ran the second half : import os; os.listdir()
and got expected responce:
['abc', 'def']
so it seems like combining connection to a COM port with executing a script not on mounted location but on a real device (Nucleo board STM32WB55) does not work for some scripts.
Tried the following and it worked: mpremote connect COM2 exec "import machine; machine.reset()"
chain of commands to connect to port and execute script does not work in mpremote
-
- Posts: 2
- Joined: Sat Dec 04, 2021 12:51 am
-
- Posts: 2
- Joined: Sat Dec 04, 2021 12:51 am
Re: chain of commands to connect to port and execute script does not work in mpremote
Solution is found. It is addition of print
mpremote connect COM2 exec "import os; print(os.listdir())"
mpremote connect COM2 exec "import os; print(os.listdir())"