Captive Portal Using ESP8266

0

A few years back, there was something that knocks my head out, I really interested with the automated kind of things. Maybe after watching Iron Man and that movie pick my sense out of curiosity, Because I know, everything in the movie is achievable. There is nothing impossible in this era that cannot be done as long as there is an effort and hard work. But today I want to share about a thing that’s known as Arduino Killer. This is an Internet Of Things (IOT) era. Who doesn’t want to sit back and control everything just using their phone/tablet or just using their voice. This thing helps us to communicate with other device or our other project using WiFi, Well that thing is ESP8266, this idea is to try to broadcast the SSID by using the ESP8266 features so other people can pick up the SSID when they search for the free wifi channel and then landed on the captive portal, and this is the concept on how to control remotely by using ESP8266 and I will try to explain it step by step on how to achieve them.

ESP8266 Features:

  • 802.11 b/g/n
  • Wi-Fi Direct (P2P), soft-AP
  • Integrated TCP/IP protocol stack
  • Integrated TR switch, balun, LNA, power amplifier and matching network
  • Integrated PLLs, regulators, DCXO and power management units
  • +19.5dBm output power in 802.11b mode
  • Power down leakage current of <10uA
  • 1MB Flash Memory
  • Integrated low power 32-bit CPU could be used as application processor
  • SDIO 1.1 / 2.0, SPI, UART
  • STBC, 1×1 MIMO, 2×1 MIMO
  • A-MPDU & A-MSDU aggregation & 0.4ms guard interval
  • Wake up and transmit packets in < 2ms
  • Standby power consumption of < 1.0mW (DTIM3)

Step 1: Gather All the required Software and Hardwares

Software

  • Arduino

Hardware

  • ESP8266-1
  • FTDI Programmer
  • A few jumper
  • Arduino development board

Step 2: Wiring

ESP8266 for me is just like a child that we need to feed it up as what it need, if the power is not enough we can never successfully program it. As the power requirement, the module is not capable of 5-3V logic shifting and will require an external converter. Please do not power it directly from your 5V dev board or you will risk burning your board out. Below is the connection that I used

 

For the VCC as you can see there are 2 source needed and for this, I use source 3.3v from the FTDI programmer itself and another one from the Arduino 3.3v pin.

Step 3: Program

Open your Arduino IDE [File] >> [Preferences] and add the additional board manager URL like below

http://arduino.esp8266.com/stable/package_esp8266com_index.json

 

Open the board manager by [Tools] >> [Board] >> [Board Manager], search for esp8266 and download

Download all the required files from CaptivePortal this code is by M. Ray Burnette, design your landing page at the code below and upload it to your ESP8266 board, the time taken for the program to be upload will be quite long so just patiently wait for it.

String responseHTML = ""
                      "<!DOCTYPE html><html><head><title>CaptivePortal
                        </title></head><body>""
<h1>Hello World!</h1>

This is a captive portal example. All requests will "
                      "be redirected here.

</body></html>";


void setup() {
  WiFi.mode(WIFI_AP);
  WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
  WiFi.softAP("DNSServer CaptivePortal example");

 

Step 4: Testing
Custom Board

In my recent project I need to design a simple custom printed circuit board,  so I have made up my choice to use the ESP8266 inside it, below is how it looks

 

[Music Of The Day] – Dannic feat. Bright Lights – Dear Life

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here