mirko / SonOTA

Flashing Itead Sonoff devices with custom firmware via original OTA mechanism
GNU General Public License v2.0
720 stars 103 forks source link

Getting `"error": 404` and FinalStage SSID Never Comes #21

Closed CoderBlue closed 6 years ago

CoderBlue commented 7 years ago

I'm using a sonoff basic. When I get to step #4, when I'm supposed to connect to FinalStage SSID, FinalStage never comes. The firmware never seems to flash since I am able to continue to use the switch to turn on/off the outlet and I can repeat the first few steps starting the ITEAD server and connecting, etc. Anybody have this problem and any suggestions ? Using the latest commit. Thanks.

thefathefa commented 7 years ago

If you are stuck for a long time with the flashing process, I think it is safe to kill it and power cycle the sonoff. That should solve the finalstage ssid:-)

Once it is power cycled, check if you see a new SSID "sonof-xxxx" being available. If yes, connect to it (np password). You might be forwarded directly to the UI, if not, yes, I believe the IP to use is 192.168.4.1 (you can check the IP you're PC is given when you connect to that SSID).

What I describe worked for me multiple times but it all depends on where exactly you are stuck in the flashing process.

thefathefa commented 7 years ago

@kevinshane check your traces and see if you have a line like this: 2017-09-24 16:10:33,763 (INFO) 200 GET /ota/image_arduino.bin (192.168.4.1) 20500.15ms If you do, it is a good sign, if you don't, then it means the process did not go to the end.

kevinshane commented 7 years ago

hey man @thefathefa after many fails, I finally managed to flash the sonoff touch t1 3gang version... yeay~~~ thanks man, you helped a lot the reason why I stuck in the finalstage mode, is because my network environment is kind of... messy... I have my laptop built in wifi enabled and connected, and also I have my wire network connected too(I think the program is confused by the 2 obtained ip address).. and also.. I have several vmware network connected(which even more confused I think).. so finally I shutdown(complete remove) everything except one wifi from laptop, and this time it works.. ^^ the next challenge is flashing the B1 bulb ^^... I hope someone saw this post and try not to make the same mistake as I did ^^... sonota is awesome finally^^

thefathefa commented 7 years ago

Glad I could help as I received a lot of help earlier on here as well!

10der commented 7 years ago

so, finally issues still here 👎 (

Sending file: /ota/image_user1-0x01000.bin << WEBSOCKET INPUT << { "error": 404, "userAgent": "device", "apikey": "d0698c78-ce33-44bd-8e58-a1d83684940e", "deviceid": "1000063049", "sequence": "1509922074564" }


200 GET /ota/image_user1-0x01000.bin?deviceid=1000063049&ts=1270216262&sign=b41191d084cc78b8f289fd6191b5baae8dcc43da773a
0c75913690395e157b01 (192.168.1.35) 231.31ms
...........................
08-15at commented 7 years ago

@sillyfrog I'm pretty sure that it is not an AP issue. My trials with two different routers, SoftAP on a Mac and an iPhone as Hotspot all failed while using my dev Mac. And when it finally worked with my Sonoff Dual on the Ubuntu-PC the PC was connected to the same AP as the Mac which failed every single time. So I'm still considering a timing issue (the PC I used is probably way too fast someone would buy for personal use), or some software I and maybe others have installed, which interferes. Got some new Sonoffs S20 in my mail, so I'll give them a try on the mac which couldn't flash the Dual. If it fails again, I'll check with another Mac with nearly stock system software. I didn't see any suspicious TCP-Traffic (have some small excerpts of my sniffing (only HTTPS) saved, if someone is interested in). One, maybe crazy idea I have about that issue is, that there could be UDP involved. I can't think why the Sonoff would use UDP except for findings it's servers, but I never sniffed the UDP-Traffic while flashing, so maybe it gets some unexpected UDP-data from my Mac (because of some SW (could be dnsmasq on my dev mac) running) or some other machines on the net broadcasting whatever.....and reacts to that?

sillyfrog commented 7 years ago

Weird, I have received a Dual from @andyfitter that was getting the 404, and it worked fine for me on a Mac and on a Windows machine. If you've tried to the soft AP on a Mac I think that discounts that idea.

I think it is unlikely to be UDP as it does work most of the time for other users with other devices, and the code does nothing with UDP. Most OSs will be sending UDP traffic for various reasons most of the time.

If you do have the issue again and can do a tcpdump with the -w and -s0 options, I can take a look at that and see if there is anything there as well. Things such as TCP window scaling could be causing issues, but all of these are just a guess. As the public and private key is in the repo, using wireshark you can look at the decrypted traffic. It's all very confusing.

Atmannen commented 7 years ago

Hi! I think I have the same issue with a POW. I first tried the standard procedure for windows multiple times but never got to the FinalStage. I then tried with --legacy and saw the 404 error. I have the log at: https://pastebin.com/Qym5ay6h If i reset the POW by pressing the button I get the ITEAD-wifi network. Otherwise nothing. In my router (Unifi USG) I see that ESP_25DB8C is connected (I assume this is the POW).

Hope someone might understand something from the logs! Thanks!

10der commented 7 years ago

Btw, same issue here. Set provision mode OK After: connect - OK Trying to upload 404

And btw 2: I am not cool python developer ;) so, I am wrap (port your code) provision mode and server emulate mode C# code So, provision mode ok After my device succ connected to my c# console web / socket server Succ registered But stopped with same error when I trying to give some foods :) via binary updates :(

ср, 8 нояб. 2017 г. в 00:04, Joakim Arver notifications@github.com:

Hi! I think I have the same issue with a POW. I first tried the standard procedure for windows multiple times but never got to the FinalStage. I then tried with --legacy and saw the 404 error. I have the log at: https://pastebin.com/Qym5ay6h If i reset the POW by pressing the button I get the ITEAD-wifi network. Otherwise nothing. In my router (Unifi USG) I see that ESP_25DB8C is connected (I assume this is the POW).

Hope someone might understand something from the logs! Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mirko/SonOTA/issues/21#issuecomment-342638064, or mute the thread https://github.com/notifications/unsubscribe-auth/AGusco8RSGIe9kIfkmKm5_-ZCVM7PFE8ks5s0NQEgaJpZM4PfDB2 .

10der commented 7 years ago

so. I am still trying to play with my Sonoff dual.

here is some step reproducing the error. 0) turn device into AP mode 1) I am manually from my application connect to IT-XXXX device WIFI 2) I am manually from my application send

request.AddJsonBody(new { version = 4, ssid = "HOME", password = "10derwifi", serverName = "192.168.1.45", port = 8443 });

3) responce OK 4) device automaticaly reboted. 5) start sonota.py python sonota.py --no-prov --serving-host 192.168.1.45 6)

2017-11-10 23:37:49,159: INFO: Platform: win32
2017-11-10 23:37:49,160: INFO: Starting stage2...
2017-11-10 23:37:49,160: INFO: ~~ Starting web server (HTTP port: 8080, HTTPS port 8443)
2017-11-10 23:37:49,163: INFO: ~~ Waiting for device to connect
2017-11-10 23:37:49,190: DEBUG: Current IPs: ['192.168.1.45', '10.8.170.13', '10.10.7.2']
2017-11-10 23:37:49,190: INFO: *** IMPORTANT! ***
2017-11-10 23:37:49,191: INFO: ** AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process.
2017-11-10 23:37:49,191: INFO: ** ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network.
2017-11-10 23:37:49,191: INFO: This server should automatically be allocated the IP address: 192.168.4.2.
2017-11-10 23:37:49,191: INFO: If you have successfully connected to "FinalStage" and this is not the IP Address you were allocated, please ensure no other device has connected, and reboot your Sonoff.
2017-11-10 23:37:56,132: WARNING: 404 GET / (192.168.1.45) 1.00ms
2017-11-10 23:38:09,363: WARNING: 404 POST /inform (192.168.1.49) 0.00ms
2017-11-10 23:38:14,934: DEBUG: << HTTP POST /dispatch/device
2017-11-10 23:38:14,934: DEBUG: >> /dispatch/device
2017-11-10 23:38:14,935: DEBUG: >> {
2017-11-10 23:38:14,935: DEBUG:     "error": 0,
2017-11-10 23:38:14,935: DEBUG:     "reason": "ok",
2017-11-10 23:38:14,935: DEBUG:     "IP": "192.168.1.45",
2017-11-10 23:38:14,935: DEBUG:     "port": 8443
2017-11-10 23:38:14,935: DEBUG: }
2017-11-10 23:38:14,936: INFO: 200 POST /dispatch/device (192.168.1.41) 2.01ms
2017-11-10 23:38:15,051: INFO: 101 GET /api/ws (192.168.1.41) 5.07ms
2017-11-10 23:38:15,051: DEBUG: << WEBSOCKET OPEN
2017-11-10 23:38:15,060: DEBUG: << WEBSOCKET INPUT
2017-11-10 23:38:15,060: DEBUG: << {
2017-11-10 23:38:15,061: DEBUG:     "userAgent": "device",
2017-11-10 23:38:15,061: DEBUG:     "apikey": "c905073b-3fde-4c56-a730-541dec43be54",
2017-11-10 23:38:15,061: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,061: DEBUG:     "action": "register",
2017-11-10 23:38:15,061: DEBUG:     "version": 2,
2017-11-10 23:38:15,062: DEBUG:     "romVersion": "1.2.0",
2017-11-10 23:38:15,062: DEBUG:     "model": "PSB-B04-GL",
2017-11-10 23:38:15,062: DEBUG:     "ts": 744
2017-11-10 23:38:15,062: DEBUG: }
2017-11-10 23:38:15,134: INFO: We are dealing with a PSB-B04-GL model.
2017-11-10 23:38:15,134: DEBUG: ~~~~ register
2017-11-10 23:38:15,134: DEBUG: >> {
2017-11-10 23:38:15,134: DEBUG:     "error": 0,
2017-11-10 23:38:15,134: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,135: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,135: DEBUG:     "config": {
2017-11-10 23:38:15,135: DEBUG:         "hb": 1,
2017-11-10 23:38:15,135: DEBUG:         "hbInterval": 145
2017-11-10 23:38:15,135: DEBUG:     }
2017-11-10 23:38:15,135: DEBUG: }
2017-11-10 23:38:15,144: DEBUG: << WEBSOCKET INPUT
2017-11-10 23:38:15,144: DEBUG: << {
2017-11-10 23:38:15,144: DEBUG:     "userAgent": "device",
2017-11-10 23:38:15,145: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,145: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,145: DEBUG:     "action": "date"
2017-11-10 23:38:15,145: DEBUG: }
2017-11-10 23:38:15,149: DEBUG: ~~~~ date
2017-11-10 23:38:15,149: DEBUG: >> {
2017-11-10 23:38:15,149: DEBUG:     "error": 0,
2017-11-10 23:38:15,149: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,149: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,149: DEBUG:     "date": "2017-11-10T23:38:15.149Z"
2017-11-10 23:38:15,149: DEBUG: }
2017-11-10 23:38:15,150: DEBUG: << WEBSOCKET INPUT
2017-11-10 23:38:15,150: DEBUG: << {
2017-11-10 23:38:15,150: DEBUG:     "userAgent": "device",
2017-11-10 23:38:15,150: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,151: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,151: DEBUG:     "action": "update",
2017-11-10 23:38:15,151: DEBUG:     "params": {
2017-11-10 23:38:15,151: DEBUG:         "switches": [
2017-11-10 23:38:15,151: DEBUG:             {
2017-11-10 23:38:15,151: DEBUG:                 "switch": "off",
2017-11-10 23:38:15,151: DEBUG:                 "outlet": 0
2017-11-10 23:38:15,151: DEBUG:             },
2017-11-10 23:38:15,151: DEBUG:             {
2017-11-10 23:38:15,152: DEBUG:                 "switch": "off",
2017-11-10 23:38:15,152: DEBUG:                 "outlet": 1
2017-11-10 23:38:15,152: DEBUG:             },
2017-11-10 23:38:15,152: DEBUG:             {
2017-11-10 23:38:15,152: DEBUG:                 "switch": "off",
2017-11-10 23:38:15,152: DEBUG:                 "outlet": 2
2017-11-10 23:38:15,152: DEBUG:             },
2017-11-10 23:38:15,153: DEBUG:             {
2017-11-10 23:38:15,156: DEBUG:                 "switch": "off",
2017-11-10 23:38:15,156: DEBUG:                 "outlet": 3
2017-11-10 23:38:15,156: DEBUG:             }
2017-11-10 23:38:15,157: DEBUG:         ],
2017-11-10 23:38:15,157: DEBUG:         "fwVersion": "1.2.0"
2017-11-10 23:38:15,157: DEBUG:     }
2017-11-10 23:38:15,157: DEBUG: }
2017-11-10 23:38:15,160: DEBUG: ~~~~ update
2017-11-10 23:38:15,160: DEBUG: >> {
2017-11-10 23:38:15,160: DEBUG:     "error": 0,
2017-11-10 23:38:15,161: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,161: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40"
2017-11-10 23:38:15,161: DEBUG: }
2017-11-10 23:38:15,161: DEBUG: >> {
2017-11-10 23:38:15,161: DEBUG:     "action": "update",
2017-11-10 23:38:15,161: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,161: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,162: DEBUG:     "userAgent": "app",
2017-11-10 23:38:15,162: DEBUG:     "sequence": "1510349895161",
2017-11-10 23:38:15,162: DEBUG:     "ts": 0,
2017-11-10 23:38:15,162: DEBUG:     "params": {
2017-11-10 23:38:15,162: DEBUG:         "switch": "off"
2017-11-10 23:38:15,162: DEBUG:     },
2017-11-10 23:38:15,162: DEBUG:     "from": "hackepeter"
2017-11-10 23:38:15,162: DEBUG: }
2017-11-10 23:38:15,162: DEBUG: >> {
2017-11-10 23:38:15,163: DEBUG:     "action": "update",
2017-11-10 23:38:15,163: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,163: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,163: DEBUG:     "userAgent": "app",
2017-11-10 23:38:15,163: DEBUG:     "sequence": "1510349895162",
2017-11-10 23:38:15,163: DEBUG:     "ts": 0,
2017-11-10 23:38:15,163: DEBUG:     "params": {
2017-11-10 23:38:15,163: DEBUG:         "switch": "on"
2017-11-10 23:38:15,163: DEBUG:     },
2017-11-10 23:38:15,163: DEBUG:     "from": "hackepeter"
2017-11-10 23:38:15,164: DEBUG: }
2017-11-10 23:38:15,164: DEBUG: >> {
2017-11-10 23:38:15,164: DEBUG:     "action": "update",
2017-11-10 23:38:15,164: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,164: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,164: DEBUG:     "userAgent": "app",
2017-11-10 23:38:15,164: DEBUG:     "sequence": "1510349895164",
2017-11-10 23:38:15,165: DEBUG:     "ts": 0,
2017-11-10 23:38:15,168: DEBUG:     "params": {
2017-11-10 23:38:15,168: DEBUG:         "switch": "off"
2017-11-10 23:38:15,168: DEBUG:     },
2017-11-10 23:38:15,168: DEBUG:     "from": "hackepeter"
2017-11-10 23:38:15,169: DEBUG: }
2017-11-10 23:38:15,169: DEBUG: >> {
2017-11-10 23:38:15,169: DEBUG:     "action": "update",
2017-11-10 23:38:15,169: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,169: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,169: DEBUG:     "userAgent": "app",
2017-11-10 23:38:15,170: DEBUG:     "sequence": "1510349895169",
2017-11-10 23:38:15,170: DEBUG:     "ts": 0,
2017-11-10 23:38:15,170: DEBUG:     "params": {
2017-11-10 23:38:15,170: DEBUG:         "switch": "on"
2017-11-10 23:38:15,170: DEBUG:     },
2017-11-10 23:38:15,170: DEBUG:     "from": "hackepeter"
2017-11-10 23:38:15,170: DEBUG: }
2017-11-10 23:38:15,171: DEBUG: >> {
2017-11-10 23:38:15,171: DEBUG:     "action": "update",
2017-11-10 23:38:15,171: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,171: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,171: DEBUG:     "userAgent": "app",
2017-11-10 23:38:15,171: DEBUG:     "sequence": "1510349895170",
2017-11-10 23:38:15,171: DEBUG:     "ts": 0,
2017-11-10 23:38:15,172: DEBUG:     "params": {
2017-11-10 23:38:15,172: DEBUG:         "switch": "off"
2017-11-10 23:38:15,172: DEBUG:     },
2017-11-10 23:38:15,172: DEBUG:     "from": "hackepeter"
2017-11-10 23:38:15,172: DEBUG: }
2017-11-10 23:38:15,175: DEBUG: >> {
2017-11-10 23:38:15,176: DEBUG:     "action": "upgrade",
2017-11-10 23:38:15,176: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,176: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,176: DEBUG:     "userAgent": "app",
2017-11-10 23:38:15,176: DEBUG:     "sequence": "1510349895175",
2017-11-10 23:38:15,176: DEBUG:     "ts": 0,
2017-11-10 23:38:15,177: DEBUG:     "params": {
2017-11-10 23:38:15,179: DEBUG:         "binList": [
2017-11-10 23:38:15,179: DEBUG:             {
2017-11-10 23:38:15,180: DEBUG:                 "downloadUrl": "http://192.168.1.45:8080/ota/image_user1-0x01000.bin",
2017-11-10 23:38:15,180: DEBUG:                 "digest": "1c467a7cb4058df22046ffbc0312272aed324a74e91b9b39e1bf2aef88eeca8a",
2017-11-10 23:38:15,180: DEBUG:                 "name": "user1.bin"
2017-11-10 23:38:15,180: DEBUG:             },
2017-11-10 23:38:15,180: DEBUG:             {
2017-11-10 23:38:15,181: DEBUG:                 "downloadUrl": "http://192.168.1.45:8080/ota/image_user2-0x81000.bin",
2017-11-10 23:38:15,181: DEBUG:                 "digest": "804e4f4a2316fbcc2c6b46aff53c24b9be252bf3fd8cf3ea2243e4475a052658",
2017-11-10 23:38:15,181: DEBUG:                 "name": "user2.bin"
2017-11-10 23:38:15,181: DEBUG:             }
2017-11-10 23:38:15,181: DEBUG:         ],
2017-11-10 23:38:15,182: DEBUG:         "model": "PSB-B04-GL",
2017-11-10 23:38:15,182: DEBUG:         "version": "23.42.5"
2017-11-10 23:38:15,182: DEBUG:     }
2017-11-10 23:38:15,182: DEBUG: }
2017-11-10 23:38:15,188: DEBUG: << WEBSOCKET INPUT
2017-11-10 23:38:15,190: DEBUG: << {
2017-11-10 23:38:15,190: DEBUG:     "error": 0,
2017-11-10 23:38:15,190: DEBUG:     "userAgent": "device",
2017-11-10 23:38:15,191: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,191: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,191: DEBUG:     "sequence": "1510349895170"
2017-11-10 23:38:15,191: DEBUG: }
2017-11-10 23:38:15,192: DEBUG: ~~~ device acknowledged our action request (seq 1510349895170) with error code 0
2017-11-10 23:38:15,192: DEBUG: << WEBSOCKET INPUT
2017-11-10 23:38:15,192: DEBUG: << {
2017-11-10 23:38:15,193: DEBUG:     "error": 0,
2017-11-10 23:38:15,193: DEBUG:     "userAgent": "device",
2017-11-10 23:38:15,193: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,193: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,193: DEBUG:     "sequence": "1510349895170"
2017-11-10 23:38:15,193: DEBUG: }
2017-11-10 23:38:15,194: DEBUG: ~~~ device acknowledged our action request (seq 1510349895170) with error code 0
2017-11-10 23:38:15,332: DEBUG: Sending file: /ota/image_user1-0x01000.bin
2017-11-10 23:38:15,450: DEBUG: << WEBSOCKET INPUT
2017-11-10 23:38:15,450: DEBUG: << {
2017-11-10 23:38:15,451: DEBUG:     "error": 404,
2017-11-10 23:38:15,451: DEBUG:     "userAgent": "device",
2017-11-10 23:38:15,451: DEBUG:     "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40",
2017-11-10 23:38:15,451: DEBUG:     "deviceid": "1000063049",
2017-11-10 23:38:15,451: DEBUG:     "sequence": "1510349895175"
2017-11-10 23:38:15,452: DEBUG: }
2017-11-10 23:38:15,452: DEBUG: ~~~ device acknowledged our action request (seq 1510349895175) with error code 404
2017-11-10 23:38:15,452: INFO: 200 GET /ota/image_user1-0x01000.bin?deviceid=1000063049&ts=1270216262&sign=b41191d084cc78b8f289fd6191b5baae8dcc43da773a0c75913690395e157b01 (192.168.1.41) 248.63ms
2017-11-10 23:38:31,078: WARNING: 404 POST /inform (192.168.1.40) 1.01ms
2017-11-10 23:38:49,973: INFO: *** IMPORTANT! ***
2017-11-10 23:38:49,973: INFO: ** AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process.
2017-11-10 23:38:49,974: INFO: ** ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network.
2017-11-10 23:38:49,974: INFO: This server should automatically be allocated the IP address: 192.168.4.2.
2017-11-10 23:38:49,974: INFO: If you have successfully connected to "FinalStage" and this is not the IP Address you were allocated, please ensure no other device has connected, and reboot your Sonoff.

bummer! :(

ashmckenzie commented 7 years ago

On my Mac I found deleting disused interfaces helped out with a similar problem..

On Sat., 11 Nov. 2017, 8:45 am Oleg Denisenko, notifications@github.com wrote:

so. I am still trying to play with my Sonoff dual.

here is some step reproducing the error. 0) turn device into AP mode

  1. I am manually from my application connect to IT-XXXX device WIFI
  2. I am manually from my application send

request.AddJsonBody(new { version = 4, ssid = "HOME", password = "10derwifi", serverName = "192.168.1.45", port = 8443 });

  1. responce OK
  2. device automaticaly reboted.
  3. start sonota.py python sonota.py --no-prov --serving-host 192.168.1.45

2017-11-10 23:37:49,159: INFO: Platform: win32 2017-11-10 23:37:49,160: INFO: Starting stage2... 2017-11-10 23:37:49,160: INFO: ~~ Starting web server (HTTP port: 8080, HTTPS port 8443) 2017-11-10 23:37:49,163: INFO: ~~ Waiting for device to connect 2017-11-10 23:37:49,190: DEBUG: Current IPs: ['192.168.1.45', '10.8.170.13', '10.10.7.2'] 2017-11-10 23:37:49,190: INFO: IMPORTANT! 2017-11-10 23:37:49,191: INFO: AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. 2017-11-10 23:37:49,191: INFO: ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. 2017-11-10 23:37:49,191: INFO: This server should automatically be allocated the IP address: 192.168.4.2. 2017-11-10 23:37:49,191: INFO: If you have successfully connected to "FinalStage" and this is not the IP Address you were allocated, please ensure no other device has connected, and reboot your Sonoff. 2017-11-10 23:37:56,132: WARNING: 404 GET / (192.168.1.45) 1.00ms 2017-11-10 23:38:09,363: WARNING: 404 POST /inform (192.168.1.49) 0.00ms 2017-11-10 23:38:14,934: DEBUG: << HTTP POST /dispatch/device 2017-11-10 23:38:14,934: DEBUG: >> /dispatch/device 2017-11-10 23:38:14,935: DEBUG: >> { 2017-11-10 23:38:14,935: DEBUG: "error": 0, 2017-11-10 23:38:14,935: DEBUG: "reason": "ok", 2017-11-10 23:38:14,935: DEBUG: "IP": "192.168.1.45", 2017-11-10 23:38:14,935: DEBUG: "port": 8443 2017-11-10 23:38:14,935: DEBUG: } 2017-11-10 23:38:14,936: INFO: 200 POST /dispatch/device (192.168.1.41) 2.01ms 2017-11-10 23:38:15,051: INFO: 101 GET /api/ws (192.168.1.41) 5.07ms 2017-11-10 23:38:15,051: DEBUG: << WEBSOCKET OPEN 2017-11-10 23:38:15,060: DEBUG: << WEBSOCKET INPUT 2017-11-10 23:38:15,060: DEBUG: << { 2017-11-10 23:38:15,061: DEBUG: "userAgent": "device", 2017-11-10 23:38:15,061: DEBUG: "apikey": "c905073b-3fde-4c56-a730-541dec43be54", 2017-11-10 23:38:15,061: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,061: DEBUG: "action": "register", 2017-11-10 23:38:15,061: DEBUG: "version": 2, 2017-11-10 23:38:15,062: DEBUG: "romVersion": "1.2.0", 2017-11-10 23:38:15,062: DEBUG: "model": "PSB-B04-GL", 2017-11-10 23:38:15,062: DEBUG: "ts": 744 2017-11-10 23:38:15,062: DEBUG: } 2017-11-10 23:38:15,134: INFO: We are dealing with a PSB-B04-GL model. 2017-11-10 23:38:15,134: DEBUG: ~~~~ register 2017-11-10 23:38:15,134: DEBUG: >> { 2017-11-10 23:38:15,134: DEBUG: "error": 0, 2017-11-10 23:38:15,134: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,135: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,135: DEBUG: "config": { 2017-11-10 23:38:15,135: DEBUG: "hb": 1, 2017-11-10 23:38:15,135: DEBUG: "hbInterval": 145 2017-11-10 23:38:15,135: DEBUG: } 2017-11-10 23:38:15,135: DEBUG: } 2017-11-10 23:38:15,144: DEBUG: << WEBSOCKET INPUT 2017-11-10 23:38:15,144: DEBUG: << { 2017-11-10 23:38:15,144: DEBUG: "userAgent": "device", 2017-11-10 23:38:15,145: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,145: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,145: DEBUG: "action": "date" 2017-11-10 23:38:15,145: DEBUG: } 2017-11-10 23:38:15,149: DEBUG: ~~~~ date 2017-11-10 23:38:15,149: DEBUG: >> { 2017-11-10 23:38:15,149: DEBUG: "error": 0, 2017-11-10 23:38:15,149: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,149: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,149: DEBUG: "date": "2017-11-10T23:38:15.149Z" 2017-11-10 23:38:15,149: DEBUG: } 2017-11-10 23:38:15,150: DEBUG: << WEBSOCKET INPUT 2017-11-10 23:38:15,150: DEBUG: << { 2017-11-10 23:38:15,150: DEBUG: "userAgent": "device", 2017-11-10 23:38:15,150: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,151: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,151: DEBUG: "action": "update", 2017-11-10 23:38:15,151: DEBUG: "params": { 2017-11-10 23:38:15,151: DEBUG: "switches": [ 2017-11-10 23:38:15,151: DEBUG: { 2017-11-10 23:38:15,151: DEBUG: "switch": "off", 2017-11-10 23:38:15,151: DEBUG: "outlet": 0 2017-11-10 23:38:15,151: DEBUG: }, 2017-11-10 23:38:15,151: DEBUG: { 2017-11-10 23:38:15,152: DEBUG: "switch": "off", 2017-11-10 23:38:15,152: DEBUG: "outlet": 1 2017-11-10 23:38:15,152: DEBUG: }, 2017-11-10 23:38:15,152: DEBUG: { 2017-11-10 23:38:15,152: DEBUG: "switch": "off", 2017-11-10 23:38:15,152: DEBUG: "outlet": 2 2017-11-10 23:38:15,152: DEBUG: }, 2017-11-10 23:38:15,153: DEBUG: { 2017-11-10 23:38:15,156: DEBUG: "switch": "off", 2017-11-10 23:38:15,156: DEBUG: "outlet": 3 2017-11-10 23:38:15,156: DEBUG: } 2017-11-10 23:38:15,157: DEBUG: ], 2017-11-10 23:38:15,157: DEBUG: "fwVersion": "1.2.0" 2017-11-10 23:38:15,157: DEBUG: } 2017-11-10 23:38:15,157: DEBUG: } 2017-11-10 23:38:15,160: DEBUG: ~~~~ update 2017-11-10 23:38:15,160: DEBUG: >> { 2017-11-10 23:38:15,160: DEBUG: "error": 0, 2017-11-10 23:38:15,161: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,161: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40" 2017-11-10 23:38:15,161: DEBUG: } 2017-11-10 23:38:15,161: DEBUG: >> { 2017-11-10 23:38:15,161: DEBUG: "action": "update", 2017-11-10 23:38:15,161: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,161: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,162: DEBUG: "userAgent": "app", 2017-11-10 23:38:15,162: DEBUG: "sequence": "1510349895161", 2017-11-10 23:38:15,162: DEBUG: "ts": 0, 2017-11-10 23:38:15,162: DEBUG: "params": { 2017-11-10 23:38:15,162: DEBUG: "switch": "off" 2017-11-10 23:38:15,162: DEBUG: }, 2017-11-10 23:38:15,162: DEBUG: "from": "hackepeter" 2017-11-10 23:38:15,162: DEBUG: } 2017-11-10 23:38:15,162: DEBUG: >> { 2017-11-10 23:38:15,163: DEBUG: "action": "update", 2017-11-10 23:38:15,163: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,163: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,163: DEBUG: "userAgent": "app", 2017-11-10 23:38:15,163: DEBUG: "sequence": "1510349895162", 2017-11-10 23:38:15,163: DEBUG: "ts": 0, 2017-11-10 23:38:15,163: DEBUG: "params": { 2017-11-10 23:38:15,163: DEBUG: "switch": "on" 2017-11-10 23:38:15,163: DEBUG: }, 2017-11-10 23:38:15,163: DEBUG: "from": "hackepeter" 2017-11-10 23:38:15,164: DEBUG: } 2017-11-10 23:38:15,164: DEBUG: >> { 2017-11-10 23:38:15,164: DEBUG: "action": "update", 2017-11-10 23:38:15,164: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,164: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,164: DEBUG: "userAgent": "app", 2017-11-10 23:38:15,164: DEBUG: "sequence": "1510349895164", 2017-11-10 23:38:15,165: DEBUG: "ts": 0, 2017-11-10 23:38:15,168: DEBUG: "params": { 2017-11-10 23:38:15,168: DEBUG: "switch": "off" 2017-11-10 23:38:15,168: DEBUG: }, 2017-11-10 23:38:15,168: DEBUG: "from": "hackepeter" 2017-11-10 23:38:15,169: DEBUG: } 2017-11-10 23:38:15,169: DEBUG: >> { 2017-11-10 23:38:15,169: DEBUG: "action": "update", 2017-11-10 23:38:15,169: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,169: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,169: DEBUG: "userAgent": "app", 2017-11-10 23:38:15,170: DEBUG: "sequence": "1510349895169", 2017-11-10 23:38:15,170: DEBUG: "ts": 0, 2017-11-10 23:38:15,170: DEBUG: "params": { 2017-11-10 23:38:15,170: DEBUG: "switch": "on" 2017-11-10 23:38:15,170: DEBUG: }, 2017-11-10 23:38:15,170: DEBUG: "from": "hackepeter" 2017-11-10 23:38:15,170: DEBUG: } 2017-11-10 23:38:15,171: DEBUG: >> { 2017-11-10 23:38:15,171: DEBUG: "action": "update", 2017-11-10 23:38:15,171: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,171: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,171: DEBUG: "userAgent": "app", 2017-11-10 23:38:15,171: DEBUG: "sequence": "1510349895170", 2017-11-10 23:38:15,171: DEBUG: "ts": 0, 2017-11-10 23:38:15,172: DEBUG: "params": { 2017-11-10 23:38:15,172: DEBUG: "switch": "off" 2017-11-10 23:38:15,172: DEBUG: }, 2017-11-10 23:38:15,172: DEBUG: "from": "hackepeter" 2017-11-10 23:38:15,172: DEBUG: } 2017-11-10 23:38:15,175: DEBUG: >> { 2017-11-10 23:38:15,176: DEBUG: "action": "upgrade", 2017-11-10 23:38:15,176: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,176: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,176: DEBUG: "userAgent": "app", 2017-11-10 23:38:15,176: DEBUG: "sequence": "1510349895175", 2017-11-10 23:38:15,176: DEBUG: "ts": 0, 2017-11-10 23:38:15,177: DEBUG: "params": { 2017-11-10 23:38:15,179: DEBUG: "binList": [ 2017-11-10 23:38:15,179: DEBUG: { 2017-11-10 23:38:15,180: DEBUG: "downloadUrl": "http://192.168.1.45:8080/ota/image_user1-0x01000.bin", 2017-11-10 23:38:15,180: DEBUG: "digest": "1c467a7cb4058df22046ffbc0312272aed324a74e91b9b39e1bf2aef88eeca8a", 2017-11-10 23:38:15,180: DEBUG: "name": "user1.bin" 2017-11-10 23:38:15,180: DEBUG: }, 2017-11-10 23:38:15,180: DEBUG: { 2017-11-10 23:38:15,181: DEBUG: "downloadUrl": "http://192.168.1.45:8080/ota/image_user2-0x81000.bin", 2017-11-10 23:38:15,181: DEBUG: "digest": "804e4f4a2316fbcc2c6b46aff53c24b9be252bf3fd8cf3ea2243e4475a052658", 2017-11-10 23:38:15,181: DEBUG: "name": "user2.bin" 2017-11-10 23:38:15,181: DEBUG: } 2017-11-10 23:38:15,181: DEBUG: ], 2017-11-10 23:38:15,182: DEBUG: "model": "PSB-B04-GL", 2017-11-10 23:38:15,182: DEBUG: "version": "23.42.5" 2017-11-10 23:38:15,182: DEBUG: } 2017-11-10 23:38:15,182: DEBUG: } 2017-11-10 23:38:15,188: DEBUG: << WEBSOCKET INPUT 2017-11-10 23:38:15,190: DEBUG: << { 2017-11-10 23:38:15,190: DEBUG: "error": 0, 2017-11-10 23:38:15,190: DEBUG: "userAgent": "device", 2017-11-10 23:38:15,191: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,191: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,191: DEBUG: "sequence": "1510349895170" 2017-11-10 23:38:15,191: DEBUG: } 2017-11-10 23:38:15,192: DEBUG: ~~~ device acknowledged our action request (seq 1510349895170) with error code 0 2017-11-10 23:38:15,192: DEBUG: << WEBSOCKET INPUT 2017-11-10 23:38:15,192: DEBUG: << { 2017-11-10 23:38:15,193: DEBUG: "error": 0, 2017-11-10 23:38:15,193: DEBUG: "userAgent": "device", 2017-11-10 23:38:15,193: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,193: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,193: DEBUG: "sequence": "1510349895170" 2017-11-10 23:38:15,193: DEBUG: } 2017-11-10 23:38:15,194: DEBUG: ~~~ device acknowledged our action request (seq 1510349895170) with error code 0 2017-11-10 23:38:15,332: DEBUG: Sending file: /ota/image_user1-0x01000.bin 2017-11-10 23:38:15,450: DEBUG: << WEBSOCKET INPUT 2017-11-10 23:38:15,450: DEBUG: << { 2017-11-10 23:38:15,451: DEBUG: "error": 404, 2017-11-10 23:38:15,451: DEBUG: "userAgent": "device", 2017-11-10 23:38:15,451: DEBUG: "apikey": "95532a43-3e52-454f-b7c8-d87c6f311f40", 2017-11-10 23:38:15,451: DEBUG: "deviceid": "1000063049", 2017-11-10 23:38:15,451: DEBUG: "sequence": "1510349895175" 2017-11-10 23:38:15,452: DEBUG: } 2017-11-10 23:38:15,452: DEBUG: ~~~ device acknowledged our action request (seq 1510349895175) with error code 404 2017-11-10 23:38:15,452: INFO: 200 GET /ota/image_user1-0x01000.bin?deviceid=1000063049&ts=1270216262&sign=b41191d084cc78b8f289fd6191b5baae8dcc43da773a0c75913690395e157b01 (192.168.1.41) 248.63ms 2017-11-10 23:38:31,078: WARNING: 404 POST /inform (192.168.1.40) 1.01ms 2017-11-10 23:38:49,973: INFO: IMPORTANT! 2017-11-10 23:38:49,973: INFO: AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. 2017-11-10 23:38:49,974: INFO: ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. 2017-11-10 23:38:49,974: INFO: This server should automatically be allocated the IP address: 192.168.4.2. 2017-11-10 23:38:49,974: INFO: If you have successfully connected to "FinalStage" and this is not the IP Address you were allocated, please ensure no other device has connected, and reboot your Sonoff.

bummer! :(

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mirko/SonOTA/issues/21#issuecomment-343595745, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAlNRCEEC-Ww3qgOjPSPtpwh-adv3Naks5s1MQVgaJpZM4PfDB2 .

10der commented 7 years ago

@ashmckenzie how the response from ESP (sonoff) 404 can concern with PC interfaces?

sillyfrog commented 7 years ago

@ashmckenzie Can you outline what you did? Were you getting the 404 response above, then removing interfaces on your Mac fixed it?

If someone that can repeat the problem take a traffic dump, that would be great. On a Mac or Linux, something like the following should work:

  1. Run ./sonota.py
  2. Once the questions have been answered, and just before selecting the ITEAD-#### interface, run this command: sudo tcpdump -i en0 -n -s0 -v -w traffic.pcap (Note: you may have to change the interface en0 to match your WiFi interface).
  3. Change to the ITEAD-#### network (ensure tcpdump continues to run, if it drops out, restart it ASAP)

When complete, and you have the 404 error again, post both the traffic.pcap and your debug_########.log files - that may give me something further to work with.

Cheers.

sillyfrog commented 7 years ago

@10der Thanks for this, do you have the corresponding debug_########.log file as well? That will help me match up the packets. Cheers!

10der commented 7 years ago

debug_1510384423.log

10der commented 7 years ago

please ignore all POST /inform requests in log file - it's my ubiquiti SPAM

sillyfrog commented 7 years ago

@10der Thanks for that, I have been able to replicate! (At least artificiality)

Can you (or anyone) please try the latest build and let me know if it works? If it appears to start downloading but then stops and you get a 404 again, on line 143 there is a sleep for 0.1 seconds, try increasing to 1 second, and see if that helps.

Cheers.

10der commented 7 years ago

lol! (see pic) you stopped me for some interesting moment :) xevgpvmvkz 1

5 mins.... I am disappointed with OTA update and start to sold pins for Arduino IDE flashing... Ok. just 5 mins - I'll close the box :)

10der commented 7 years ago

debug_1510404245.log

10der commented 7 years ago

Do you have any idea what next?

sillyfrog commented 7 years ago

@10der Would you mind trying again with the one second delay mentioned above, if you can also get a traffic dump that would be good (I only need port 8080).

10der commented 7 years ago
            self.flush()
            #yield gen.sleep(0.1)
            yield gen.sleep(1) # by tender

nothing changed :(

sillyfrog commented 7 years ago

Bummer, if you can take a traffic dump again that will give me something to look at in the morning. And The corresponding log will also help.

The issue appears to be related to TCP offloading, based on the traffic dump. I’m hoping what I have done has stopped that, but I’m not 100% sure.

10der commented 7 years ago

btw, 1) 1 sec delay not works 2) i am paying with chunk size... also doesnot work 3) IMHO root issue not in delay. We got error on first chunk....

X - simple print on chunk write

Slow Sending file: /ota/image_user1-0x01000.bin
X
<< WEBSOCKET INPUT
<< {
    "error": 404,
    "userAgent": "device",
    "apikey": "8f92535d-3902-4c58-a16e-33d11115bfbd",
    "deviceid": "1000063049",
    "sequence": "1510405241468"
}
~~~ device acknowledged our action request (seq 1510405241468) with error code 404
.X
X
10der commented 7 years ago

SonOTA-last.zip

sillyfrog commented 7 years ago

@10der Thanks again for helping me sort this.

I think I had a bug with the forced flush (no yield), also, the I didn't take into account the headers for the first packet. The latest build now fixes this (and hopefully everything else). If you (or anyone having this issue) have a chance to test this out, that would be great.

Cheers.

10der commented 7 years ago
~~~ device acknowledged our action request (seq 1510438146098) with error code 404
Uncaught exception GET /ota/image_user1-0x01000.bin?deviceid=1000063049&ts=1191391529&sign=c46f017ac9373d16990c2c351e89
1a70ae47a23e69ae63b373392acc48aa817 (192.168.1.41)
HTTPServerRequest(protocol='http', host='dl.itead.cn', method='GET', uri='/ota/image_user1-0x01000.bin?deviceid=1000063
49&ts=1191391529&sign=c46f017ac9373d16990c2c351e8991a70ae47a23e69ae63b373392acc48aa817', version='HTTP/1.1', remote_ip=
192.168.1.41', headers={'Host': 'dl.itead.cn', 'User-Agent': 'itead-device'})
Traceback (most recent call last):
  File "C:\Users\olegd\AppData\Roaming\Python\Python36\site-packages\tornado\web.py", line 1511, in _execute
    result = yield result
  File "C:\Users\olegd\AppData\Roaming\Python\Python36\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "C:\Users\olegd\AppData\Roaming\Python\Python36\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "C:\Users\olegd\AppData\Roaming\Python\Python36\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "sonota.py", line 146, in get
    yield self.flush()
  File "C:\Users\olegd\AppData\Roaming\Python\Python36\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "C:\Users\olegd\AppData\Roaming\Python\Python36\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
tornado.iostream.StreamClosedError: Stream is closed
Cannot send error response after headers written
200 GET /ota/image_user1-0x01000.bin?deviceid=1000063049&ts=1191391529&sign=c46f017ac9373d16990c2c351e8991a70ae47a23e69
e63b373392acc48aa817 (192.168.1.41) 338.31ms
.404 POST /inform (192.168.1.40) 1.03ms
......
10der commented 7 years ago

and :) 404

2017-11-12 00:09:06,116: DEBUG: ~~~ device acknowledged our action request (seq 1510438146095) with error code 0
2017-11-12 00:09:06,133: DEBUG: Slow Sending file: /ota/image_user1-0x01000.bin (This may take several minutes)
2017-11-12 00:09:06,194: DEBUG: << WEBSOCKET INPUT
2017-11-12 00:09:06,194: DEBUG: << {
2017-11-12 00:09:06,195: DEBUG:     "error": 404,
2017-11-12 00:09:06,195: DEBUG:     "userAgent": "device",
2017-11-12 00:09:06,195: DEBUG:     "apikey": "f6a577d8-36b9-41f7-9a3a-5433c4ebb33e",
2017-11-12 00:09:06,196: DEBUG:     "deviceid": "1000063049",
2017-11-12 00:09:06,196: DEBUG:     "sequence": "1510438146098"
2017-11-12 00:09:06,196: DEBUG: }
10der commented 7 years ago

debug_1510438142.log

10der commented 7 years ago

as I can see Sonoff denied our first packet (chunk == 10) and close stream - bye bye...

10der commented 7 years ago

yeah... I wish magic was real, you know.

sillyfrog commented 7 years ago

@10der O man! This is doing my head in! My test device is also a Dual. Have you tried updating using the eWeLink app, then using this? I think you have one version older than my one (v1.3.0).

My only other idea which I'll post once I have looked at the traffic is to emulate the ITEAD servers headers more closely (as it's dying on the first packet).

10der commented 7 years ago

1) before I start to SonOTA project I was updated my device on latest version 2) now I put to startup my local ip,address if possible can you provide me real IP or domain for eWeLink OTA server... I’ll reset this value via own app

Thank you

sillyfrog commented 7 years ago

If you press and hold the button for 7 seconds, that will reset it, and you can then connect via your phone and configure using the eWeLink app rather than SonOTA.

10der commented 7 years ago

Thank you so much. I am going to bed now :) Have a nice day!

sillyfrog commented 7 years ago

@10der I have just pushed a change with more headers. Something else to try at least.

oglodyte commented 7 years ago

@sillyfrog Last commit worked for my Sonoff RF. Yesterday was getting 404 error. Thank you so much!

10der commented 7 years ago

ааааааааааааа! w958fqhjup 1

10der commented 7 years ago

now no final update

looping on .....Current IPs: ['192.168.1.45', '192.168.4.2'] The "FinalStage" SSID will disappear when the device has been fully flashed and image_arduino.bin has been installed Once "FinalStage" has gone away, you can stop this program ..............................

sillyfrog commented 7 years ago

@10der So it's getting further which is great! So you have been able to connect to the FinalStage SSID? Can you check a tcpdump again on port 8080 and see if it's trying to connect? (It tries every minute or so). I regularly see issues with Firewalls on this step (but normally Windows, not Linux).

10der commented 7 years ago

Sir, can you add this file to FAQ (who use W10 etc)? untitled

10der commented 7 years ago

another question: donation?

10der commented 7 years ago

so. after final3 device not connected to network!

Pinging 192.168.1.41 with 32 bytes of data: Reply from 192.168.1.45: Destination host unreachable. Reply from 192.168.1.45: Destination host unreachable. Reply from 192.168.1.45: Destination host unreachable. Reply from 192.168.1.45: Destination host unreachable.

Ping statistics for 192.168.1.41: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

but... thank you!

see you!

sillyfrog commented 7 years ago

@10der To confirm, it worked and you got past the FinalStage SSID?

The default Sonoff-Tasmota does not have an AP (and it has no config), see https://github.com/mirko/SonOTA/#running for more info. (I'm thinking about changing the default binary to broadcast an AP to simplify this, but wanted to get this mega issue sorted - which is looking close! :) )

10der commented 7 years ago

To confirm, it worked and you got past the FinalStage SSID? yep!

10der commented 7 years ago

The default Sonoff-Tasmota does not have an AP (and it has no config), see ok! but button long press now doesn't work and i can't switch device to OTA mode again. crazy!

10der commented 7 years ago

just FYI


 ets Jan  8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
⸮
00:00:00 Project sonoff Sonoff (Topic sonoff, Fallback DVES_9FA90B, GroupTopic sonoffs) Version 5.8.0
00:00:00 WIF: Connecting to AP1 indebuurt1 in mode 11N as sonoff-2315...
00:00:07 WIF: Connect failed as AP cannot be reached
00:00:07 WIF: Connecting to AP2 indebuurt2 in mode 11N as sonoff-2315...
00:00:14 WIF: Connect failed as AP cannot be reached
00:00:14 WIF: WPSConfigactive for 1 minute

read RTFM... :)

sillyfrog commented 7 years ago

@everyone The latest build has the new way of serving files as an option. So if you get the 404 error, please try with the --slowstream argument when running.

andyfitter commented 7 years ago

That’s fantastic news. How does it fit with the fact that it always worked for you but not for others? Maybe your LAN characteristics are different - slowing down the transfer?

On 12 Nov 2017, at 23:14, sillyfrog notifications@github.com wrote:

@everyone The latest build has the new way of serving files as an option. So if you get the 404 error, please try with the --slowstream argument when running.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Atmannen commented 7 years ago

@sillyfrog Tried with two different wifi-dongles on my W10 computer. FinalStage does still not show up. Sonoff POW is the one I am using.

https://pastebin.com/UB5t9vhD