You will be programming the ESP8266 from the Arduino IDE. Since Version 1.6.4 the IDE can be easily extended to program other boards the “normal” Atmel chips found in the Arduino boards. And that is exactly what we are going to do in order to program the NodeMCU V1.0. Before we start I would like to point out that an improved version of this guide is also available as eBook for Kindle. Buy now!
1. Download and Install the Serial Diver
To program the NodeMCU V1.0 your development platform (PC, Mac, Linux) needs to detect the CP2102 Serial-To-USB adapter. If your platform does not come with this driver you can download and install it from here: https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspxUPDATE: it seems that there are different versions of the NodeMCU produced. Some of them use the CH340 chip for serial-to-usb conversion. If you got one of those you can find the driver here:
2. Download and Install IDE
3. Install the ESP8266 tool chain
- Open the Arduino IDE
- Go to your preferences/settings and in the text box “Additional Board Manager URLs” enter this URL: http://arduino.esp8266.com/package_esp8266com_index.json
- Now go to Tools > Board: … > Boards Manager…, search the ESP8266 board and click install
- Get a coffee and wait until it finishes
4. Selecting the Correct Board
5. Setting the Correct Port
6. Testing the Setup: Wifi Scanner
If everything worked well, click on the magnifying glass on the top right of the window. This is the serial console that you can use to see output from the NodeMCU module or also to send commands to the device. Make sure that the baud rate is set to 115200. This rate is also set in the example code and if you have a different setting the ESP will talk with a different speed than your PC listens. This will result in strange characters… My output looks like this:
If you see something similar: congratulations! You have just set all the preconditions to run the WeatherStation code.
A ridiculous amount of coffee was consumed in the process of building this project. Add some fuel if you'd like to keep me going!