How to run a MicroPython script from a file on the Raspberry Pi Pico W from the command line? Updated 2024-12-15 +Created 1970-01-01
The first/only way Ciro could find was with ampy: stackoverflow.com/questions/74150782/how-to-run-a-micropython-host-script-file-on-the-raspbery-pi-pico-from-the-host/74150783#74150783 That just worked and it worked perfectly!
python3 -m pip install --user adafruit-ampy
ampy --port /dev/ttyACM0 run blink.py
TODO: possible with rshell?
You can connect form an Ubuntu 22.04 host as:When in but be aware of: Raspberry Pi Pico W freezes a few seconds after after screen disconnects from UART.
screen /dev/ttyACM0 115200
screen
, you can Ctrl + C to kill main.py
, and then execution stops and you are left in a Python shell. From there:- Ctrl + D: reboots
- Ctrl + A K: kills the GNU screen window. Execution continues normally
Other options:
- ampy
run
command, which solves How to run a MicroPython script from a file on the Raspberry Pi Pico W from the command line?