-
Notifications
You must be signed in to change notification settings - Fork 308
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
CORS problem on Apple devices #48
Comments
The Web UI is not platform dependant, it should work on every modern browser. However, it makes use of very recent APIs like the fetch API which maybe is not implemented on Apple devices. I will update the code to polyfill these recent features. |
What version of Chrome did you try? |
Safari does not work, but Chrome >= 42 works. I still have added a polyfill just in case, |
I used Chrome on iOS, 49.0.2623.73. |
So you open Chrome 49, go to http://marvinroger.github.io/homie-esp8266 (no https), connect to the Wi-Fi network spawned by the ESP8266, and nothing happens? |
Trying it today, it's different on every browser. I suspect the polyfill update to the configurator changed things. Prior to today, I loaded http://marvinroger.github.io/homie-esp8266 (no https), connect to the Wi-Fi network spawned by the ESP8266, and all clients sat at the "waiting for device" page. Today, I loaded http://marvinroger.github.io/homie-esp8266 (no https or local zip download of it), connect to the Wi-Fi network spawned by the ESP8266, and all clients (OS X safari, iOS safari and iOS chrome) load the homie, let me progress through the web forms and then it fails to write configuration in the last step. I have been working to compile the previous version of the configurator to recreate yesterdays result but my npm seems upset. I don't know any javascript. Further note, so I stuck a USB wifi on my Linux box with chrome 47 go to http://marvinroger.github.io/homie-esp8266 (no https), connect to the Wi-Fi network spawned by the ESP8266 and it all works from there. |
There was an issue with the last step, could you please retry with the latest 1.3.0 release? |
Retried, same result. Tried once with safari on iOS also, same result. |
Are you using v1.3.0 on the ESP8266? If yes, could you please send here the configuration you are using? Just change the sensitive data with random data. ;) |
Yes, I downloaded the latest homie-esp8266-master (library.properties says it is 1.3, I also deleted 1.2). Config attached, this should be indicative of what I set in the web interface. |
This is not normal, if the CORS request is triggered from your browser, then it should also, once the response is received, send the configuration to the device. It seems like this is an OS-related bug or something, I don't have issues on any Android phones, Windows and Linux computers... |
I am having the same problem. The Web UI doesnt connect, the App also behaves the same. For Web UI i tried http link and local downloaded one. Chrome version: 51 & IE 8 . While ESP is coming up in configuration mode i am seeing the AP name as ESP-xxxxxx instead of Homie-xxxxxxxx to which i am able to connect without any passwd and look at properties. Is this causing the JSON PUT to fail or the Web UI not getting connected? need help to get this exciting stuff working please |
@sundariitm what version are you using? |
It is a NodeMCU (0.9) ESP-12 module as it reads in the Arduino. I have used this module in earlier projects and is known working. For the version of homie i took the latest 1.5.0 that I got from Arduino library manager |
From the Arduino library manager? I did not know it was even available there! So you use the Arduino IDE, not PlatformIO? |
Right.. I am not familiar with PlatformIO :) |
I've never seen such a behavior... What esp8266/Arduino version are you using? 2.2.0? 2.3.0? Can you please provide your sketch, too? |
I dont know what really happened. I just reflashed the stable FW into NodeMcu and now the configuration is through. thank you for follow-up... the stuff you built is awesome and a good starting point for my project |
@sundariitm @AndrewDonaldson On the devices on which the request fail in the last step, could you please open the inspector (like F12 on Chrome), and in the Network tab you should have an OPTION request to |
the issue got fixed and i am unable to reproduce it now.. everything works On Sat, Sep 3, 2016 at 11:30 PM, Marvin Roger notifications@github.com
|
Upgraded to Homie 1.5, updated my program for the new API, tested etc. Then reset into Configuration mode and tested from OSX. It failed on the web config again. I'm no web guy, so it took me a while to find the headers in Safari 9.1.3 (latest) on OSX. Screenshot attached, it didn't lend itself to cut and paste as far as I can see. Apologies if there was a better way to do this. It wasn't obvious how to do this on iOS, likely the fault is the same as OSX though. |
Can you try replacing in const char PROGMEM_CONFIG_CORS[] PROGMEM = "HTTP/1.1 204 No Content\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: PUT\r\nAccess-Control-Allow-Headers: Content-Type, Origin, Referer, User-Agent\r\n\r\n"; If it still does not work, could you please also send a screenshot of the other |
I have no idea of what's going on... I changed the HTTP library for the new to-be-released configurator for the v2. Maybe it will help to solve this, although I am not convinced about that. This won't be a blocking issue for the v2 anymore though, as I don't know what I can do to solve this! |
Current |
Does not happen on macOS Sierra with Chrome. Look like they got this fixed. For people who see this: there's a CORS bug affecting some Apple devices. Newest releases of Apple OSes fix this, but we cannot do anything to fix Apple issues. Please use another devices if you are affected. |
I have been unable to get the Web UI to connect. I now believe it only works from an Android device ( I can't prove this, I don't own one). I tried safari and chrome on iOS and safari on OSX with no luck.
If I'm correct, can you please update the wiki to indicate that the Web UI / app only works from Android?
The text was updated successfully, but these errors were encountered: