Skip to content

Instantly share code, notes, and snippets.

@phenotypic
Last active May 25, 2019 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phenotypic/8d9d3b886936ccea9c21f495755640dd to your computer and use it in GitHub Desktop.
Save phenotypic/8d9d3b886936ccea9c21f495755640dd to your computer and use it in GitHub Desktop.
Flashing a NodeMCU using the Arduino IDE (macOS)

Flashing a NodeMCU using the Arduino IDE (macOS)

Watch a demo here

Note: These steps will only work if your NodeMCU has the CP2102 chip onboard (instead of the CH340G chip).

  1. Have the .ino script included in the repository downloaded and ready to go.

  2. Download and install the Arduino IDE from here.

  3. Download and install the USB to UART drivers for the CP2102 chip from here.

  4. Open the Arduino IDE. Then, in the Preferences tab, under Additional Board Manager URLs, enter the following URL: https://arduino.esp8266.com/stable/package_esp8266com_index.json

  5. Go to the Tools tab and select Board Manager. Search for esp8266 and click on install.

  6. Go to the Tools tab, Boards, then select NodeMCU 1.0.

  7. Plug in the NodeMCU, then in the Tools tab, set Port to the one containing SILABS.

  8. Delete all the code in the Arduino IDE window (i.e. void setup() etc.) then copy and paste in the contents of the .ino script you downloaded earlier (you may have to open the .ino script with an app like Atom in order to view its contents).

  9. Change any variables where asked to do so. The variables you should change are enclosed in slashes (/) like below - do not change values outside of this area:

/////////////////// CHANGE THESE VALUES //////////////////////
const char* ssid = "MyWifi"; //Name of your network
const char* password = "examplepassword"; //Password for your network
const char* mdns = "esp8266"; //mDNS name
//////////////////////////////////////////////////////////////
  1. Next, after you have plugged in your NodeMCU with micro-USB cable capable of data transfer, click on the Right Arrow icon (➡) on the top left of the Arduino IDE to start flashing.

  2. Once the flashing has finished, you should see an LED turn on and then turn off shortly after. When the LED shows, it indicates that the NodeMCU is attempting to connect to the network you specified. The LED will turn off once it has connected successfully.

  3. Set the Arduino IDE's Serial Monitor to 115200 baud, then use it to retrieve the NodeMCU's IP address and mDNS address while it is booting up and connected to your computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment