pip3 install esptool rshell
As described in the NodeMCU docs download firmware from micropython.org and flash it with the esptool
:
esptool.py --port /dev/tty.usbserial-FA210 write_flash -fm qio 0x00000 esp8266-20190125-v1.10.bin
minicom -s -b115200 -D/dev/tty.usbserial-FA210
https://raw.githubusercontent.com/pycom/pycom-libraries/master/examples/mqtt/mqtt.py
Then in rshell cp mqtt.py /pyboard/
. (Start rshell like so: rshell -p /dev/tty.usbserial-FA210
.)
Erase the flash and all will be good for using the Arduino IDE:
esptool.py --port /dev/tty.usbserial-FA210 erase_flash
The following files constitute the LED Switcher App:
index.html
: Web page with one radio buttonapp.css
: CSS for the web page, mostly for styling the radio button.app.js
: A vuejs app that controls the radio button.credentials.py
: User-created file that contains WIFI ssid and passwordled-switcher.py
: This will bemain.py
on the NodeMCU.
Create a file credentials.py
with this content:
ssid = 'your-ssid-here'
password = 'your-password-here'
It will be read by led-switcher.py
.
Copy everything over using rshell
:
make copy-all
Press the reset button once to activate the new code.
When WIFI registration is complete the LED blinks a few times.