Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

MicroPython SenseTemp

Designed by Capable Robot Components. Follow us on Twitter for product announcements and updates.

This folder contains MicroPython software for use of the SenseTemp with the Adafruit ESP32 Feather Host.

System Setup

  1. Install tools
pip3 install esptool adafruit-ampy
  1. Flash MicroPython onto the device --port /dev/ttyUSB1 set_flash_voltage 3.3V --port /dev/ttyUSB1 --chip esp32 erase_flash --port /dev/ttyUSB1 --chip esp32  write_flash -z 0x1000 ../firmware/esp32-20180511-v1.9.4.bin

The first command is necessary if the SenseTemp PCB has been soldered to the ESP32 module, due to the PCB pulling up GPIO12 (the SIO pin).

On MacOS, the port name will likely be /dev/tty.SLAB_USBtoUART.

By default, the ESP32 sees that as a signal to provide the flash chip with 1.8v instead of the default 3.3v. This causes the SPI flash to brown out during writing and the MD5 checksum verify step will fail (because the flash is corrupted). Setting the EFUSE causes the ESP32 to ignore the GPIO12 pin and always provide 3.3v to the SPI flash.

  1. Load MicroPython source files (see below)

Console Demo

ampy put lib
ampy put


After creating the JSON file, you'll need to edit it to have your correct WIFI and information.

cp settings-mqtt.json.example settings-mqtt.json 
ampy put lib
ampy put settings-mqtt.json 
ampy put


After creating the JSON file, you'll need to edit it to have your correct WIFI information. Due the size of the www folder, this will take a few minutes. Be patient.

cp settings.json.example settings.json 
ampy put lib
ampy put www
ampy put settings.json
ampy put


During development, it's best to load the main file under a different name so that the firmware does not automatically execute it.

If the MicroPython code hangs, the ampy tool has a hard time putting the ESP32 module into raw communication mode (wherein it can upload files). These commands can be used to

  1. Upload the in-development file
  2. Open a serial console (you will need to change the path) to the MicroPython REPL.
  3. Start the in-development software. Errors will be printed to the REPL.
ampy put
screen /dev/ttyUSB1 115200
> from tmp import *