-->
Page 1 of 1

Captive portal using AT+ commands

PostPosted: Sun Apr 02, 2017 2:06 pm
by morcillo
Hello,

I have a discovery board running an application and I want to be able to access a web page hosted within it and display data. I have checked and tested programms using AT+ commands for websockets and HTTP and they work properly.

But the thing is that I want to be able to execute this anywhere, not just my network, so I ant to implement something like WifiManager (Arduino) but using AT+ commands.

From what I've seen I can set ESP8266 to be a dns server, but I don't have further control over it, I can't redirect those that connected to its softAP to a configuration website (am I wrong?). Before starting to implement this by hand using a UDP connection I wanted to check if there wasn't an easier way for me to do this using already available AT+ commands.

So...should I further study the AT+ commands or should I get started in implementing it using a simple UDP?

Re: Captive portal using AT+ commands

PostPosted: Wed Apr 19, 2017 5:40 pm
by MHeys
Bit of a long shot as I haven't done much with the AT command set since getting my first ESP quite a while ago and switching over to the Arduino IDE once it was available.

I'm not sure if it will fully work as I don't know if you will be able to send all the bytes needed for a DNS response over Serial but for now I will assume you can.

In essence you will have to create a UDP socket server (not websocket) on the DNS port 53 and reply to any request with the IP of your device.

I think this is the right command to start the UDP server: AT+CIPSTART=0,"UDP","0.0.0.0",53,53,2

And this is essentially the code that WifiManager uses for it's Captive portal, it just sets the domain name to *

https://github.com/esp8266/Arduino/blob ... Server.cpp

Hope that's a start anyway

Re: Captive portal using AT+ commands

PostPosted: Thu Mar 29, 2018 5:32 am
by RichardB
Sounds deceptively simple. But after 2 days I couldn't get it to work. Anyone had success with this?

TIA