- Name: ESP8266 NodeMCU
- Producer: LoLin/WeMos
- Generation: 2nd
- Version: 1.0
- “Common” name: v3
More about the different NodeMCU boards here
Install WeMos driver and restart. Download driver here: https://www.wemos.cc/downloads
This driver doesn’t work with macOS Sierra, and it will crash your Mac when you plug in the NodeMCU. Download the driver below to get it working on Sierra:
https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver
-
Download esptool and follow the instructions.
-
To find the port of the NodeMCU use the following command:
ls /dev/{tty,cu}.*
. It should be something similar to this/dev/cu.wchusbserial1410
Use nodemcu-uploader
Use ESPlorer
- Select the port from above.
- Set baud rate to 115200.
- Enable DTR and RTS.
- Open port and press reset button on the NodeMCU.
- When succesfull you should get a Lua REPL.
There are two modes: wifi.STATION
and wifi.SOFTAP
- one is access point and the other is normal connection to WiFi.
To setup the wifi, use the lua credentials.lua
setup-files I provided.
You should only need to make changes in that file. Avoid doing application logic outside application.lua
.
I recommend you give the machine running your server a static IP, and make the ESP8266 create a WiFI access point and connect to that IP. The chip should connect on port 8080.
The connection between the ESP8266 NodeMCU and the game uses the MQTT protocol.The ESP8266 runs as a client, so does the game/front-end.
Restart the NodeMCU and let it connect. Remember to start the server/broker before restarting the NodeMCU, otherwise it won't connect. When the first connection is made, it'll reconenct by itself.