ESP32 and ESP8266 WiFi Modem And HotSpot Autoconnect With Arduino

Other projects from this group

ESP32 and ESP8266 WiFi Modem And HotSpot Autoconnect With Arduino

Arduino source code for WiFi modem and hotspot configurations and programming of Espressif’s (ESP8266 and ESP32) modules...

Arduino ESP8266/NodeMCU WiFi Modem and Hotspot Source Code - Rev 1.2



Other projects from this group


This project contains two folders ESP32WiFiAutoConnect (the autoconnect source code) and PHP Script (For server use option).

The source code contains 3 files:

  1. ESP32WiFiAutoConnect.ino – the main program
  2. AC.ino (autoconnect handler)
  3. AC.h (configuration headerfile)

%26nbsp;esp32 and esp8266 autoconnect

First open one of the files with Arduino program, then set the settings as the following image (Board, CPU Frequency And Flash Frequency)

  • The compiler of software must be set on ESP32 (or similar) before doing anything.

Then put the ESP32 module on the “download mode” and upload the program.

After upload run the program in “normal mode”.

Then in case you are using ESP32-Cam, the red LED on the board would be turned on for 1 second then turns off. Then you’ll be able to see the module’s hot spot ssid via the WiFi networks in your PC or smart phone.

The default SSID is WiCardAC and the default password is 12345678. Connect and go to with a web browser.

The WiFi autoconnect configuration page

In the “Modem Configuration” section, you’re able to view/edit the SSID and password of WiFi modem/router and then click on “Save” after inserting. The module would connect to the modem after about 30 seconds in case of validity of ssid and password.

  • This page is also available via the DHCP IP of the module.

In the “Device Hot Spot Configuration“ section, you can set the module hotspot’s SSID and password. Also you can set a password for the internal page with Secure Link section. (Example: the secure link is ABCD and the root page would be at address)

The “Hidden HotSpot” button will set the module’s hot spot as hidden hotspot and the “Disable HotSpot when is connected to the modem” would disable the module’s hotspot, when is connected to the modem.

Programming manual

In the ESP32WiFiAutoConnect.ino file, search for “Your Setup code”, in this section you can place the initial code of your program.

Search for “Your loop code”, in this section you can place your loop program, which executes thousands time in a second.

In the AC.ino file, search for “Your EEprom init”, in this section you can set the initial values for EEprom memory.

Search for “Your config” to place your custom setting in the configuration page (The format must be HTML).

In the AC.h file, if you remove “#define LOG_ENABLE”, the logs will not be shown and the log memory would be released.

With add or remove “#define UPDATE_IP” you can enable or disable the server connection option.

The “LOOP_10_S” value set the printing “-” In the log time. The best time is 10 seconds and set according to your module CPU frequency.


-Internal pages secure link

-server script


-Shop MAC and IP in config page


-Set module hotspot and modem’s ssid and password

-Automatically connection to the modem

-Config page

-Hidden hotspot button

-Disable hotspot button

Similar Projects: