Posts

Showing posts from March, 2021

Microptyhon on the ESP32: file management

Image
 While some boards using MicroPython have processors with built-in USB supports, the ESP32 is not one of those. That basically means the ESP32 needs an auxiliary chip to connect to a USB port. But it also means the preferred connection is to emulate a serial connection. Chips like the FTDI's USB to serial, or CP1202, or the CH340G, all are seen as a COM port on the PC side. And here is where the difference matters, as a serial communication matches well the REPL interpreter, but it also prevents the device to appear as any other device to your system (no mouse, no keyboard, no mass storage device). And that is a problem as MicroPython usually relies on the host system to have access to the local storage on the MicroPython device so different files and libraries can be edited a replaced during the development phase. What does no change, however, is that MicroPython still can have access to the local file system. Just try:  import os os.listdir() So, one way of dealing with this limi