Basecamp icon indicating copy to clipboard operation
Basecamp copied to clipboard

Captive portal

Open T94T opened this issue 7 years ago • 7 comments

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?

T94T avatar Jan 19 '18 15:01 T94T

Just implemented the code. It is available in the PR #18

esp32 captive portal osx

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.

TOLDOTECHNIK avatar Jan 22 '18 07:01 TOLDOTECHNIK

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.

merlinschumacher avatar Jan 22 '18 14:01 merlinschumacher

@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.

merlinschumacher avatar Jan 22 '18 15:01 merlinschumacher

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.

TOLDOTECHNIK avatar Jan 22 '18 16:01 TOLDOTECHNIK

I've updated before testing the PR, but I will test it some more

merlinschumacher avatar Jan 22 '18 16:01 merlinschumacher

Did you use the DNS update statement in your loop()? iot.dnsServer.processNextRequest();

TOLDOTECHNIK avatar Jan 22 '18 16:01 TOLDOTECHNIK

I did. It seems there are still issues with the DNSServer: https://github.com/espressif/arduino-esp32/pull/1011

merlinschumacher avatar Jan 22 '18 17:01 merlinschumacher