Introduction: IoT ESP8266 Series: 1- Connect to WIFI Router
This is part 1 of an "Instructables" series dedicated for explaining how to make an Internet of Things project using ESP8266 NodeMCU that aims at reading and sending data to a website and making an action using the same website.
ESP8266 ESP-12E Development Board will be used. This board is based on ESP8266, integrates microcontroller capabilities and WIFI in one board. It could be coded like arduino.
This instructable will show you how to configure it and program it using arduino IDE. You will implement two projects:
- Blinking an LED
- WIFI connection and IP-address print
Step 1: Download the Arduino IDE and ESP8266 NodeMCU Driver
- Download its driver from this link CH341SER.zip or from attached file.
- Download Arduino IDE.
Attachments
Step 2: Configure ESP8266 NodeMCU As an Arduino
3. Start Arduino and open Preferences window.
4. Enter http://arduino.esp8266.com/stable/package_esp8266... into Additional Board Manager URLs field.
5. Open Boards Manager from Tools . Enter esp8266 intro the search field to install ESP8266 platform
6. Go to Tools > Board menu, then select your ESP8266 board.
7. Go to Tools > Port. Connect your ESP.
Step 3: Run Blinking LED Program
This program needs no circuit. It will use a built-in LED which is connected to:
The pin named D4 or GPIO 2
For more information about hardware see this link https://github.com/nodemcu/nodemcu-devkit-v1.0
Download the attached program
Enjoy!
Attachments
Step 4: Connect to a WIFI Network
This program will connect your ESP to a WIFI network and print its IP address on your arduino serial monitor.
You need to modify your ssid and password
const char* ssid = "YOUR WIFI NETWORK NAME";
const char* password = "YOUR WIFI PASSWARD";
make sure that the Baud rate in the program and your serial monitor window are the same
Attachments
Step 5: See Next Instructable
See part 2 to learn how to send your sensor data to one of the popular IoT free cloud service https://thingspeak.com.
8 People Made This Project!
- framakers made it!
- MohanedH made it!
- SidNelson made it!
- amroadrider made it!
See 4 More
13 Comments
Question 2 years ago
hi this is a very helpful platform i am faced with a little challenge i am doing a power monitoring project on inverter batteries, i was able to connect to the node mcu esp8266 to our wifi but now our cyber security require a one time authentication on every device, so this is how we connect.
the domain name and your domain password .
but on my device how do i put the ssid, domain name, password .
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
const char* ssid = "**********";
const char* password = "*******";
char domname [] = "*********";
i did this but it's not working
thank you
3 years ago
Thanks for an excellent , to the point description.
3 years ago
This works on the NodeMCU ESP-12E, after you upload the program change the baud rate of the terminal window to 9600 and press reset, after a bit of garbage you should see the dot and the ip address.
:)
Reply 3 years ago
Joshua6243,
I get the dots to show up but it never gets an IP address. Have you figured out anything else?
Reply 3 years ago
Actually yes, Took me a while to figure this one out, i block every mac addres on my router that is not listed so of course i forgot to add the mac address of the ESP12E to the list, this is what i used to get the mac address from the board!
Just open the console and note the mac address.
Hope this helps you out!
****************************
#include <ESP8266WiFi.h>
void setup(){
Serial.begin(115200);
delay(500);
Serial.println();
Serial.print("MAC: ");
Serial.println(WiFi.macAddress());
}
void loop(){}
5 years ago
serial monitor is not showing any thing , as i have changed the ssid and pass and also to the 9600 baud
Reply 5 years ago
Dont forget to press the button reset when you open the Serial communication
Reply 4 years ago
Thanks.. after pressing the reset button.. worked fine
Reply 5 years ago
Set 115200 baud
4 years ago
Hello,
Is it possible when I connect the ESP8266 to Router and I want to access Router using programming not web browser??
5 years ago
When the unit is connected initially, is the blue light supposed to blink? This unit is new and in it's sealed package. Also it never connects to the computer.
5 years ago
Am unable to find drivers that work with my Ver. 1.0 (Ver 2). The drivers here disapear when attempting to extract. The file name is there, and when extracting it dissapears. That is for Win 10, haven't found any OS X drivers that works either.
6 years ago
Thanks for the first part, cant wait to read part 2. Keep it coming!
It is good to see an introduction that just uses the device and does not spend all the time describing how to change its firmware as the standard firmware works fine for most users.
I have found the way you wire the device up makes a big difference with being successful to operate it. Secondary power that is sufficient to supply a few hundred milliamps appears critical or the device will be unreliable or now work at all.