The Code

For us to be able to work with the NodeMCU, we need to be able to upload the code without using the serial port. This is called Over The Air.

OTA (Over The Air) update is the process of uploading a new code to the ESP8266 module using WiFi connection instead of serial communication.

This is done by following the instructions below:

  1. Connect your NodeMCU dev board to the computer using a USB cable.

  2. Select the board and the port number as follows:

Choosing the port (randomnerdtutorial.com)

3) Open the BasicOTA.ino example: File > Examples > Arduino OTA > BasicOTA.ino or copy the following sketch to your Arduino IDE.

The code will be as follows:

4) Click the "Upload" button

The full code is as follows:

Last updated

Was this helpful?