Skip to content

ayushsharma82/ESPConnect

Repository files navigation




     



ESPConnect is a simplistic and easy approch to having a WiFi manager on your ESP MCUs. It is a lightweight library which let's you configure WiFi networks without any fuss. ESPConnect works with both ESP8266 & ESP32.


Portal Preview:


How to Install

Directly Through Arduino IDE ( Currently Submitted for Approval. Use Manual Install till it gets Approved.)

Go to Sketch > Include Library > Library Manager > Search for "ESPConnect" > Install

Manual Install

For Windows: Download the Repository and extract the .zip in Documents>Arduino>Libraries>{Place "ESPConnect" folder Here}

For Linux: Download the Repository and extract the .zip in Sketchbook>Libraries>{Place "ESPConnect" folder Here}

Manually through IDE

Download the Repository, Go to Sketch>Include Library>Add .zip Library> Select the Downloaded .zip File.


Dependencies

For ESP8266:
  • ESP8266 Arduino Core - latest
  • ESPAsyncTCP - v1.2.2
  • ESPAsyncWebServer - v1.2.3
For ESP32:
  • ESP32 Arduino Core - latest
  • AsyncTCP - v1.1.1
  • ESPAsyncWebServer - v1.2.3


Documentation

ESPConnect is a dead simple library which does your work in just 2 lines:


ESPConnect.isConfigured()

This function will return true or false depending on if ESPConnect was configured before or not. You can check with this function to perform certain functions before/after running ESPConnect portal.


ESPConnect.autoConnect(const char* ssid, const char* password, unsigned long timeout)

This function sets the SSID and password for your captive portal. The third parameter - timeout is optional which tells the library to keep the captive portal running for x - milliseconds. (Default - 3 minutes)


ESPConnect.begin(AsyncWebServer *server)

Call this function after autoConnect to start the WiFi manager. This function will first try to connect to the previous configured WiFi credentials and if those are not found, it will spin up a captive portal. If the user doesn't sets the wifi credentials, the library will return to execute your rest of the code in the setup block.

Please note: WiFi inactivity is managed by your code. If you think you need to reboot the MCU if there is no WiFi then please call the ESP.restart() function after checking ESPConnect.begin()'s response.


ESPConnect.isConnected()

This function will return true or false depending on the WiFi STA connection status of your MCU. Use this to check if your MCU is connected to access point or not.


ESPConnect.erase()

This function will erase configured WiFi STA connection details & and then proceed to disconnect the module.



Examples

Checkout example for ESP8266 and ESP32 in examples directory. Click Here


Contributions

Every contribution to this repository is highly appreciated! Don't fear to create issues / pull requests which enhance or fix the library, our maintainers are always ready to keep this library up & compiling.

ESPConnect consists of 2 parts:

  • C++ library ( in src folder )
  • Svelte webpage ( in portal folder ) ( provided source code for transparency )

You can contribute to the part you have most skill in.


If you like this amazing library, You can buy me a coffee:



License

ESPConnect is licensed under General Public License v3 ( GPLv3 ).

What about Commerical Usage?

If your company needs a embedded web interface like ESPConnect/ESP-DASH for 'commercial applications', then you can send me a mail at: [email protected].

I'm are open to a licensing deal or provide software development services which are along the lines of merging low-power microcontrollers with famous web technologies. For example: ESPConnect which consists of a C++ library and a lightweight Svelte SPA to fit inside a microcontroller.