Basecamp
Basecamp copied to clipboard
Captive portal
It would be great to have captive portal enabled. Just found this sketch: https://github.com/espressif/arduino-esp32/blob/615c9279f79f9f721eedc3d48b3506b3c3054492/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino Is it possible to implement this feature in your code?
Just implemented the code. It is available in the PR #18
Captive portal support, so you don't have to type in 192.168.4.1 in your browser again when you try to setup your device. Tested on OSX and iOS.
Ensure to call iot.dnsServer.processNextRequest(); periodically in your loop() block.
I'm currently evaluating @TOLDOTECHNIK s PR. Since the DNSServer.h needed by the CaptivePortal has been added to the ESP32 Core for Arduino just 4 days ago I will to make the CaptivePortal-code optional for now. So people won't have failing projects.
@TOLDOTECHNIK I've merged #18 but the portal doesn't work for me on Android, iOS or Linux. This might be a problem with the Core, because the provided example CaptivePortal.ino doesn't work either. Nonetheless I merged your code. Thank you for your support.
Making it optional is a very good idea. We made the tests with the newest core. One issue we discovered with an older core, is, the ESP32 gets a new IP over and over again when obtaining one from a FRITZ!Box. This issue has been gone since updating.
I've updated before testing the PR, but I will test it some more
Did you use the DNS update statement in your loop()?
iot.dnsServer.processNextRequest();
I did. It seems there are still issues with the DNSServer: https://github.com/espressif/arduino-esp32/pull/1011