Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find parameters in Safari on OSX #9

Open
jhoughjr opened this issue May 15, 2018 · 9 comments
Open

Can't find parameters in Safari on OSX #9

jhoughjr opened this issue May 15, 2018 · 9 comments

Comments

@jhoughjr
Copy link

I suspect its the regex, but idk. it does find the params in chrome but then can't find my AP name, possibly due to spaces being replaced with pluses.

@quarterturn
Copy link

quarterturn commented Oct 9, 2018

Confirmed on OSX Safari. Entering an SSID and password then configure button leads to a connection reset on /configure. Refreshing the page returns "Parameters not found"

Checking the ESP8266 filesystem shows there is no .ini file created.

Safari Version 12.0 (13606.2.11) on OSX 10.13.6
Micropython Version esp8266-20180511-v1.9.4

Works fine with Firefox 62.0.3

@tikky
Copy link

tikky commented Jan 15, 2020

I've got the same issue with ESP32. I can see WiFi network and connect to it. Then I can browse from iPhone Safari to 192.168.4.1, but when I want to save password I am receiving "Parameters not found"

On Android phone work as expected

@rftestman1
Copy link

Has this issue been resolved? I cannot set wifi SSID and PW using any browser in iOS. I get the same 'Parameters not found error' as above.

@ColinNg
Copy link
Contributor

ColinNg commented Sep 22, 2020

This is because Safari sends the data in the Request Body, i.e. after the \r\n\r\n that the code uses to detect the end of the sequence. I have gotten it working but there is more testing to do. In the meantime, this should fix it for you:

After this block (i.e. lines 286-290):

            try:
                while "\r\n\r\n" not in request:
                    request += client.recv(512)
            except OSError:
                pass

Add this block (i.e. starting line 291):

            # Handle form data from Safari on macOS and iOS; it sends \r\n\r\nssid=<ssid>&password=<password>
            try:
                request += client.recv(512)
                print("Received form data after \\r\\n\\r\\n(i.e. from Safari on macOS or iOS)")
            except OSError:
                pass

before the original code continues:

            print("Request is: {}".format(request))

@ebolisa
Copy link

ebolisa commented Sep 22, 2020

How about solving special characters like ¡, @, ö, etc which get encoded like %40 for @?
I solved temporarly the issue with the code below. I've not tried ure.encoding = 'utg-8' yet.

ssid = match.group(1).decode("utf-8").replace("%3F", "?").replace("%21", "!").replace("%40", "@")
password = match.group(2).decode("utf-8").replace("%3F", "?").replace("%21", "!").replace("%40", "@")

@ColinNg
Copy link
Contributor

ColinNg commented Sep 22, 2020

How about solving special characters like ¡, @, ö, etc which get encoded like %40 for @?
I solved temporarly the issue with the code below. I've not tried ure.encoding = 'utg-8' yet.

ssid = match.group(1).decode("utf-8").replace("%3F", "?").replace("%21", "!").replace("%40", "@")
password = match.group(2).decode("utf-8").replace("%3F", "?").replace("%21", "!").replace("%40", "@")

Sorry, that's an altogether separate issue, #8

@DanielBustillos
Copy link

DanielBustillos commented May 24, 2022

This is because Safari sends the data in the Request Body, i.e. after the \r\n\r\n that the code uses to detect the end of the sequence. I have gotten it working but there is more testing to do. In the meantime, this should fix it for you:

After this block (i.e. lines 286-290):

            try:
                while "\r\n\r\n" not in request:
                    request += client.recv(512)
            except OSError:
                pass

Add this block (i.e. starting line 291):

            # Handle form data from Safari on macOS and iOS; it sends \r\n\r\nssid=<ssid>&password=<password>
            try:
                request += client.recv(512)
                print("Received form data after \\r\\n\\r\\n(i.e. from Safari on macOS or iOS)")
            except OSError:
                pass

before the original code continues:

            print("Request is: {}".format(request))

This did not work for me, yet. The request includes only the first 7 characters of the password.

Any suggestion?

@ColinNg
Copy link
Contributor

ColinNg commented May 24, 2022

@DanielBustillos Is the 8th character a space, or special character? There seems to be bugs with spaces in SSIDs, so maybe there are bugs with spaces in passwords.

@DanielBustillos
Copy link

DanielBustillos commented May 25, 2022

@DanielBustillos Is the 8th character a space, or special character? There seems to be bugs with spaces in SSIDs, so maybe there are bugs with spaces in passwords.

It. is not, but I was pasting an invisible non utf8 character. Everything is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants