Replies: 2 comments 6 replies
-
After testing ampy for a bit, I felt that I could use it, except, I just couldn't invoke it within Python script with os.popen(). I am not using a virtual environment. I installed ampy with admin terminal under win 11. I was able call it from within a terminal window with ampy or python -m ampy but just not when I used os.popen(). I tested pip and esptool. Both could be invoked with os.popen() so maybe it's just how ampy was written that caused the issue? My python snippet: I also tried mpy_cross, which only runs when I used python -m but not directly. It runs with os.popen(). I'm stumped. |
Beta Was this translation helpful? Give feedback.
-
Mpremote is callable from Python, although AFAIK there is no documentation about the call interface. See for example https://github.com/micropython/micropython/blob/master/tools/mpremote/mpremote/transport_serial.py This is another approach where you may get some code and ideas, it also exposes an api: https://github.com/bixb922/freezeFS |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been using thonny to manually upload files to my ESP32 MP dev boards for years but I need to automate some of these tasks such as to write a python program to connect to an MPY board, determine the files on the board and perform file upload and updates to the board, all without the user's interaction. The goal is to mass provision and update boards with automated scripts. I've read about adafruit-ampy, rshell, and mpfshell. It seems that mpfshell is for manual interaction with an MPY board, including entering commands to manipulate the file system. I need a programmatic way to interact with an MPY board. ampy seems to fit the description with plenty of command-line options to do these. rshell has a process commands from a file feature. I wonder if there exists a tool that is a Python module so I can call its methods and get say a list of the folder content in returned values instead of a printout in STDOUT. Maybe ampy is my best option? Thank you for any thoughts and inputs!
Beta Was this translation helpful? Give feedback.
All reactions