mirko / SonOTA

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

No "FinalStage" #32

Closed serger2000 closed 6 years ago

serger2000 commented 6 years ago

Hello! My Sonoff model TH16 Tried few times but no luck

Select IP address of the WiFi interface: 0: 192.168.88.208 Select IP address [0]: 0 WiFi SSID: m5_home WiFi Password: xxxxxxxx

Using the following configuration: Server IP Address: 192.168.88.208 WiFi SSID: m5_home WiFi Password: xxxxxxxx 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... ............................~~ Connection attempt

HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device << { "deviceid": "100006af71", "apikey": "71ec9611-82ad-44c4-a915-120a084a7f11", "accept": "post" } HTTP POST /10.10.7.1/ap %s { "version": 4, "ssid": "m5_home", "password": "xxxxxxxx", "serverName": "192.168.88.208", "port": 8443 } << { "error": 0 } ~~ Provisioning completed Starting stage2... The IP address of (192.168.88.208) is not assigned to any interface on this machine. Please change WiFi network to m5_home and make sure 192.168.88.208 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. .......2017-10-08 22:59:25,125 (WARNING) 404 POST /inform (192.168.88.169) 5.43ms ....................... 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. .........2017-10-08 23:01:28,443 (WARNING) 404 POST /inform (192.168.88.169) 0.96ms ..................... 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. ..........2017-10-08 23:03:31,505 (WARNING) 404 POST /inform (192.168.88.169) 0.96ms .................... 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. ..............................

and so on Please help)

thefathefa commented 6 years ago

Did you check all possible firewalls on your PC which could block the process?

Le dim. 8 oct. 2017 à 22:08, serger2000 notifications@github.com a écrit :

Hello! My Sonoff model TH16 Tried few times but no luck

Select IP address of the WiFi interface: 0: 192.168.88.208 Select IP address [0]: 0 WiFi SSID: m5_home WiFi Password: xxxxxxxx

Using the following configuration: Server IP Address: 192.168.88.208 WiFi SSID: m5_home WiFi Password: xxxxxxxx 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... ............................~~ Connection attempt

HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device timed out HTTP GET /10.10.7.1/device << { "deviceid": "100006af71", "apikey": "71ec9611-82ad-44c4-a915-120a084a7f11", "accept": "post" } HTTP POST /10.10.7.1/ap %s { "version": 4, "ssid": "m5_home", "password": "xxxxxxxx", "serverName": "192.168.88.208", "port": 8443 } << { "error": 0 } ~~ Provisioning completed Starting stage2... The IP address of (192.168.88.208) is not assigned to any interface on this machine. Please change WiFi network to m5_home and make sure 192.168.88.208 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. .......2017-10-08 22:59:25,125 (WARNING) 404 POST /inform (192.168.88.169) 5.43ms ....................... 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. .........2017-10-08 23:01:28,443 (WARNING) 404 POST /inform (192.168.88.169) 0.96ms ..................... 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. ..........2017-10-08 23:03:31,505 (WARNING) 404 POST /inform (192.168.88.169) 0.96ms .................... 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. ..............................

and so on Please help)

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

serger2000 commented 6 years ago

Yes, but I'm using mac+airport

serger2000 commented 6 years ago

And I can see webserver on both ports from other devices at this wifi image-1

sillyfrog commented 6 years ago

That is weird as there are so many timeouts for the initial /device calls. I suspect that's the cause of the other issues - to start with, I would suggest doing a full restart of everything (WiFi, computer etc), and double checking if you have any software that may mess with traffic (eg: anti-virus, if you do, disable, and reboot your Mac).

serger2000 commented 6 years ago

Thanks for advise. Now I have something new)

Select IP address of the WiFi interface: 0: 192.168.88.208 Select IP address [0]: 0 WiFi SSID: m5_home WiFi Password: xxxxxxxx

Using the following configuration: Server IP Address: 192.168.88.208 WiFi SSID: m5_home WiFi Password: xxxxxxxx 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... ................................~~ Connection attempt

HTTP GET /10.10.7.1/device << { "deviceid": "100006af71", "apikey": "71ec9611-82ad-44c4-a915-120a084a7f11", "accept": "post" } HTTP POST /10.10.7.1/ap %s { "version": 4, "ssid": "m5_home", "password": "xxxxxxxx", "serverName": "192.168.88.208", "port": 8443 } << { "error": 0 } ~~ Provisioning completed Starting stage2... The IP address of (192.168.88.208) is not assigned to any interface on this machine. Please change WiFi network to m5_home and make sure 192.168.88.208 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) Traceback (most recent call last): File "sonota.py", line 647, in main() File "sonota.py", line 643, in main stage2() File "sonota.py", line 571, in stage2 app.listen(DEFAULT_PORT_HTTP) File "/Users/tinkov/Library/Python/3.6/lib/python/site-packages/tornado/web.py", line 1943, in listen server.listen(port, address) File "/Users/tinkov/Library/Python/3.6/lib/python/site-packages/tornado/tcpserver.py", line 142, in listen sockets = bind_sockets(port, address=address) File "/Users/tinkov/Library/Python/3.6/lib/python/site-packages/tornado/netutil.py", line 197, in bind_sockets sock.bind(sockaddr) OSError: [Errno 48] Address already in use MacBook-Pro:SonOTA-master tinkov$

sillyfrog commented 6 years ago

That last error OSError: [Errno 48] Address already in use suggests there is another service already running on port 8080 or 8443, if you stop that service for the moment, you should be OK.

serger2000 commented 6 years ago

Everething same. Last errors where due to Unify Center. Now Im back to previus log) As I see at wifi explorer, after "Starting stage2..." itead ssid apearing several times, but as I understand it must have name FinalStage?

2017-10-09 11 03 24
sillyfrog commented 6 years ago

If you have stopped the service that was using the port, you should be able to just start again. If you are still having issue, please send through the logs again. Good luck.

serger2000 commented 6 years ago

Yes, here it is%

Last login: Mon Oct 9 11:15:32 on console MacBook-Pro:SonOTA-master tinkov$ sudo python3 sonota.py Password: Select IP address of the WiFi interface: 0: 192.168.88.208 Select IP address [0]: 0 WiFi SSID: m5_home WiFi Password: ****

Using the following configuration: Server IP Address: 192.168.88.208 WiFi SSID: m5_home 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... ........................~~ Connection attempt

HTTP GET /10.10.7.1/device << { "deviceid": "100006af71", "apikey": "71ec9611-82ad-44c4-a915-120a084a7f11", "accept": "post" } HTTP POST /10.10.7.1/ap %s { "version": 4, "ssid": "m5_home", "password": "****", "serverName": "192.168.88.208", "port": 8443 } << { "error": 0 } ~~ Provisioning completed Starting stage2... The IP address of (192.168.88.208) is not assigned to any interface on this machine. Please change WiFi network to m5_home and make sure 192.168.88.208 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. .............................. 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. ..............................

and so on no SSID FinalStage availible

sillyfrog commented 6 years ago

Can you see the Sonoff connect to your network? If you have access to the DHCP server logs or similar you should be able to see it (this stage the stock Sonoff firmware is trying to connect to your computer).

The other thing you can try is running it with --legacy - unfortunately until it connects again you can't see the version (which would let us know if that's required). If that works, if you can send the output (which will include the romVersion), I can put on the wiki so others know what does and does not work.

Cheers.

serger2000 commented 6 years ago

Yes, 192.168.88.70 in list I should try: sudo python3 sonota.py --legacy ?

2017-10-09 12 32 42
sillyfrog commented 6 years ago

Correct, try sudo python3 sonota.py --legacy. Good luck!

serger2000 commented 6 years ago

here we are, but no luck(

Select IP address of the WiFi interface: 0: 192.168.88.208 Select IP address [0]: 0 WiFi SSID: m5_home WiFi Password: *****

Using the following configuration: Server IP Address: 192.168.88.208 WiFi SSID: m5_home 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... .........~~ Connection attempt

HTTP GET /10.10.7.1/device << { "deviceid": "100006af71", "apikey": "71ec9611-82ad-44c4-a915-120a084a7f11", "accept": "post" } HTTP POST /10.10.7.1/ap %s { "version": 4, "ssid": "m5_home", "password": "*****", "serverName": "192.168.88.208", "port": 443 } << { "error": 0 } ~~ Provisioning completed Starting stage2... The IP address of (192.168.88.208) is not assigned to any interface on this machine. Please change WiFi network to m5_home and make sure 192.168.88.208 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 443) ~~ 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": "192.168.88.208", "port": 443 } 2017-10-09 13:39:29,870 (INFO) 200 POST /dispatch/device (192.168.88.70) 1.91ms 2017-10-09 13:39:29,883 (INFO) 101 GET /api/ws (192.168.88.70) 0.98ms 2017-10-09 13:39:29,884 (DEBUG) << WEBSOCKET OPEN 2017-10-09 13:39:29,887 (DEBUG) << WEBSOCKET INPUT 2017-10-09 13:39:29,887 (DEBUG) << { "userAgent": "device", "apikey": "71ec9611-82ad-44c4-a915-120a084a7f11", "deviceid": "100006af71", "action": "register", "version": 2, "romVersion": "2.0.1", "model": "PSA-BHA-GL", "ts": 733 }


2017-10-09 13:39:29,888 (INFO) We are dealing with a PSA-BHA-GL model.
~~~~ register
{
"error": 0,
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"config": {
"hb": 1,
"hbInterval": 145
}
}
2017-10-09 13:39:29,893 (DEBUG) << WEBSOCKET INPUT
2017-10-09 13:39:29,894 (DEBUG) << {
"userAgent": "device",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"deviceid": "100006af71",
"action": "date"
}
~~~ device sent action request,  acknowledging / answering...
~~~~ date
{
"error": 0,
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"date": "2017-10-09T13:39:29.894Z"
}
2017-10-09 13:39:29,898 (DEBUG) << WEBSOCKET INPUT
2017-10-09 13:39:29,898 (DEBUG) << {
"userAgent": "device",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"deviceid": "100006af71",
"action": "update",
"params": {
"switch": "off",
"fwVersion": "2.0.1",
"rssi": -84,
"staMac": "5C:CF:7F:9F:25:59"
}
}
~~~ device sent action request,  acknowledging / answering...
~~~~ update
{
"error": 0,
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"userAgent": "app",
"sequence": "1507545569899",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"userAgent": "app",
"sequence": "1507545569899",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"userAgent": "app",
"sequence": "1507545569899",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"userAgent": "app",
"sequence": "1507545569900",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"userAgent": "app",
"sequence": "1507545569900",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "upgrade",
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"userAgent": "app",
"sequence": "1507545569907",
"ts": 0,
"params": {
"binList": [
{
"downloadUrl": "http://192.168.88.208:8080/ota/image_user1-0x01000.bin",
"digest": "2d6a44bbbd8303ed1f1fe8594e615d527779568141e77fe8917afb72f58d57dc",
"name": "user1.bin"
},
{
"downloadUrl": "http://192.168.88.208:8080/ota/image_user2-0x81000.bin",
"digest": "cfb790b67496e865b40acf93653425f6d7010f3097fd3cbaf6457d7b6ec08b35",
"name": "user2.bin"
}
],
"model": "PSA-BHA-GL",
"version": "23.42.5"
}
}
2017-10-09 13:39:29,908 (DEBUG) << WEBSOCKET INPUT
2017-10-09 13:39:29,908 (DEBUG) << {
"userAgent": "device",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"deviceid": "100006af71",
"action": "query",
"params": [
"timers",
"targets",
"mainSwitch",
"deviceType"
]
}
~~~ device sent action request,  acknowledging / answering...
~~~~ query
{
"error": 0,
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"params": 0
}
2017-10-09 13:39:29,912 (DEBUG) << WEBSOCKET INPUT
2017-10-09 13:39:29,912 (DEBUG) << {
"error": 0,
"userAgent": "device",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"deviceid": "100006af71",
"sequence": "1507545569900"
}
2017-10-09 13:39:29,913 (DEBUG) ~~~ device acknowledged our action request (seq 1507545569900) with error code 0
Sending file: /ota/image_user2-0x81000.bin
2017-10-09 13:39:29,952 (DEBUG) << WEBSOCKET INPUT
2017-10-09 13:39:29,952 (DEBUG) << {
"error": 404,
"userAgent": "device",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"deviceid": "100006af71",
"sequence": "1507545569907"
}
2017-10-09 13:39:29,952 (DEBUG) ~~~ device acknowledged our action request (seq 1507545569907) with error code 404
2017-10-09 13:39:29,955 (INFO) 200 GET /ota/image_user2-0x81000.bin?deviceid=100006af71&ts=585293993&sign=87d78a6a18cae4647e26ae7e533a38207d493228116e31a09c84e0a2e3b9fb54 (192.168.88.70) 33.39ms
2017-10-09 13:39:30,865 (DEBUG) << WEBSOCKET INPUT
2017-10-09 13:39:30,866 (DEBUG) << {
"userAgent": "device",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57",
"deviceid": "100006af71",
"action": "update",
"params": {
"currentTemperature": "26",
"currentHumidity": "46",
"sensorType": "AM2301"
}
}
~~~ device sent action request,  acknowledging / answering...
~~~~ update
{
"error": 0,
"deviceid": "100006af71",
"apikey": "bbea280e-3c1e-4f9c-b79f-f4c1568c6e57"
}
......
*** 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.
..........^C2017-10-09 13:41:01,720 (INFO) Quitting.
sillyfrog commented 6 years ago

The "error": 404 is something that we've been trying to fix, and thought we had it sorted.

The --legacy has worked in the past with that version (v2.0.1, see here https://github.com/mirko/SonOTA/wiki ).

Now things are getting to the later stages, I'm keen to see if we can resolve this, if you can try running again (same options) on the git SHA 4ff55988b9d53eec461c71825fe9f76ce5f6a5e6 (to do this, go to the directory, and run git checkout 4ff55988b9d53eec461c71825fe9f76ce5f6a5e6, and to go back, run git checkout master).

This may mean that we need a hybrid of the older and newer flash versions - but I think I can make this automatic, it'll just require some testing - unfortunately none of the hardware I have has ever had this issue so it's a bit of testing what does and does not work.

Let me know how you go.

PS: The fall back plan is to use the eWeLink app to update to the latest version, bit it would be great if that was not needed...

serger2000 commented 6 years ago

Difference was only in .bin files?

Log: Select IP address of the WiFi interface: 0: 192.168.88.208 Select IP address [0]: 0 WiFi SSID: m5_home WiFi Password: ****

Using the following configuration: Server IP Address: 192.168.88.208 WiFi SSID: m5_home 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... ........................~~ Connection attempt

HTTP GET /10.10.7.1/device << { "deviceid": "100006af71", "apikey": "71ec9611-82ad-44c4-a915-120a084a7f11", "accept": "post" } HTTP POST /10.10.7.1/ap %s { "version": 4, "ssid": "m5_home", "password": "****", "serverName": "192.168.88.208", "port": 443 } << { "error": 0 } ~~ Provisioning completed Starting stage2... The IP address of (192.168.88.208) is not assigned to any interface on this machine. Please change WiFi network to m5_home and make sure 192.168.88.208 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 443) ~~ 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": "192.168.88.208", "port": 443 } 2017-10-09 14:45:38,017 (INFO) 200 POST /dispatch/device (192.168.88.70) 3.48ms 2017-10-09 14:45:38,044 (INFO) 101 GET /api/ws (192.168.88.70) 0.75ms 2017-10-09 14:45:38,044 (DEBUG) << WEBSOCKET OPEN 2017-10-09 14:45:38,055 (DEBUG) << WEBSOCKET INPUT 2017-10-09 14:45:38,056 (DEBUG) << { "userAgent": "device", "apikey": "71ec9611-82ad-44c4-a915-120a084a7f11", "deviceid": "100006af71", "action": "register", "version": 2, "romVersion": "2.0.1", "model": "PSA-BHA-GL", "ts": 470 }


2017-10-09 14:45:38,056 (INFO) We are dealing with a PSA-BHA-GL model.
~~~~ register
{
"error": 0,
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"config": {
"hb": 1,
"hbInterval": 145
}
}
2017-10-09 14:45:38,152 (DEBUG) << WEBSOCKET INPUT
2017-10-09 14:45:38,152 (DEBUG) << {
"userAgent": "device",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"deviceid": "100006af71",
"action": "date"
}
~~~ device sent action request,  acknowledging / answering...
~~~~ date
{
"error": 0,
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"date": "2017-10-09T14:45:38.152Z"
}
2017-10-09 14:45:38,163 (DEBUG) << WEBSOCKET INPUT
2017-10-09 14:45:38,163 (DEBUG) << {
"userAgent": "device",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"deviceid": "100006af71",
"action": "update",
"params": {
"switch": "off",
"fwVersion": "2.0.1",
"rssi": -81,
"staMac": "5C:CF:7F:9F:25:59"
}
}
~~~ device sent action request,  acknowledging / answering...
~~~~ update
{
"error": 0,
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"userAgent": "app",
"sequence": "1507549538164",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"userAgent": "app",
"sequence": "1507549538164",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"userAgent": "app",
"sequence": "1507549538165",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"userAgent": "app",
"sequence": "1507549538165",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
{
"action": "update",
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"userAgent": "app",
"sequence": "1507549538165",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
{
"action": "upgrade",
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"userAgent": "app",
"sequence": "1507549538169",
"ts": 0,
"params": {
"binList": [
{
"downloadUrl": "http://192.168.88.208:8080/ota/image_user1-0x01000.bin",
"digest": "1c467a7cb4058df22046ffbc0312272aed324a74e91b9b39e1bf2aef88eeca8a",
"name": "user1.bin"
},
{
"downloadUrl": "http://192.168.88.208:8080/ota/image_user2-0x81000.bin",
"digest": "804e4f4a2316fbcc2c6b46aff53c24b9be252bf3fd8cf3ea2243e4475a052658",
"name": "user2.bin"
}
],
"model": "PSA-BHA-GL",
"version": "23.42.5"
}
}
2017-10-09 14:45:38,170 (DEBUG) << WEBSOCKET INPUT
2017-10-09 14:45:38,171 (DEBUG) << {
"userAgent": "device",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"deviceid": "100006af71",
"action": "query",
"params": [
"timers",
"targets",
"mainSwitch",
"deviceType"
]
}
~~~ device sent action request,  acknowledging / answering...
~~~~ query
{
"error": 0,
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"params": 0
}
Sending file: /ota/image_user2-0x81000.bin
.2017-10-09 14:45:38,571 (DEBUG) << WEBSOCKET INPUT
2017-10-09 14:45:38,571 (DEBUG) << {
"error": 404,
"userAgent": "device",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"deviceid": "100006af71",
"sequence": "1507549538169"
}
2017-10-09 14:45:38,571 (DEBUG) ~~~ device acknowledged our action request (seq 1507549538169) with error code 404
2017-10-09 14:45:38,572 (INFO) 200 GET /ota/image_user2-0x81000.bin?deviceid=100006af71&ts=1286148116&sign=d1c39a3336c11276cc5cb2d8b1a88e30c33b41a965b42186a2a074feb1591978 (192.168.88.70) 326.72ms
2017-10-09 14:45:38,845 (DEBUG) << WEBSOCKET INPUT
2017-10-09 14:45:38,845 (DEBUG) << {
"userAgent": "device",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0",
"deviceid": "100006af71",
"action": "update",
"params": {
"currentTemperature": "26",
"currentHumidity": "45",
"sensorType": "AM2301"
}
}
~~~ device sent action request,  acknowledging / answering...
~~~~ update
{
"error": 0,
"deviceid": "100006af71",
"apikey": "1681d06d-5863-40d4-a1ca-f6fcf959a3a0"
}
......
*** 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.
..................^C2017-10-09 14:47:28,349 (INFO) Quitting.
sillyfrog commented 6 years ago

Correct, they use a different flash mode (which was the best guess as to the errors).

In that case you may need to update to the latest firmware in the app, then try again.

serger2000 commented 6 years ago

Done. Which bins to try?

sillyfrog commented 6 years ago

The latest should be good. Do a pull first as I have made some more minor update in the last few hours as well.

Cheers.

serger2000 commented 6 years ago

Everything great! Thanks! I was scaread a litle bit about usbttl flashing)

sillyfrog commented 6 years ago

Awesome! One day I’ll be able to replicate that 404 issue.

Glad it’s sorted in the end.