11 How to get the NodeMCU up and running
mishi edited this page 2018-11-10 17:59:51 +01:00

How to get the NodeMCU up and running

Get need software installed

On the Macbook

sudo pip3 install esptool
  • Install rshell:
sudo pip3 install rshell

Flash the ESP8266 on the NodeMCU board

  • Erase flash (Replace cu.SLAB_USBtoUART when using another driver).
esptool.py --port /dev/cu.SLAB_USBtoUART --baud 230400 read_flash 0 2097152 orig_fw.bin`
esptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 erase_flash
  • Flash with the new firmware: In <halloween>/esp8266/firmware run
esptool.py --port /dev/cu.SLAB_USBtoUART -b 115200 write_flash 0 ./firmware-v1.9.4-683-gd94aa57.bin

Setup ESP8266

  • Start the terminal by
screen /dev/tty.SLAB_USBtoUART 115200
  • In the terminal, set up the wifi connection by following the help() suggestion:
import network
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
sta_if.scan()
sta_if.connect("<AP_name>", "<password>")
sta_if.isconnected()
  • Enable webrepl:
import webrepl_setup
  • I've used the WebREPL to connect via Wifi and sent the Python files from <halloween>/esp8266 to the ESP8266

  • In the shell, run import pumpkin and Flask comes up.

  • Start scaring via the web interface (port 8081)