Software Installation ===================== Deploying MicroPython --------------------- The TurtlePlotBot software was developed and tested using MicroPython version 1.12. The `micropython` directory contains a turtleplotbot.bin file with MicroPython as well as additional required frozen python modules that can be flashed to your ESP32 device using the `esptool.py` utility. The `micropython` directory also contains a fat.zip file containing a FAT filesystem image preloaded with TurtlePlotBot programs and Hershey font files. You must unzip the fat.zip file before using the `esptool.py` to transfer the filesystem to your ESP32 device. See the `Getting started with MicroPython on the ESP32 `_ chapter of the `MicroPython Documentation `_ for detailed information on obtaining and installing the esptool program used tpo flash your device. Erase the Esp32 Flash ---------------------- The first time you install MicroPython on a device you need to erase the flash. .. code-block:: bash $ esptool.py --port /dev/ttyUSB0 erase_flash Example output from the esptool.py erase_flash command: .. code-block:: none esptool.py v2.8 >>> Serial port /dev/ttyUSB0 Connecting........___ Detecting chip type... ESP32 Chip is ESP32D0WDQ6 (revision 1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 26MHz MAC: 24:6f:28:xx:yy:zz Uploading stub... Running stub... Stub running... Erasing flash (this may take a while)... Chip erase completed successfully in 18.4s Hard resetting via RTS pin... Flash MicroPython ----------------- Use the following esptool.py commands to flash your ESP32 device with MicroPython 1.12 and other required modules. .. code-block:: bash esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 turtleplotbot.bin Flash FAT image --------------- Use the following commands to unzip and transfer the fat filesystem image to your ESP32 device. .. code-block:: bash unzip fat.zip esptool.py write_flash 0x200000 fat.img Congratulations --------------- Your TurtlePlotBot is now programed and ready run. Press the RST button and the "DrawBot Menu" should appear. See the `menu module `_ documentation for more information on the DrawBot Menu and how to use it. See the `turtleplot module reference `_ documentation for more information on the Turtle Graphics python methods available. See the `Example Programs `_ page for some example programs. The `tftui `_ page has information and example programs on using the LCD screen. MicroPython program to show free drive space --------------------------------------------- .. code-block:: python import uos fs_stat = uos.statvfs('/') fs_size = fs_stat[0] * fs_stat[2] fs_free = fs_stat[0] * fs_stat[3] print("File System Size {:,} - Free Space {:,}".format(fs_size, fs_free))