Git Product home page Git Product logo

esp8266-captive-portal's Introduction

Captive portal for esp8266

Description

A captive portal is a web page accessed with a web browser that is displayed to newly connected users of a Wi-Fi or wired network before they are granted broader access to network resources.
This implementation uses DNS redirecting method for ESP8266 microchip for Wi-Fi network.

Keep in mind: One of limitation of this method is not being compatible with HTTPS domains, in other words only HTTP domains will be redirected to portal.

Usage

  1. First, clone the project.

    git clone https://github.com/Ali-Nasrolahi/esp8266_captive_portal.git
  2. Then setup your arduino environment and your board programmer. We're using Wemos d1 r1 board. checkout your vendor page for complete setup.

    General configurations are available through set of macros included in include/config.h.

  3. After confirming the configs you could easily upload the sketch and view the result by connecting to created AP.

That's it ๐Ÿ˜ƒ

Code design

Source code is designed to be easy to expand and modify. If you like to add new webpage or image just add your new method to Webpage class implement the handler then pass the data or file path to loadFile.

Just register your handler at setup and done!!!

Storage

An alternative method to display your webpages is to use a filesystem and store pages' data into flash.

To do so:

  1. First you need to upload your HTML, CSS, JS, jpeg, ... data to your flash. here we using LittleFS to store and retrieve data.

    • LittleFS installation and uploader is available at LittleFS-plugin github page.

  2. Enable macro USE_FS to use filesystem instead of hard-coded data.

  3. Implement your handler and that's all.

License

GPLv3

THANKS ;)

esp8266-captive-portal's People

Contributors

ali-nasrolahi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.