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.

sillyfrog commented 7 years ago

@thefathefa Yes, power cycle. That's correct re the button, this is now running the Espressif2Arduino firmware, which does not do anything with the button etc. It's entire purpose is to get things ready and install the image_arduino.bin image.

thefathefa commented 7 years ago

ok, I got it, it worked fine.

Bear wit me but I just realized i still had several problems:

It might have worked without DOUT-mode, difficult to say, now... All is good. I have 5 more POW and 2 Basic on their way, I will have the opportunity to check that I am able to make it work again :-)

Thanks a lot for your help.

filhome commented 7 years ago

Hi All ! I have a Sonoff 4CH. After an upgrade with EWeLink (2.0.1) and DOUT-mode branch, it works. Thanks !

sillyfrog commented 7 years ago

Given the positive responses, I have merged the changes into master and will close this ticket. If anyone does have further issues please open a new issue.

Thanks for everyone's feedback to help get this sorted.

08-15at commented 7 years ago

@sillyfrog,

sorry, but bad news. New DOUT version works fine on Sonoff Basic (got some which were backordered at banggood yesterday, so theses could be pretty actual models), but I still get the 404 error on the Sonoff Dual. Unfortunately the Dual keeps messing up. As the same setup works for the Basic module, there must be still be something different. As my Dual is at least 2 month older than the Basics, I tried upgrading the Dual firmware from 1.1.0 to 1.2.0, but no change. On the Dual there is also no relay switching before upgrade (but I think this is to a missing parameter, which I already tried to implement, but can't find it now).

sillyfrog commented 7 years ago

@08-15at can you post the output please with the last way build (everything pushed today)? Keen to try and figure it out (I have a Dual as well that worked, so it should be possible). Cheers.

davorf commented 7 years ago

Hello!

After updating Sonoff Basic from 1.5.2 to 1.5.5 and Sonoff Touch from 1.5.2 to 1.6.1 I was able to flash it using master branch (not DOUT), and master branch I've had was cloned before changes from DOUT branch were merged. Flashing Sonoff Basic went exactly as described in readme, but after flashing Sonoff Touch, FinalStage AP didn't disappear. I've connected to Sonoff AP manually, configured it, and after some time, FinalStage AP disappeared, and switch is working properly.

Best regards, Davor

08-15at commented 7 years ago

@sillyfrog, sorry just got back to the device today

As you can see in second log (code from saturday ), I tried to add "outlet" to the relay switching code, but this makes no difference. Error stays the same, regardless if this is in the code or not. Just thought that so I'd at least hear one relay click, which didn't happen. Here is the output log with the files without changes I downloaded right now: ~~ Provisioning completed Starting stage2... The IP address of (10.0.0.9) is not assigned to any interface on this machine. Please change WiFi network to router135 and make sure 10.0.0.9 is being assigned to your WiFi interface. ** This application should be kept running and will wait until connected to the WiFi... ....~~ Starting web server (HTTP port: 8080, HTTPS port 8443) ~~ Waiting for device to connect

IMPORTANT! AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. This server should automatically be allocated the IP address: 192.168.4.2. 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. ..<< HTTP POST /dispatch/device

/dispatch/device { "error": 0, "reason": "ok", "IP": "10.0.0.9", "port": 8443 } 2017-10-09 19:27:31,932 (INFO) 200 POST /dispatch/device (10.0.0.14) 6.03ms 2017-10-09 19:27:32,055 (INFO) 101 GET /api/ws (10.0.0.14) 1.40ms 2017-10-09 19:27:32,055 (DEBUG) << WEBSOCKET OPEN 2017-10-09 19:27:32,065 (DEBUG) << WEBSOCKET INPUT 2017-10-09 19:27:32,066 (DEBUG) << { "userAgent": "device", "apikey": "75c6b3dd-4012-41c6-a0c3-339ff8d2f311", "deviceid": "10000624d3", "action": "register", "version": 2, "romVersion": "1.2.0", "model": "PSB-B04-GL", "ts": 755 }


2017-10-09 19:27:32,066 (INFO) We are dealing with a PSB-B04-GL model.
~~~~ register
{
"error": 0,
"deviceid": "10000624d3",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"config": {
"hb": 1,
"hbInterval": 145
}
}
2017-10-09 19:27:32,075 (DEBUG) << WEBSOCKET INPUT
2017-10-09 19:27:32,075 (DEBUG) << {
"userAgent": "device",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"deviceid": "10000624d3",
"action": "date"
}
~~~ device sent action request,  acknowledging / answering...
~~~~ date
{
"error": 0,
"deviceid": "10000624d3",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"date": "2017-10-09T19:27:32.075Z"
}
2017-10-09 19:27:32,080 (DEBUG) << WEBSOCKET INPUT
2017-10-09 19:27:32,081 (DEBUG) << {
"userAgent": "device",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"deviceid": "10000624d3",
"action": "update",
"params": {
"switches": [
{
"switch": "off",
"outlet": 0
},
{
"switch": "off",
"outlet": 1
},
{
"switch": "on",
"outlet": 2
},
{
"switch": "off",
"outlet": 3
}
],
"fwVersion": "1.2.0"
}
}
~~~ device sent action request,  acknowledging / answering...
~~~~ update
{
"error": 0,
"deviceid": "10000624d3",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"userAgent": "app",
"sequence": "1507570052081",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"userAgent": "app",
"sequence": "1507570052082",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"userAgent": "app",
"sequence": "1507570052082",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"userAgent": "app",
"sequence": "1507570052083",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"userAgent": "app",
"sequence": "1507570052083",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "upgrade",
"deviceid": "10000624d3",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"userAgent": "app",
"sequence": "1507570052093",
"ts": 0,
"params": {
"binList": [
{
"downloadUrl": "http://10.0.0.9:8080/ota/image_user1-0x01000.bin",
"digest": "1c467a7cb4058df22046ffbc0312272aed324a74e91b9b39e1bf2aef88eeca8a",
"name": "user1.bin"
},
{
"downloadUrl": "http://10.0.0.9:8080/ota/image_user2-0x81000.bin",
"digest": "804e4f4a2316fbcc2c6b46aff53c24b9be252bf3fd8cf3ea2243e4475a052658",
"name": "user2.bin"
}
],
"model": "PSB-B04-GL",
"version": "23.42.5"
}
}
Sending file: /ota/image_user1-0x01000.bin
2017-10-09 19:27:32,155 (INFO) 200 GET /ota/image_user1-0x01000.bin?deviceid=10000624d3&ts=2047965620&sign=4072d3a1c930a05032724d1988426d588d4ad0a311a7c03ceae227e7be9c4eab (10.0.0.14) 30.56ms
2017-10-09 19:27:32,156 (DEBUG) << WEBSOCKET INPUT
2017-10-09 19:27:32,156 (DEBUG) << {
"error": 404,
"userAgent": "device",
"apikey": "ab93a841-046c-4c57-9306-4679b3cc2a46",
"deviceid": "10000624d3",
"sequence": "1507570052093"
}
2017-10-09 19:27:32,156 (DEBUG) ~~~ device acknowledged our action request (seq 1507570052093) with error code 404
............................
*** IMPORTANT! ***
** AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process.
** ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network.
This server should automatically be allocated the IP address: 192.168.4.2.
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.
..............

Here is the log output from release on Saturday with my switch command changes:

~~ Provisioning completed Starting stage2... The IP address of (10.0.0.9) is not assigned to any interface on this machine. Please change WiFi network to router135 and make sure 10.0.0.9 is being assigned to your WiFi interface. ** This application should be kept running and will wait until connected to the WiFi... .......~~ Starting web server (HTTP port: 8080, HTTPS port 8443) ~~ Waiting for device to connect

IMPORTANT! AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. This server should automatically be allocated the IP address: 192.168.4.2. 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. ...................<< HTTP POST /dispatch/device

/dispatch/device { "error": 0, "reason": "ok", "IP": "10.0.0.9", "port": 8443 } 2017-10-09 19:11:44,520 (INFO) 200 POST /dispatch/device (10.0.0.14) 6.20ms 2017-10-09 19:11:44,638 (INFO) 101 GET /api/ws (10.0.0.14) 1.33ms 2017-10-09 19:11:44,639 (DEBUG) << WEBSOCKET OPEN 2017-10-09 19:11:44,649 (DEBUG) << WEBSOCKET INPUT 2017-10-09 19:11:44,650 (DEBUG) << { "userAgent": "device", "apikey": "75c6b3dd-4012-41c6-a0c3-339ff8d2f311", "deviceid": "10000624d3", "action": "register", "version": 2, "romVersion": "1.2.0", "model": "PSB-B04-GL", "ts": 257 }


2017-10-09 19:11:44,650 (INFO) We are dealing with a PSB-B04-GL model.
~~~~ register
{
"error": 0,
"deviceid": "10000624d3",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"config": {
"hb": 1,
"hbInterval": 145
}
}
2017-10-09 19:11:44,659 (DEBUG) << WEBSOCKET INPUT
2017-10-09 19:11:44,659 (DEBUG) << {
"userAgent": "device",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"deviceid": "10000624d3",
"action": "date"
}
~~~ device sent action request,  acknowledging / answering...
~~~~ date
{
"error": 0,
"deviceid": "10000624d3",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"date": "2017-10-09T19:11:44.659Z"
}
2017-10-09 19:11:44,664 (DEBUG) << WEBSOCKET INPUT
2017-10-09 19:11:44,665 (DEBUG) << {
"userAgent": "device",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"deviceid": "10000624d3",
"action": "update",
"params": {
"switches": [
{
"switch": "off",
"outlet": 0
},
{
"switch": "off",
"outlet": 1
},
{
"switch": "off",
"outlet": 2
},
{
"switch": "off",
"outlet": 3
}
],
"fwVersion": "1.2.0"
}
}
~~~ device sent action request,  acknowledging / answering...
~~~~ update
{
"error": 0,
"deviceid": "10000624d3",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"userAgent": "app",
"sequence": "1507569104665",
"ts": 0,
"params": {
"outlet": 0,
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"userAgent": "app",
"sequence": "1507569104666",
"ts": 0,
"params": {
"outlet": 0,
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"userAgent": "app",
"sequence": "1507569104666",
"ts": 0,
"params": {
"outlet": 0,
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"userAgent": "app",
"sequence": "1507569104667",
"ts": 0,
"params": {
"outlet": 0,
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "10000624d3",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"userAgent": "app",
"sequence": "1507569104668",
"ts": 0,
"params": {
"outlet": 0,
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "upgrade",
"deviceid": "10000624d3",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"userAgent": "app",
"sequence": "1507569104680",
"ts": 0,
"params": {
"binList": [
{
"downloadUrl": "http://10.0.0.9:8080/ota/image_user1-0x01000.bin",
"digest": "2d6a44bbbd8303ed1f1fe8594e615d527779568141e77fe8917afb72f58d57dc",
"name": "user1.bin"
},
{
"downloadUrl": "http://10.0.0.9:8080/ota/image_user2-0x81000.bin",
"digest": "cfb790b67496e865b40acf93653425f6d7010f3097fd3cbaf6457d7b6ec08b35",
"name": "user2.bin"
}
],
"model": "PSB-B04-GL",
"version": "23.42.5"
}
}
Sending file: /ota/image_user1-0x01000.bin
2017-10-09 19:11:44,754 (DEBUG) << WEBSOCKET INPUT
2017-10-09 19:11:44,754 (DEBUG) << {
"error": 404,
"userAgent": "device",
"apikey": "cec0863c-0c9e-4cf9-830a-b3323e9fc3e1",
"deviceid": "10000624d3",
"sequence": "1507569104680"
}
2017-10-09 19:11:44,754 (DEBUG) ~~~ device acknowledged our action request (seq 1507569104680) with error code 404
2017-10-09 19:11:44,755 (INFO) 200 GET /ota/image_user1-0x01000.bin?deviceid=10000624d3&ts=730417256&sign=6e646941b87147a3f113a7c0f89b7ab9129d4c760b5d6bb56f83ce9aa805b8bd (10.0.0.14) 48.79ms
...........
*** IMPORTANT! ***
** AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process.
** ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network.
This server should automatically be allocated the IP address: 192.168.4.2.
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.
.........
sillyfrog commented 7 years ago

@08-15at Bummer... This latest build was looking so good for several others... It maybe worth trying all the different flash types. I can put together a number of different branches again to test this, or if you didn't want to wait (it'll be a bit over a day probably before I can get back to this), I have some (quick) notes at: https://github.com/mirko/SonOTA/tree/master/static

I'll probably get some more Sonoff's in a month or so, and I can look at them then and see if they have this issue, and try and resolve once and for all!

andyfitter commented 7 years ago

I’ve had problems with two Sonoff Duals too. Both were on software 1.3.0 out of the box, and both have given me the dreaded ‘404’ on all the branches/flashing options. the EWeLink App didn’t offer any firmware update options. Also tried having them both factory clean and previously linked to the EWelink app, still no luck.

In the end I went ‘old school’ and ‘hard' flashed them with an adaptor. Not the easiest device to Flash either as the switch isn’t linked to the GPIO. You need to dig around on the PCB. Luckily, this worked.

On 10 Oct 2017, at 06:21, sillyfrog notifications@github.com wrote:

@08-15at https://github.com/08-15at Bummer... This latest build was looking so good for several others... It maybe worth trying all the different flash types. I can put together a number of different branches again to test this, or if you didn't want to wait (it'll be a bit over a day probably before I can get back to this), I have some (quick) notes at: https://github.com/mirko/SonOTA/tree/master/static https://github.com/mirko/SonOTA/tree/master/static I'll probably get some more Sonoff's in a month or so, and I can look at them then and see if they have this issue, and try and resolve once and for all!

— 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-335363855, or mute the thread https://github.com/notifications/unsubscribe-auth/AArNQiIwBLMoHGT62928_fh_WIUUZU2Dks5sqv6-gaJpZM4PfDB2.

sillyfrog commented 7 years ago

Since this does not appear to be fixed for everyone, reopening until we have a solution that works...

sillyfrog commented 7 years ago

@08-15at I have pushed the builds for each of the different flash types, if you can please do a pull, then git checkout <branch-name>, and try the flash for each of these branches, and see if any give you something that's not a 404 error.

The branches to try (I would suggest this order):

  1. dio-mode
  2. qio-mode
  3. qout-mode

Hopefully one of them will work - if so, let me know and I'll have a think how we maybe able to automate this for others.

Good luck!

kryten01 commented 7 years ago

@sillyfrog I would be happy to give it a go but I ended up having more success with the soldering iron. Will be back to try the OTA method when I get more sonoffs.

A tip for anyone soldering header pins on the S20s (or at least the AU plug models). You can't get the board out without major surgery, so the only option is to solder the pins in from the top - and there isn't really enough room to get a soldering iron tip under the header pin insulation/base. I ended up snipping/crushing the insulation off the header pins and soldering them in one at a time. There's plenty of space between them. I also had to bend them over a bit after flashing to get the cover back on without them interfering with the button.

sillyfrog commented 7 years ago

@kryten01 If you do come across this again, and the above does not sort it, let me know. Your post implies you are in Australia, so maybe easy for me to get (buy) one from you so I can try and replicate and fix :)

08-15at commented 7 years ago

@sillyfrog tried the three other modes, keep getting the same 404 error message.

sillyfrog commented 7 years ago

@08-15at grumble... I'm currently out of ideas... I'm assuming this is the Dual that you have upgraded to the latest Sonoff release (the actual upgrade step is important as it implies the flash itself is mostly working)? What country are you in? (I'd like to get my hands on it and test - seeing if that's practical.)

Does it still work OK with the eWeLink app?

andyfitter commented 7 years ago

I’m in the uk but I’d happily PayPal the cash for you to get a dual if they are available to you?

On 12 Oct 2017, at 1:15 am, sillyfrog notifications@github.com wrote:

@08-15at grumble... I'm currently out of ideas... I'm assuming this is the Dual that you have upgraded to the latest Sonoff release (the actual upgrade step is important as it implies the flash itself is mostly working)? What country are you in? (I'd like to get my hands on it and test - seeing if that's practical.)

Does it still work OK with the eWeLink app?

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

andyfitter commented 7 years ago

I’ve tried two duals now. They come with 1.3.0 and eWelink offers no updates. Happy to fund one for you for my gratitude.

On 12 Oct 2017, at 1:46 am, Andrew Fitter andy@fittersystems.com wrote:

I’m in the uk but I’d happily PayPal the cash for you to get a dual if they are available to you?

On 12 Oct 2017, at 1:15 am, sillyfrog notifications@github.com wrote:

@08-15at grumble... I'm currently out of ideas... I'm assuming this is the Dual that you have upgraded to the latest Sonoff release (the actual upgrade step is important as it implies the flash itself is mostly working)? What country are you in? (I'd like to get my hands on it and test - seeing if that's practical.)

Does it still work OK with the eWeLink app?

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

sillyfrog commented 7 years ago

The challenge is I have already got one and it just worked first go - so there are (some how) variants out there, so ideally I'd get the one that's actually having issues now. Do you know costs to ship one to Australia? (maybe send me an email so we can talk about it off this issue if that suits?)

andyfitter commented 7 years ago

Sure, I’ll be in touch in the morning.

On 12 Oct 2017, at 1:58 am, sillyfrog notifications@github.com wrote:

The challenge is I have already got one and it just worked first go - so there are (some how) variants out there, so ideally I'd get the one that's actually having issues now. Do you know costs to ship one to Australia? (maybe send me an email so we can talk about it off this issue if that suits?)

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

sillyfrog commented 7 years ago

If anyone is still getting this 404 issue with all of the branches I pushed a few days ago, and are interested in getting me the hardware, I'd be keen to talk :)

@andyfitter If you are still up for it, drop me a note and we can see what we can figure out.

Thanks!

sillyfrog commented 7 years ago

Further thinking and reading on this for those who are still interested in helping get this sorted... :)

It could be the type of flash causing the issue (from further reading). If someone has some hardware that is still getting the 404 issue, if you can have a look at the flash chip and post it here (a photo, or the numbers). This is the flash on my Dual (that did work) on this page: https://github.com/mirko/SonOTA/wiki/Flash-Types

Given the move to DOUT mode has fixed it for many, I'm guessing there is still something else not compatible for those still having the issue. This information forms part of the header of the image, which explains why the 404 is returned after the Sonoff downloads the first chunk and changing the mode fixed it for some.

This page talks about the different flash types: https://github.com/espressif/esptool#esp8266-and-flash-size Things that we can still tweak are Flash Frequency and Flash Size (more likely the frequency, but still not really sure). I have pushed yet another branch freq-20m - this sets the flash frequency to 20Mhz in the header. I don't feel like it's going to work, but without testing I think (the default speed in 40Mhz). If someone wants to give this a go and let me know the results, please do, and again I can see what to try from there.

Cheers.

08-15at commented 7 years ago

@sillyfrog thanks for your efforts. Had a close look at my chips on the Dual they have exakt the same numbers as on your picture, so different flash (mode) seems highly unlikely. I've a feeling, the process may fail way before the 404error happens. When switching back from the ITEAD AP to my local router, my mac connects immediately, however the script waits pretty long before starting to output the relay switch commands. This waiting time varies on different attempts. So to me it looks as if the device runs into the watchdog, then seems to accept the relay commands (although doing nothing). However i'm not sure, if the device is in the needed mode by then.

Anybody knows how the command for switching the relays should be on the Dual BEFORE entering the upgrade mode around line 278 and on. I tried with: "params": { "switches": [ { "switch": "off", "outlet": 0 },

as the status message at the beginning did return:

"userAgent": "device",
"apikey": "0313926e-918b-484a-a662-b402404f516a",
"deviceid": "10000624d3",
"action": "update",
"params": {
    "switches": [
        {
            "switch": "off",
            "outlet": 0
        },
        {
            "switch": "off",
            "outlet": 1
        },
        {
            "switch": "off",
            "outlet": 2
        },
        {
            "switch": "off",
            "outlet": 3
        }
    ],
    "fwVersion": "1.2.0"
}

Again I maybe be wrong, but I wasn't sure with my DOUT mode comment last time too, which i turn worked for some people. To me it looks as if the Dual is just accepting whatever command without error after switching back form ITEAD AP mode to the router. Maybe because it actual did perform a watchdog reset ? And then it just fails when getting fed with lots of data in unknown (not upgrade) mode ? To prove this, I tried to switch at least one relay before upgrade, but it seems as these commands get discarded without returning an error. So maybe we even never enter upgrade mode ?? But I could be using the wrong relay command here, too, or just way off in any other direction.

I may try to intercept the whole normal ssl traffic as soon as time permits, however can't say when, as currently my free time is pretty limited.

sillyfrog commented 7 years ago

@08-15at I have successfully upgraded a Dual (the one in the photo) using SonOTA, running the firmware as in the wiki. The relay switching is just to give feedback that it's working (it's not at all required).

Your earlier posts have the line:

200 GET /ota/image_user2-0x81000.bin?deviceid=10000624d3&ts=155562330&sign=2e53add2a5bc8751fc82efe94ed33837534cd870ce2a463c4edd6a96453a41bc

Then the 404 (sometimes the 404 may come through before hand, but this is just a race condition), suggesting the issue is to do with something in the flash format (as this forms part of the first chunk). Let me know if any of the other branches work as there appears to be something with some of these Duals causing issues.

Cheers.

08-15at commented 7 years ago

@sillyfrog, tried the freq branch, same results. But did about 10 tests now in a row. What made me think of a watchdog/timeout reset is the following:

IMPORTANT! AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. This server should automatically be allocated the IP address: 192.168.4.2. 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. .......

The time it takes before outputting the the following

<< HTTP POST /dispatch/device

/dispatch/device { "error": 0,

is completely arbitrary, sometimes 1-2 seconds sometimes more than 15. Don't know any other reason for this. I know, that relay switching has nothing to do with the upgrade itself, just thought that could give an indication if the device is still accepting and executing commands at this stage or if it is already in a somewhat undefined mode.

08-15at commented 7 years ago

@sillyfrog hmm, you're probably right, seems as the dual doesn't like the first few packets and resets connection. Here's a wireshark excerpt sonoff_dual.pcapng.zip

sillyfrog commented 7 years ago

@08-15at Re the timing of the request, that's just the internal firmware in the Sonoff reaching out regularly - so it depends when you reconnect where it's at in the cycle. My thinking is the firmware is checking the first few bytes, verifying it's a match, and stopping or going based on that - I'm just not sure what features it's looking for.

I was hoping the model of the flash chip would give a clue, but clearly not unfortunately :(

I'm working on getting a Dual that's having these issues so I can look at the traffic (and I'll also look at the actual firmware that gets sent down), and see if I can figure out the cause.

andyfitter commented 7 years ago

I wonder if this is related - seems the 'dual's are causing problems elsewhere https://github.com/arendst/Sonoff-Tasmota/issues/1007

robertjanb commented 7 years ago

For what it's worth: I had the same 404 errors all of the time, tried the different branches etc. The thing that worked for me was to use Linux (I was on W10). Used a new Dual with 1.3 firmware, and the master branche, all went smooth immediately.

sillyfrog commented 7 years ago

@andyfitter could be - sounds just as weird! My successful attempt was on a Mac.

@robertjanb That is odd as the server should be serving exactly the same content - the only thing I can think that maybe different is the underlying TCP implementation, and there is something that Windows is doing weird - but unfortunately that has not been the solution for everyone. I'm working on getting one that's having the issue (thanks @andyfitter !) - hopefully when I get that I can investigate further and get to the bottom of it.

08-15at commented 7 years ago

can somehow confirm robertjanb. Gave Ubuntu a try (no VM) with python 3.5.2. No 404 error anymore, download started immediately but failed. However FinalStage appeared so I tried with --no-prov which seemed to install fine. FinalStage disappeared, however now the Dual seems to be stuck in some kind of endless loop ( power on ->all lights off for ca. 20 seconds, then 20 second blue light blinking and then the whole cycle repeats, (long) button press does nothing, can't see the device on the network anymore). Still have to look into this.... btw: Upgraded my os x python beforehand to 3.6.3 but that did not change. So there seems to be some strange things happening on os x, which I cannot explain. FYI I'm still on os x 10.10.5 Offtopic: Just if someone wants to know: to switch the relays on the dual the params in stage 1 look like this: data = { "action": "update", "deviceid": dct['deviceid'], "apikey": self.uuid, "userAgent": "app", "sequence": str(int(time() * 1000)), "ts": 0, "params":{ "switches":[ {"switch":"on","outlet":0}, {"switch":"off","outlet":1}, {"switch":"off","outlet":2}, {"switch":"off","outlet":3} ] }, "from": "hackepeter" } At least this is working on the mac ;-))

sillyfrog commented 7 years ago

@08-15at Great news it's working. It should now have the latest Sonoff-Tasmota (assuming you have pulled recently). This will be in WPS mode, you need to press the button 4 times to enable the AP - see the home page of this project for some brief notes as to what it should be doing.

kryten01 commented 7 years ago

@sillyfrog Yes I'm in Aus and I would happily send you my spare S20 here but I've checked and it is bricked - and no longer responsive either via wifi or serial. I suspect I have a blob of solder shorting something out on the other side of the board, so when I get time I'll see if I can resurrect it. That will involve desoldering the AC plug in order to get the board out.

08-15at commented 7 years ago

@sillyfrog, tried the 4 button press several times, didn't work. However I was able to connect by temporarily changing one of the router sid & pw to the tasmota source code one. So regarding flashing to me it definitely looks like a timing issue on mac os x (can't think it has something to do with the used python version or so). Could it have to do something with tornado async threads (I'm a python nobody, as varnish, nginx and co is the world I'm living in) ? I definitely had a look in detail if any firewall/redirection or whatever was active on my Mac, it wasn't.

The only thing that comes to my mind right now, my machine is always running nginx on port 80 and 443. Could it be, that the Sonoff tried to get the binaries from 443 there instead of from the python server? My logfiles and the debug output suggest no. But who knows. I tried the legacy method a the beginning (where I had to turn off nginx before), however that was still the non DOUT-branch. As I've flashed mine successfully now, I can't test this anymore.

Thorhammerk commented 7 years ago

Hi, i´ve tried to update my S20 (just unboxed)via WIN10, Linux and OSX...without luck. Still getting 404 and FinalStage never comes.

"action": "upgrade",
"deviceid": "1000052879",
"apikey": "89ecce75-a20b-4dab-83ef-26894040b3e5",
"userAgent": "app",
"sequence": "1508176993012",
"ts": 0,
"params": {
    "binList": [
        {
            "downloadUrl": "http://192.168.1.59:8080/ota/image_user1-0x01000.bin",
            "digest": "1c467a7cb4058df22046ffbc0312272aed324a74e91b9b39e1bf2aef88eeca8a",
            "name": "user1.bin"
        },
        {
            "downloadUrl": "http://192.168.1.59:8080/ota/image_user2-0x81000.bin",
            "digest": "804e4f4a2316fbcc2c6b46aff53c24b9be252bf3fd8cf3ea2243e4475a052658",
            "name": "user2.bin"
        }
    ],
    "model": "PSA-B01-GL",
    "version": "23.42.5"
}

} 2017-10-16 20:03:13,642 (DEBUG) << WEBSOCKET INPUT 2017-10-16 20:03:13,642 (DEBUG) << { "error": 0, "userAgent": "device", "apikey": "89ecce75-a20b-4dab-83ef-26894040b3e5", "deviceid": "1000052879", "sequence": "1508176993009" } 2017-10-16 20:03:13,642 (DEBUG) ~~~ device acknowledged our action request (seq 1508176993009) with error code 0 Sending file: /ota/image_user2-0x81000.bin 2017-10-16 20:03:14,094 (DEBUG) << WEBSOCKET INPUT 2017-10-16 20:03:14,095 (DEBUG) << { "error": 404, "userAgent": "device", "apikey": "89ecce75-a20b-4dab-83ef-26894040b3e5", "deviceid": "1000052879", "sequence": "1508176993012" } 2017-10-16 20:03:14,095 (DEBUG) ~~~ device acknowledged our action request (seq 1508176993012) with error code 404 2017-10-16 20:03:14,095 (INFO) 200 GET /ota/image_user2-0x81000.bin?deviceid=1000052879&ts=941604920&sign=734e27ca41bf1929dceda4289a61607570ef4bf1d1e65e563db51f4d4ddb59f6 (192.168.1.73) 14.23ms

sillyfrog commented 7 years ago

@kryten01 Thanks for the offer! Let me know if you manage to get it going, an important thing will be that it still works with the eWeLink app as I'll be using that traffic to try and figure out the source of the issue. That said, I have one coming from someone else at this stage, so I'll let you know once I have it, and have had a chance to look at it further.

10der commented 7 years ago

issue still here

Sonoff dual

>> {
    "action": "update",
    "deviceid": "1000063049",
    "apikey": "62cbb3a1-a764-430b-bd2a-7c84f2e046fe",
    "userAgent": "app",
    "sequence": "1508793851496",
    "ts": 0,
    "params": {
        "switch": "off"
    },
    "from": "hackepeter"
}
>> {
    "action": "upgrade",
    "deviceid": "1000063049",
    "apikey": "62cbb3a1-a764-430b-bd2a-7c84f2e046fe",
    "userAgent": "app",
    "sequence": "1508793851498",
    "ts": 0,
    "params": {
        "binList": [
            {
                "downloadUrl": "http://192.168.1.45:8080/ota/image_user1-0x01000.bin",
                "digest": "1c467a7cb4058df22046ffbc0312272aed324a74e91b9b39e1bf2aef88eeca8a",
                "name": "user1.bin"
            },
            {
                "downloadUrl": "http://192.168.1.45:8080/ota/image_user2-0x81000.bin",
                "digest": "804e4f4a2316fbcc2c6b46aff53c24b9be252bf3fd8cf3ea2243e4475a052658",
                "name": "user2.bin"
            }
        ],
        "model": "PSB-B04-GL",
        "version": "23.42.5"
    }
}
Sending file: /ota/image_user1-0x01000.bin
2017-10-24 00:24:11,545 (INFO) 200 GET /ota/image_user1-0x01000.bin?deviceid=1000063049&ts=1270216262&sign=b41191d084cc7
8b8f289fd6191b5baae8dcc43da773a0c75913690395e157b01 (192.168.1.35) 12.00ms
2017-10-24 00:24:11,545 (DEBUG) << WEBSOCKET INPUT
2017-10-24 00:24:11,545 (DEBUG) << {
    "error": 404,
    "userAgent": "device",
    "apikey": "62cbb3a1-a764-430b-bd2a-7c84f2e046fe",
    "deviceid": "1000063049",
    "sequence": "1508793851498"
}
2017-10-24 00:24:11,546 (DEBUG) ~~~ device acknowledged our action request (seq 1508793851498) with error code 404
andyfitter commented 7 years ago

There’s a ‘dual’ with the same problem winging its way to the coder as we speak. Good luck!

On 23 Oct 2017, at 10:25 pm, Oleg Denisenko notifications@github.com wrote:

issue still here

Sonoff dual

{ "action": "update", "deviceid": "1000063049", "apikey": "62cbb3a1-a764-430b-bd2a-7c84f2e046fe", "userAgent": "app", "sequence": "1508793851496", "ts": 0, "params": { "switch": "off" }, "from": "hackepeter" } { "action": "upgrade", "deviceid": "1000063049", "apikey": "62cbb3a1-a764-430b-bd2a-7c84f2e046fe", "userAgent": "app", "sequence": "1508793851498", "ts": 0, "params": { "binList": [ { "downloadUrl": "http://192.168.1.45:8080/ota/image_user1-0x01000.bin", "digest": "1c467a7cb4058df22046ffbc0312272aed324a74e91b9b39e1bf2aef88eeca8a", "name": "user1.bin" }, { "downloadUrl": "http://192.168.1.45:8080/ota/image_user2-0x81000.bin", "digest": "804e4f4a2316fbcc2c6b46aff53c24b9be252bf3fd8cf3ea2243e4475a052658", "name": "user2.bin" } ], "model": "PSB-B04-GL", "version": "23.42.5" } } Sending file: /ota/image_user1-0x01000.bin 2017-10-24 00:24:11,545 (INFO) 200 GET /ota/image_user1-0x01000.bin?deviceid=1000063049&ts=1270216262&sign=b41191d084cc7 8b8f289fd6191b5baae8dcc43da773a0c75913690395e157b01 (192.168.1.35) 12.00ms 2017-10-24 00:24:11,545 (DEBUG) << WEBSOCKET INPUT 2017-10-24 00:24:11,545 (DEBUG) << { "error": 404, "userAgent": "device", "apikey": "62cbb3a1-a764-430b-bd2a-7c84f2e046fe", "deviceid": "1000063049", "sequence": "1508793851498" } 2017-10-24 00:24:11,546 (DEBUG) ~~~ device acknowledged our action request (seq 1508793851498) with error code 404 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

10der commented 7 years ago

There’s a ‘dual’ with the same problem winging its way to the coder as we speak. Good luck!

sorry, not clear for me. so, we should be waiting for a final solution, as I can understand you.

andyfitter commented 7 years ago

I have posted a ‘dual’ to the coder who makes Sonota. He will hopefully receive it soon. Maybe he’ll be ale to fix our problems.

Andrew Fitter andy@fittersystems.com

On 23 Oct 2017, at 23:22, Oleg Denisenko notifications@github.com wrote:

There’s a ‘dual’ with the same problem winging its way to the coder as we speak. Good luck! sorry, not clear for me. so, we should be waiting for a final solution, as I can understand you.

— 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-338814110, or mute the thread https://github.com/notifications/unsubscribe-auth/AArNQoGH7P6n0tRsddRT-EPkyKcC7Jhrks5svRGSgaJpZM4PfDB2.

sillyfrog commented 7 years ago

@10der that is correct, I have not been a replicate this issue myself so I'm hoping the one that is coming from @andyfitter will help me diagnose the source of the problem. The Dual I have worked fine on the first go :(

10der commented 7 years ago

вт, 24 окт. 2017 г. в 06:51, sillyfrog notifications@github.com:

@10der https://github.com/10der that is correct, I have not been a replicate this issue myself so I'm hoping the one that is coming from @andyfitter https://github.com/andyfitter will help me diagnose the source of the problem. The Dual I have worked fine on the first go :(

— 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-338865245, or mute the thread https://github.com/notifications/unsubscribe-auth/AGuscmQDNVK022CPq5ADjPNOVgZjGWOVks5svV7FgaJpZM4PfDB2 .

I can reproduce also I can give TeamView to my local env or something else.

sillyfrog commented 7 years ago

@10der thanks for the offer, doing this remotely will be quite challenging because we need access to serial output as well as changing the network so we can look at the SSL traffic. I should have one arriving in the next few days, and I'll be able to have a look and try reproduce and then fix the problem then. Fingers crossed.

Joeyhza commented 7 years ago

Hi

Any progress on this?

I've bought a few Sonoff Duals and have the same problem on 2 of them so far - haven't bothered trying the other 2 but i'm confident the issue will be the same. Also getting error 404. Output attached

Microsoft Windows [Version 10.0.10240] (c) 2015 Microsoft Corporation. All rights reserved.

C:\Windows\system32>cd\

C:>cd src

C:\src>cd SonOTA

C:\src\SonOTA>pip3 install --user -r requirements.txt Requirement already satisfied: httplib2>=0.10.3 in c:\python\lib\site-packages (from -r requirements.txt (line 1)) Requirement already satisfied: netifaces>=0.10.6 in c:\python\lib\site-packages (from -r requirements.txt (line 2)) Requirement already satisfied: tornado>=4.5.1 in c:\python\lib\site-packages (from -r requirements.txt (line 3))

C:\src\SonOTA>sonota.py Current IPs: ['192.168.1.73'] Select IP address of the WiFi interface: 0: 192.168.1.73 Select IP address [0]: 0 WiFi SSID: Connect for Identity Theft WiFi Password: qwerty1234567890

Using the following configuration: Server IP Address: 192.168.1.73 WiFi SSID: Connect for Identity Theft WiFi Password: **** Now connect via WiFi to your Sonoff device. Please change into the ITEAD WiFi network (ITEAD-100001XXXX). The default password is 12345678. To reset the Sonoff to defaults, press the button for 7 seconds and the light will start flashing rapidly. ** This application should be kept running and will wait until connected to the Sonoff... ............................................Current IPs: [] ....Current IPs: ['10.10.7.2'] ~~ Connection attempt

HTTP GET /10.10.7.1/device << { "deviceid": "1000088487", "apikey": "4e178489-b15a-4c2b-a559-434cf2bb1823", "accept": "post" } HTTP POST /10.10.7.1/ap { "version": 4, "ssid": "Connect for Identity Theft", "password": "****", "serverName": "192.168.1.73", "port": 8443 } << { "error": 0 } ~~ Provisioning completed Starting stage2... The IP address of (192.168.1.73) is not assigned to any interface on this machine. Please change WiFi network to Connect for Identity Theft and make sure 192.168.1.73 is being assigned to your WiFi interface. ** This application should be kept running and will wait until connected to the WiFi... .......................Current IPs: [] .Current IPs: ['10.10.7.2'] ..................Current IPs: ['192.168.1.73'] ~~ Starting web server (HTTP port: 8080, HTTPS port 8443) ~~ Waiting for device to connect

IMPORTANT! AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. This server should automatically be allocated the IP address: 192.168.4.2. 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. ...........................Current IPs: ['10.10.7.2'] ... IMPORTANT! AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. This server should automatically be allocated the IP address: 192.168.4.2. 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. .........Current IPs: ['192.168.1.73'] ...............Current IPs: [] ..Current IPs: ['10.10.7.2'] .... IMPORTANT! AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. This server should automatically be allocated the IP address: 192.168.4.2. 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. .............................. IMPORTANT! AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. This server should automatically be allocated the IP address: 192.168.4.2. 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. .............................. IMPORTANT! AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process. ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network. This server should automatically be allocated the IP address: 192.168.4.2. 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. .......................Current IPs: ['192.168.1.73'] ......<< HTTP POST /dispatch/device

/dispatch/device { "error": 0, "reason": "ok", "IP": "192.168.1.73", "port": 8443 } 200 POST /dispatch/device (192.168.1.66) 78.13ms 101 GET /api/ws (192.168.1.66) 46.88ms << WEBSOCKET OPEN << WEBSOCKET INPUT << { "userAgent": "device", "apikey": "4e178489-b15a-4c2b-a559-434cf2bb1823", "deviceid": "1000088487", "action": "register", "version": 2, "romVersion": "1.3.0", "model": "PSB-B04-GL", "ts": 712 } --- Logging error --- . Traceback (most recent call last): File "C:\Python\lib\logging__init.py", line 992, in emit msg = self.format(record) File "C:\Python\lib\logging__init.py", line 838, in format return fmt.format(record) File "C:\Python\lib\logging\init.py", line 575, in format record.message = record.getMessage() File "C:\Python\lib\logging\init__.py", line 338, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Call stack: File "C:\src\SonOTA\sonota.py", line 676, in main() File "C:\src\SonOTA\sonota.py", line 672, in main stage2() File "C:\src\SonOTA\sonota.py", line 614, in stage2 tornado.ioloop.IOLoop.instance().start() File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start self._run_callback(self._callbacks.popleft()) File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback ret = callback() File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper return fn(*args, kwargs) File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper return callback(args) File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped ret = fn(args, kwargs) File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data self._on_frame_data(_websocket_mask(self._frame_mask, data)) File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data handled_future = self._handle_message(opcode, data) File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message return self._run_callback(self.handler.on_message, decoded) File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback result = callback(args, kwargs) File "C:\src\SonOTA\sonota.py", line 168, in on_message "acknowledging / answering...") Message: '~~~ device sent action request, ' Arguments: ('acknowledging / answering...',) --- Logging error --- IMPORTANT! *** Traceback (most recent call last): File "C:\Python\lib\logging\init.py", line 992, in emit msg = self.format(record) File "C:\Python\lib\logging\init.py", line 838, in format return fmt.format(record) File "C:\Python\lib\logging\init.py", line 575, in format record.message = record.getMessage() File "C:\Python\lib\logging\init__.py", line 338, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Call stack: File "C:\src\SonOTA\sonota.py", line 676, in main() File "C:\src\SonOTA\sonota.py", line 672, in main stage2() File "C:\src\SonOTA\sonota.py", line 614, in stage2 tornado.ioloop.IOLoop.instance().start() File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start self._run_callback(self._callbacks.popleft()) File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback ret = callback() File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper return fn(*args, kwargs) File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper return callback(args) File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped ret = fn(args, kwargs) File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data self._on_frame_data(_websocket_mask(self._frame_mask, data)) File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data handled_future = self._handle_message(opcode, data) File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message return self._run_callback(self.handler.on_message, decoded) File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback result = callback(*args, kwargs) File "C:\src\SonOTA\sonota.py", line 168, in on_message "acknowledging / answering...") Message: '~~~ device sent action request, ' Arguments: ('acknowledging / answering...',) We are dealing with a PSB-B04-GL model. AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process.


** ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network.
{
This server should automatically be allocated the IP address: 192.168.4.2.
"error": 0,
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.
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"config": {
"hb": 1,
"hbInterval": 145
}
}
<< WEBSOCKET INPUT
<< {
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"action": "date"
}
--- Logging error ---
Traceback (most recent call last):
File "C:\Python\lib\logging\__init__.py", line 992, in emit
msg = self.format(record)
File "C:\Python\lib\logging\__init__.py", line 838, in format
return fmt.format(record)
File "C:\Python\lib\logging\__init__.py", line 575, in format
record.message = record.getMessage()
File "C:\Python\lib\logging\__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\src\SonOTA\sonota.py", line 676, in <module>
main()
File "C:\src\SonOTA\sonota.py", line 672, in main
stage2()
File "C:\src\SonOTA\sonota.py", line 614, in stage2
tornado.ioloop.IOLoop.instance().start()
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start
self._run_callback(self._callbacks.popleft())
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback
ret = callback()
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper
return callback(*args)
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped
ret = fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data
self._on_frame_data(_websocket_mask(self._frame_mask, data))
File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data
handled_future = self._handle_message(opcode, data)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message
return self._run_callback(self.handler.on_message, decoded)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback
result = callback(*args, **kwargs)
File "C:\src\SonOTA\sonota.py", line 168, in on_message
"acknowledging / answering...")
Message: '~~~ device sent action request, '
Arguments: ('acknowledging / answering...',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Python\lib\logging\__init__.py", line 992, in emit
msg = self.format(record)
File "C:\Python\lib\logging\__init__.py", line 838, in format
return fmt.format(record)
File "C:\Python\lib\logging\__init__.py", line 575, in format
record.message = record.getMessage()
File "C:\Python\lib\logging\__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\src\SonOTA\sonota.py", line 676, in <module>
main()
File "C:\src\SonOTA\sonota.py", line 672, in main
stage2()
File "C:\src\SonOTA\sonota.py", line 614, in stage2
tornado.ioloop.IOLoop.instance().start()
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start
self._run_callback(self._callbacks.popleft())
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback
ret = callback()
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper
return callback(*args)
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped
ret = fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data
self._on_frame_data(_websocket_mask(self._frame_mask, data))
File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data
handled_future = self._handle_message(opcode, data)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message
return self._run_callback(self.handler.on_message, decoded)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback
result = callback(*args, **kwargs)
File "C:\src\SonOTA\sonota.py", line 168, in on_message
"acknowledging / answering...")
Message: '~~~ device sent action request, '
Arguments: ('acknowledging / answering...',)
~~~~ date
{
"error": 0,
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"date": "2017-11-03T08:06:09.490Z"
}
<< WEBSOCKET INPUT
<< {
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"action": "update",
"params": {
"switches": [
{
"switch": "off",
"outlet": 0
},
{
"switch": "off",
"outlet": 1
},
{
"switch": "on",
"outlet": 2
},
{
"switch": "off",
"outlet": 3
}
],
"configure": [
{
"startup": "stay",
"outlet": 0
},
{
"startup": "stay",
"outlet": 1
},
{
"startup": "off",
"outlet": 2
},
{
"startup": "off",
"outlet": 3
}
],
"fwVersion": "1.3.0",
"rssi": -75
}
}
--- Logging error ---
Traceback (most recent call last):
File "C:\Python\lib\logging\__init__.py", line 992, in emit
msg = self.format(record)
File "C:\Python\lib\logging\__init__.py", line 838, in format
return fmt.format(record)
File "C:\Python\lib\logging\__init__.py", line 575, in format
record.message = record.getMessage()
File "C:\Python\lib\logging\__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\src\SonOTA\sonota.py", line 676, in <module>
main()
File "C:\src\SonOTA\sonota.py", line 672, in main
stage2()
File "C:\src\SonOTA\sonota.py", line 614, in stage2
tornado.ioloop.IOLoop.instance().start()
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start
self._run_callback(self._callbacks.popleft())
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback
ret = callback()
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper
return callback(*args)
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped
ret = fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data
self._on_frame_data(_websocket_mask(self._frame_mask, data))
File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data
handled_future = self._handle_message(opcode, data)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message
return self._run_callback(self.handler.on_message, decoded)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback
result = callback(*args, **kwargs)
File "C:\src\SonOTA\sonota.py", line 168, in on_message
"acknowledging / answering...")
Message: '~~~ device sent action request, '
Arguments: ('acknowledging / answering...',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Python\lib\logging\__init__.py", line 992, in emit
msg = self.format(record)
File "C:\Python\lib\logging\__init__.py", line 838, in format
return fmt.format(record)
File "C:\Python\lib\logging\__init__.py", line 575, in format
record.message = record.getMessage()
File "C:\Python\lib\logging\__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\src\SonOTA\sonota.py", line 676, in <module>
main()
File "C:\src\SonOTA\sonota.py", line 672, in main
stage2()
File "C:\src\SonOTA\sonota.py", line 614, in stage2
tornado.ioloop.IOLoop.instance().start()
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start
self._run_callback(self._callbacks.popleft())
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback
ret = callback()
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper
return callback(*args)
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped
ret = fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data
self._on_frame_data(_websocket_mask(self._frame_mask, data))
File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data
handled_future = self._handle_message(opcode, data)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message
return self._run_callback(self.handler.on_message, decoded)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback
result = callback(*args, **kwargs)
File "C:\src\SonOTA\sonota.py", line 168, in on_message
"acknowledging / answering...")
Message: '~~~ device sent action request, '
Arguments: ('acknowledging / answering...',)
~~~~ update
{
"error": 0,
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a"
}
{
"action": "update",
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"userAgent": "app",
"sequence": "1509689170396",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"userAgent": "app",
"sequence": "1509689170474",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"userAgent": "app",
"sequence": "1509689170583",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"userAgent": "app",
"sequence": "1509689170677",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"userAgent": "app",
"sequence": "1509689170755",
"ts": 0,
.    "params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "upgrade",
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"userAgent": "app",
"sequence": "1509689170974",
"ts": 0,
"params": {
"binList": [
{
"downloadUrl": "http://192.168.1.73:8080/ota/image_user1-0x01000.bin",
"digest": "1c467a7cb4058df22046ffbc0312272aed324a74e91b9b39e1bf2aef88eeca8a",
"name": "user1.bin"
},
{
"downloadUrl": "http://192.168.1.73:8080/ota/image_user2-0x81000.bin",
"digest": "804e4f4a2316fbcc2c6b46aff53c24b9be252bf3fd8cf3ea2243e4475a052658",
"name": "user2.bin"
}
],
"model": "PSB-B04-GL",
"version": "23.42.5"
}
}
<< WEBSOCKET INPUT
<< {
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"action": "query",
"params": [
"timers"
]
}
--- Logging error ---
Traceback (most recent call last):
File "C:\Python\lib\logging\__init__.py", line 992, in emit
msg = self.format(record)
File "C:\Python\lib\logging\__init__.py", line 838, in format
return fmt.format(record)
File "C:\Python\lib\logging\__init__.py", line 575, in format
record.message = record.getMessage()
File "C:\Python\lib\logging\__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\src\SonOTA\sonota.py", line 676, in <module>
main()
File "C:\src\SonOTA\sonota.py", line 672, in main
stage2()
File "C:\src\SonOTA\sonota.py", line 614, in stage2
tornado.ioloop.IOLoop.instance().start()
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start
self._run_callback(self._callbacks.popleft())
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback
ret = callback()
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper
return callback(*args)
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped
ret = fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data
self._on_frame_data(_websocket_mask(self._frame_mask, data))
File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data
handled_future = self._handle_message(opcode, data)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message
return self._run_callback(self.handler.on_message, decoded)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback
result = callback(*args, **kwargs)
File "C:\src\SonOTA\sonota.py", line 168, in on_message
"acknowledging / answering...")
Message: '~~~ device sent action request, '
Arguments: ('acknowledging / answering...',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Python\lib\logging\__init__.py", line 992, in emit
msg = self.format(record)
File "C:\Python\lib\logging\__init__.py", line 838, in format
return fmt.format(record)
File "C:\Python\lib\logging\__init__.py", line 575, in format
record.message = record.getMessage()
File "C:\Python\lib\logging\__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\src\SonOTA\sonota.py", line 676, in <module>
main()
File "C:\src\SonOTA\sonota.py", line 672, in main
stage2()
File "C:\src\SonOTA\sonota.py", line 614, in stage2
tornado.ioloop.IOLoop.instance().start()
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start
self._run_callback(self._callbacks.popleft())
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback
ret = callback()
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper
return callback(*args)
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped
ret = fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data
self._on_frame_data(_websocket_mask(self._frame_mask, data))
File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data
handled_future = self._handle_message(opcode, data)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message
return self._run_callback(self.handler.on_message, decoded)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback
result = callback(*args, **kwargs)
File "C:\src\SonOTA\sonota.py", line 168, in on_message
"acknowledging / answering...")
Message: '~~~ device sent action request, '
Arguments: ('acknowledging / answering...',)
~~~~ query
{
"error": 0,
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"params": 0
}
Sending file: /ota/image_user2-0x81000.bin
200 GET /ota/image_user2-0x81000.bin?deviceid=1000088487&ts=880268351&sign=a0bc36fe2fe0c41068e8fb45c67c7fa4e7df4e50ca8bdaae554286731679ebe1 (192.168.1.66) 703.15ms
<< WEBSOCKET INPUT
<< {
"error": 0,
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"sequence": "1509689170396"
}
~~~ device acknowledged our action request (seq 1509689170396) with error code 0
<< WEBSOCKET INPUT
<< {
"error": 0,
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"sequence": "1509689170474"
}
~~~ device acknowledged our action request (seq 1509689170474) with error code 0
<< WEBSOCKET INPUT
<< {
"error": 0,
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"sequence": "1509689170583"
}
~~~ device acknowledged our action request (seq 1509689170583) with error code 0
<< WEBSOCKET INPUT
<< {
"error": 0,
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"sequence": "1509689170677"
}
~~~ device acknowledged our action request (seq 1509689170677) with error code 0
<< WEBSOCKET INPUT
<< {
"error": 0,
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"sequence": "1509689170755"
}
~~~ device acknowledged our action request (seq 1509689170755) with error code 0
.<< WEBSOCKET INPUT
<< {
"error": 404,
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"sequence": "1509689170974"
}
~~~ device acknowledged our action request (seq 1509689170974) with error code 404
..........................<< WEBSOCKET INPUT
<< {
"userAgent": "device",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a",
"deviceid": "1000088487",
"action": "update",
"params": {
"switches": [
{
"switch": "off",
"outlet": 0
},
{
"switch": "off",
"outlet": 1
},
{
"switch": "on",
"outlet": 2
},
{
"switch": "off",
"outlet": 3
}
],
"fwVersion": "1.3.0",
"rssi": -72
}
}
--- Logging error ---
Traceback (most recent call last):
File "C:\Python\lib\logging\__init__.py", line 992, in emit
msg = self.format(record)
File "C:\Python\lib\logging\__init__.py", line 838, in format
return fmt.format(record)
File "C:\Python\lib\logging\__init__.py", line 575, in format
record.message = record.getMessage()
File "C:\Python\lib\logging\__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\src\SonOTA\sonota.py", line 676, in <module>
main()
File "C:\src\SonOTA\sonota.py", line 672, in main
stage2()
File "C:\src\SonOTA\sonota.py", line 614, in stage2
tornado.ioloop.IOLoop.instance().start()
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start
self._run_callback(self._callbacks.popleft())
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback
ret = callback()
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper
return callback(*args)
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped
ret = fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data
self._on_frame_data(_websocket_mask(self._frame_mask, data))
File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data
handled_future = self._handle_message(opcode, data)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message
return self._run_callback(self.handler.on_message, decoded)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback
result = callback(*args, **kwargs)
File "C:\src\SonOTA\sonota.py", line 168, in on_message
"acknowledging / answering...")
Message: '~~~ device sent action request, '
Arguments: ('acknowledging / answering...',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Python\lib\logging\__init__.py", line 992, in emit
msg = self.format(record)
File "C:\Python\lib\logging\__init__.py", line 838, in format
return fmt.format(record)
File "C:\Python\lib\logging\__init__.py", line 575, in format
record.message = record.getMessage()
File "C:\Python\lib\logging\__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\src\SonOTA\sonota.py", line 676, in <module>
main()
File "C:\src\SonOTA\sonota.py", line 672, in main
stage2()
File "C:\src\SonOTA\sonota.py", line 614, in stage2
tornado.ioloop.IOLoop.instance().start()
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 832, in start
self._run_callback(self._callbacks.popleft())
File "C:\Python\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback
ret = callback()
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\iostream.py", line 562, in wrapper
return callback(*args)
File "C:\Python\lib\site-packages\tornado\stack_context.py", line 316, in wrapped
ret = fn(*args, **kwargs)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 875, in _on_masked_frame_data
self._on_frame_data(_websocket_mask(self._frame_mask, data))
File "C:\Python\lib\site-packages\tornado\websocket.py", line 912, in _on_frame_data
handled_future = self._handle_message(opcode, data)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 938, in _handle_message
return self._run_callback(self.handler.on_message, decoded)
File "C:\Python\lib\site-packages\tornado\websocket.py", line 494, in _run_callback
result = callback(*args, **kwargs)
File "C:\src\SonOTA\sonota.py", line 168, in on_message
"acknowledging / answering...")
Message: '~~~ device sent action request, '
Arguments: ('acknowledging / answering...',)
~~~~ update
{
"error": 0,
"deviceid": "1000088487",
"apikey": "46f5246f-3a14-4e36-8ceb-41062e8c8a2a"
}
..
*** IMPORTANT! ***
** AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process.
** ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network.
This server should automatically be allocated the IP address: 192.168.4.2.
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.
..............................
*** IMPORTANT! ***
** AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process.
** ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network.
This server should automatically be allocated the IP address: 192.168.4.2.
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.
..............................
*** IMPORTANT! ***
** AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process.
** ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network.
This server should automatically be allocated the IP address: 192.168.4.2.
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.
..........
sillyfrog commented 7 years ago

I have received a sonoff dual that was having the same issue, but it is worked perfectly to me here (on both Mac and Windows).

My next guess is maybe the AP is causing issues as several people have tried different devices.

It maybe worth trying to set up your PC as an AP and have the sonoff connect to that, I'm not sure the best way to do this but it should be possible in a number of different setups. Or if you have a different AP available, testing that as well. I have tried on two APs here, but they are both fairly high end.

@Joeyhza it looks like you're getting a trace back in tornado, which is not something I have seen, but there is new logging. If you can try running the following to make sure it's up-to-date, it may help, however this issue looks different to the others: pip3 install --user --upgrade tornado

PS: when uploading logs, if people would drag and drop the log file to the post it will send it as an attachment rather than in-line, making it easier to view.

Joeyhza commented 7 years ago

Thanks @SillyFrog

I have run the pop command. Says requirement already up to date

kevinshane commented 7 years ago

Hi @sillyfrog I am stuck at "Once "FinalStage" has gone away, you can stop this program" and many continue running "dots" many times, the shell shows many words like this: 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 ........................... here is the log file debug_1509806600.log could u please take a look at this? why it continue running like 20 times and it still keep running, does the program connected to the internet to download something? can I have the "offline" stuff prepare first so that it don't go online to download stuff?? thanks

kevinshane commented 7 years ago

Hi @sillyfrog here is the screenshot of this, I still connected to the finalstage ssid, and the shell keeps poping up those words like... forever... it looks like no error at all but...I don't know what's happening dots

thefathefa commented 7 years ago

I think you can controlC the flash script, power cycle the sonoff and connect to a SSID like sonoff-xxxx, no password. The you'll get access to the UI, and you'll be able to change the Wifi SSID and passwords to what you like.

I have to do that every time.

Le sam. 4 nov. 2017 à 16:05, kevinshane notifications@github.com a écrit :

Hi @sillyfrog https://github.com/sillyfrog here is the screenshot of this, I still connected to the finalstage ssid, and the shell keeps poping up those words like... forever... it looks like no error at all but...I don't know what's happening [image: dots] https://user-images.githubusercontent.com/10471026/32406501-9766c96a-c1b4-11e7-9c1e-c5a94b5e0a53.jpg

— 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-341903684, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae5YX3LxCOTVwtTw4e4XgNRQZqqo2KHsks5szH0tgaJpZM4PfDB2 .

kevinshane commented 7 years ago

hi @thefathefa thank you for your reply, however I currently connected to the wifi ssid is called "finalstage", I can't find a ssid like "sonoff-xxx" or something else, exacept what it shows is only a "finalstage" and the other one is my router wifi ssid, also I don't know how to access to the web ui? Is this ip: 192.168.4.1??