-->
Page 9 of 15

Re: Captive Portal or force all webcalls to ESP8266 AP IP ad

PostPosted: Thu Jun 25, 2015 3:01 pm
by SwiCago
@blackie looks like you just confirmed it. The DNS data returned by DNSServer seems to be invalid.

Re: Captive Portal or force all webcalls to ESP8266 AP IP ad

PostPosted: Thu Jun 25, 2015 4:43 pm
by burkmurray
The DNS return code is configurable, and NXDOMAIN is the default. From DNSServer.ino:
Code: Select all// set which return code will be used for all other domains (e.g. sending
  // ServerFailure instead of NonExistentDomain will reduce number of queries
  // sent by clients)
  // default is DNSReplyCode::NonExistentDomain
  dnsServer.setErrorReplyCode(DNSReplyCode::ServerFailure);

The list of supported codes is in DNSServer.h:
Code: Select allenum class DNSReplyCode
{
  NoError = 0,
  FormError = 1,
  ServerFailure = 2,
  NonExistentDomain = 3,
  NotImplemented = 4,
  Refused = 5,
  YXDomain = 6,
  YXRRSet = 7,
  NXRRSet = 8
};

It hadn't occurred to me to play with these because my code was working on IOS, but it looks like calling:
Code: Select alldnsServer.setErrorReplyCode(DNSReplyCode::NoError);

may help with other OSes.

Re: Captive Portal or force all webcalls to ESP8266 AP IP ad

PostPosted: Thu Jun 25, 2015 4:54 pm
by SwiCago
Good find burkmurray...I'll try it as soon as I'm home and give a status update.
But in theory using "*" should never return error, since all domains are considered the APs IP

Re: Captive Portal or force all webcalls to ESP8266 AP IP ad

PostPosted: Thu Jun 25, 2015 5:43 pm
by AndyReischle
Tried CaptiveIntraweb with an android tablet tonight. I first had to fix my code to tolerate totally empty requests to port 80 (no request type, no url, no vars)
I tried returning a http 302 response. This didn't make a difference. Browsing any http address in Chrome redirects to the portal page. Ok. That sort of worked before.
Can anyone describe what the process is like on Android with a proper, working portal?