|
há 5 anos atrás | |
---|---|---|
.. | ||
MicroPython | há 5 anos atrás | |
Pipfile | há 6 anos atrás | |
Pipfile.lock | há 5 anos atrás | |
README.md | há 5 anos atrás | |
boot.py | há 5 anos atrás | |
button.py | há 5 anos atrás | |
config.json.tmpl | há 5 anos atrás | |
main.py | há 5 anos atrás | |
quadrature.py | há 5 anos atrás |
This code is intended to run in MicroPython on the ESP8266EX microcontroller. You may experience different results running in a different environment.
pipenv
virtual environment tool following the official documentation.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.
The Wemos D1 mini requires a driver for Mac OS X to drive the CH340 serial bridge. It can be downloaded here.
COM1
/dev/ttyUSB0
Pipfile
), run the following command to clear the ESP8266's flash memory: pipenv run esptool --port <port> erase_flash
pipenv run esptool --port <port> --baud 460800 write_flash --flash_size detect 0 MicroPython/esp8266-20190529-v1.11.bin
pipenv run esptool --port <port> --baud 460800 write_flash --flash_size detect --flash_mode dio 0 MicroPython/esp8266-20190529-v1.11.bin
config.json.tmpl
to config.json
, and edit the new file with correct wi-fi details and button ID number.pipenv run ampy -p <port> put <file>
to copy the following files to the device.
Alternately, set the AMPY_PORT
environment variable in your terminal and omit the -p <port>
argument.