itead / Sonoff_Devices_DIY_Tools

BSD 3-Clause "New" or "Revised" License
548 stars 168 forks source link

Can't switch to DIY if the previously programmed SSID is not reachable #90

Open raffaeler opened 3 years ago

raffaeler commented 3 years ago

Firmware version: 3.5 After testing the devices for a long time I believe to have found a bug. The procedure to enter 'compatibility mode' is:

Bug symptom: Sometimes the page cannot be reach and the device simply refuses the connection to that web page

Cause: if the previously programmed SSID/password cannot be reach, the device does not show the html page.

Workaround I re-programmed the device to join the eWeLink network using an available WiFi. Then I repeated all the steps above and finally the web page can be reached.

I could verify this behavior on multiple devices, with different SSIDs, access points and smartphones/PCs.

Additional note: In previos firmware versions, the password should not contain special characters but just numbers and letters. This may prevent the device from connecting to the WiFi.

dennisvandenende commented 3 years ago

Agree, i did setup the wifi on 10.10.7.1 too. Then my device showed up in the router but i couldnt access it. Not with ARC not with browser. So i wanted to repeat the wifi settings but i can connect to the ITEAD network but the page will not open. Its nuts that its all that difficult suddenly. The old versions with the pins where a piece cake.

@raffaeler how did yiu re-programmed the device? I m looking for something like a hard reset or something. Do i need to get soldering?

raffaeler commented 3 years ago

@dennisvandenende I updated the firmware using eWeLink. Now I am still on 3.5 and not sure whether upgrading or not. When you reflash the firmware with another version, the device is factory reset as well.

The point of this thread is that you can't access the DIY page if the old SSID (the one you used with eWeLink) is not available anymore. I could repro multiple times the issue and it is very annoying.

I also hope they can simplify the procedure because it is way too complicated.

dennisvandenende commented 3 years ago

@raffaeler i do conform the problem. I asked you because maybe the problem is more than just the page not reacahable because i cannot reflash via eWelink. But you seem to be able too. i rest my case

raffaeler commented 3 years ago

@dennisvandenende I confirm I can always go back into eWelink mode. To be clear, the eWelink mode is a sort of "reset to defaults" and you should always be able to access it:

This is enough for eWeLink to find the device using the "Quick pairing mode". If you can't find the device, continue with the following points:

Important things to remember:

HTH

dennisvandenende commented 3 years ago

yeah doesnt work for me. after i did this once and changed the wifi data i cant access it in any way. i added the old fashioned pins, flashed it with tasmota and finished in abour 3 minutes. i tried 4!! hours yesterday.

no flash by air for me... thx though

f0ff886f commented 3 years ago

Thank you for this thread, it explained why my brand new Basic R3's would never respond on 10.10.7.1 with the DIY web server. I had to connect eweLink, connect the switch to my WiFi network, and then I could reset it twice and get into DIY mode without issue.

f0ff886f commented 3 years ago

I found I needed to offer the dl.itead.cn domain for the flash to work on my PC using Caddy. This was the most bizarre thing in the world.

In short, I have a Caddyfile (old Caddy, not the new one) with the following config (everything is in my internal network):

# BANK, INTERNAL
http://bank:80, http://10.0.0.11:80, http://dl.itead.cn:80 {
        tls off
        root /srv/home
}

I don't control that domain at all. With that domain the config, I was able to flash with the curl command from this thread: https://github.com/itead/Sonoff_Devices_DIY_Tools/issues/95#issuecomment-723588593

curl http://10.0.0.162:8081/zeroconf/ota_flash -XPOST --data '{"deviceid":"1000b8c61","data":{"downloadUrl": "http://10.0.0.11/tasmota-lite.bin", "sha256sum": "b8a16f18a018bd6233170ce28a625508c38770d9d8ef195c7afa50f914c4ac9c"} }'

I watched traffic with tcpdump and saw the range of bytes requested from Caddy.

If I didn't have that dl.itead.cn host declaration (don't ask me how this would work, maybe there is some HTTP header that says "I want the dl.itead.cn site" and things like Apache / nginx ignore it but Caddy respects it, I would get endless spam in my Caddy logs:

Nov 08 15:56:53 bank caddy[3070669]: 2020/11/08 15:56:53 [INFO] dl.itead.cn - No such site at :80 (Remote: 10.0.0.162, Referer: )

Hope this helps someone else in the same situation. Finally got Tasmota on my Basic R3 via OTA flash with the help of both of these threads.