-->
Page 4 of 5

Re: Start up an AP if unable to reconnect to last network

PostPosted: Mon Jan 18, 2016 8:41 am
by kgkg2222
hey i want to do same thing as you bt no succsses yet.
have you got something to do this kind of progran

Re: Start up an AP if unable to reconnect to last network

PostPosted: Wed Feb 03, 2016 4:02 pm
by rwkiii
This solution seems to be very elegant with the exception that it doesn't work on iPhones/Safari. Of course, all I get is a blank white page on my iPhone. There are online iPhone simulators which would probably show the same symptom.

Has anyone coded a solution for this problem?

Re: Start up an AP if unable to reconnect to last network

PostPosted: Wed Feb 03, 2016 5:08 pm
by rwkiii
andrew melvin wrote:Your code also does not work for apple browsers... I figured out after a huge amount of head scratching why this it... it is true for safari, and browsers on iPad and phone. I kind of think having it work is fairly important...

what i noticed is that for POST requests... apple browsers send the first POST request, but it is empty... the second POST request contains nothing but the data, no headers... this is different from chrome and firefox where the payload is within the first POST request. I used a variable that was made true to scan the second POST request if the first one failed the string match!


Andrew, I know others have tugged at you as well - but I wondered if you are able to show how you overcome the Safari double POST issue. I've been trying to figure out a solution but not making any progress.

Thank you either way!

Re: Start up an AP if unable to reconnect to last network

PostPosted: Wed Jan 18, 2017 11:39 am
by rfahey
Resurrecting an old thread because I didn't see a solution posted...

The issue seems to be a lack of header information sent in the request. Safari is very strict about the content you send, whereas Chrome (and most browsers for that matter) will kind of "fake it" if they don't receive exactly the correct information that they're looking for.

So to get this to work in Safari, just make sure to send a header before your page buffer:

client:send("HTTP/1.1 200 OK\r\n");
client:send("Content-type: text/html\r\n");
client:send("Connection: close\r\n\r\n");

HTH