Share My Creation Captive Portal with B4R - Configuring WIFI without any pain and no hardcoded - WIFI MANAGER


Screen Shot 12-30-19 at 12.21 PM.PNG


74a8e747-965b-498a-b456-2f6b54e97302.jpg
0a1d2a86-740c-4542-b483-4409d5e7a5ac.jpg



Instructions to install and sample to use:

But first, let me keep doing well this library and continuing updating sending to me some coffee.

1580386406691.png


Step 1:
Install the WIFIManager library through Sketch del Arduino: search for WifiManager by tzapu, my library uses the resources of this.

1580386466066.png



Step 2:
Copy the library for your library folder, my folder is this, I use Aditional Libraries, as soon as I copy it, refresh in the list next to it should already appear
1580386482906.png



1580386497023.png


Step 3:
You are read to use the example: SampleCaptive.zip

Look in the code that has already been set to access point and password "MyPortal", "mypass123". When you start the app, search for this Wi-Fi network, connect and then the WIFIManager screen will appear so you can connect to your Wifi.


HAPPY CODING BUT NOT FORGET TO BUY ME A COFFEE!!!
 

Attachments

  • LibraryCaptive.zip
    11.5 KB · Views: 611
  • SampleCaptive.zip
    801 bytes · Views: 622
Last edited:

monki

Active Member
Licensed User
Longtime User
hello Alberto,
good work.
did you write that in B4R?
Can you publish the code?
greetings monki
 

Michael1968

Active Member
Licensed User
Longtime User
Hi Alberto, great job.....is there a way to use it with esp32?
on ESP32 i get this error:

Konfiguration wird geladen...
Pakete werden initialisiert...
Boards werden vorbereitet...
Überprüfungsvorgang...
C:\Program Files (x86)\arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\arduino\hardware -hardware C:\Users\Michael Lankers\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\arduino\tools-builder -tools C:\Program Files (x86)\arduino\hardware\tools\avr -tools C:\Users\Michael Lankers\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\arduino\libraries -libraries C:\Users\Michael Lankers\Documents\Arduino\libraries -fqbn=esp32:esp32:m5stack-core-esp32:FlashMode=qio,FlashFreq=80,PartitionScheme=default,UploadSpeed=921600,DebugLevel=none -ide-version=10807 -build-path C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\bin -warnings=none -build-cache C:\Users\MICHAE~1\AppData\Local\Temp\arduino_cache_137381 -prefs=build.path=C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\bin -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-80-g6c4433a-5.2.0.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.mkspiffs.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.esptool_py.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.1 -prefs=runtime.tools.esptool_py-2.6.1.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.1 -verbose C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\src\src.ino
C:\Program Files (x86)\arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\arduino\hardware -hardware C:\Users\Michael Lankers\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\arduino\tools-builder -tools C:\Program Files (x86)\arduino\hardware\tools\avr -tools C:\Users\Michael Lankers\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\arduino\libraries -libraries C:\Users\Michael Lankers\Documents\Arduino\libraries -fqbn=esp32:esp32:m5stack-core-esp32:FlashMode=qio,FlashFreq=80,PartitionScheme=default,UploadSpeed=921600,DebugLevel=none -ide-version=10807 -build-path C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\bin -warnings=none -build-cache C:\Users\MICHAE~1\AppData\Local\Temp\arduino_cache_137381 -prefs=build.path=C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\bin -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-80-g6c4433a-5.2.0.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.mkspiffs.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.esptool_py.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.1 -prefs=runtime.tools.esptool_py-2.6.1.path=C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.1 -verbose C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\src\src.ino
Using board 'm5stack-core-esp32' from platform in folder: C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4
Using core 'esp32' from platform in folder: C:\Users\Michael Lankers\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4
Build-Optionen wurden verändert, alles wird neu kompiliert
Detecting libraries used...
"C:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-80-g6c4433a-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/config" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/app_trace" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/app_update" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/asio" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/bootloader_support" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/bt" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/coap" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/console" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/driver" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp-tls" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp32" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp_adc_cal" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp_event" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp_http_client" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp_http_server" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp_https_ota" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp_ringbuf" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/ethernet" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/expat" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/fatfs" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/freemodbus" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/freertos" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/heap" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/idf_test" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/jsmn" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/json" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/libsodium" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/log" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/lwip" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/mbedtls" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/mdns" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/micro-ecc" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/mqtt" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/newlib" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/nghttp" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/nvs_flash" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/openssl" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/protobuf-c" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/protocomm" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/pthread" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/sdmmc" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/smartconfig_ack" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/soc" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/spi_flash" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/spiffs" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/tcp_transport" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/tcpip_adapter" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/ulp" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/vfs" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/wear_levelling" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/wifi_provisioning" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/wpa_supplicant" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/xtensa-debug-module" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp-face" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp32-camera" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/esp-face" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4/tools/sdk/include/fb_gfx" -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10807 -DARDUINO_M5Stack_Core_ESP32 -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"M5Stack_Core_ESP32\"" "-DARDUINO_VARIANT=\"m5stack_core_esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4\\cores\\esp32" "-IC:\\Users\\Michael Lankers\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4\\variants\\m5stack_core_esp32" "C:\\Users\\MICHAE~1\\Desktop\\SAMPLE~1\\B4R\\Objects\\bin\\sketch\\src.ino.cpp" -o nul
In file included from C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\bin\sketch\rCaptive.h:3:0,
from C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\bin\sketch\B4RDefines.h:25,
from C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\src\src.ino:1:
C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\bin\sketch\WifiManager.h:16:25: fatal error: ESP8266WiFi.h: No such file or directory
compilation terminated.

exit status 1
 

Michael1968

Active Member
Licensed User
Longtime User
hello Michael, do you install the WifiManger via Sketch first?

look this error:
C:\Users\MICHAE~1\Desktop\SAMPLE~1\B4R\Objects\bin\sketch\WifiManager.h:16:25: fatal error: ESP8266WiFi.h: No such file or directory
compilation terminated.
Hello Alberto, if i compile for esp8266 everything is ok..problem only with esp32
 

Michael1968

Active Member
Licensed User
Longtime User
Hello Alberto and thetahsk...
with wifimanager-esp32 it works
thanks for help

@Alberto Iglesias, can you please create a esp32 lib with
Custom Parameters option?
this would be great and helpfull
thx
Michael1968
 
Top