DarkMorford bae546ea8f Set up sample IRQ handler for button press 6 lat temu
..
MicroPython 5e773ddfc9 Start setting up environment for writing ESP8266 code. 6 lat temu
Pipfile 5e773ddfc9 Start setting up environment for writing ESP8266 code. 6 lat temu
Pipfile.lock 5e773ddfc9 Start setting up environment for writing ESP8266 code. 6 lat temu
README.md 63fdd70be7 Fix formatting in the docs. 6 lat temu
boot.py 6bb0b820b7 Add default boot.py from MicroPython installation. 6 lat temu
config.json.tmpl 3842ec716d Define configuration template 6 lat temu
main.py bae546ea8f Set up sample IRQ handler for button press 6 lat temu

README.md

Desert Bus for Hope - RDP Button

This code is intended to run in MicroPython on the ESP8266EX microcontroller. You may experience different results running in a different environment.

Installation

Preparing your computer

  1. Ensure that you have Git and Python installed.
  2. Install the pipenv virtual environment tool following the official documentation.
  3. From a terminal, execute the following commands:
git clone https://code.darkmorford.net/DesertBusForHope/rdp-button.git
cd rdp-button/code
pipenv install

This will create a virtual Python environment and install two essential tools: esptool, used for flashing firmware to the device, and ampy, used to manipulate the filesystem.

Preparing the ESP8266

  1. Connect the ESP8266 module to your computer and determine its serial port identifier.
    • For Windows machines, this will be something like COM1
    • For Linux/macOS, this will be something like /dev/ttyUSB0
  2. From this directory (the one containing Pipfile), run the following command to clear the ESP8266's flash memory: pipenv run esptool --port <port> erase_flash

  3. Flash the MicroPython firmware onto the ESP8266. This will vary slightly depending on your board.

    • In most cases, flashing with the default quad-I/O mode will work fine: pipenv run esptool --port <port> --baud 460800 write_flash --flash_size detect 0 MicroPython/esp8266-20180511-v1.9.4.bin
    • For some boards, it is necessary to fall back to the dual-I/O mode: pipenv run esptool --port <port> --baud 460800 write_flash --flash_size detect --flash_mode dio 0 MicroPython/esp8266-20180511-v1.9.4.bin