Getting 404 on Sonoff Dual during Stage 2
Closed this issue · 11 comments
Hi @sillyfrog,
First of all, I would like to thanks to your great work, that help for every one can use to OTA update easily.
I have my owned both Basic
and Dual
version, and it works perfectly on the Basic
, however it doesn't not on the Dual
.
Could you pls help me out?
Here is the full logs of the process:
Using the following configuration:
Server IP Address: 192.168.1.228
WiFi SSID: PATAHA-AP
WiFi Password: abcdefghij
** 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": "1000088350",
"apikey": "0019e33f-d781-4bc2-87da-9751165960db",
"accept": "post"
}
>> HTTP POST /10.10.7.1/ap
>> %s {
"version": 4,
"ssid": "PATAHA-AP",
"password": "abcdefghij",
"serverName": "192.168.1.228",
"port": 8443
}
<< {
"error": 0
}
~~ Provisioning completed
Starting stage2...
** The IP address of <serve_host> (192.168.1.228) is not assigned to any interface on this machine.
** Please change WiFi network to PATAHA-AP and make sure 192.168.1.228 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": "192.168.1.228",
"port": 8443
}
2017-08-26 22:30:19,640 (INFO) 200 POST /dispatch/device (192.168.1.156) 8.96ms
2017-08-26 22:30:19,809 (INFO) 101 GET /api/ws (192.168.1.156) 0.75ms
2017-08-26 22:30:19,809 (DEBUG) << WEBSOCKET OPEN
2017-08-26 22:30:19,816 (DEBUG) << WEBSOCKET INPUT
2017-08-26 22:30:19,817 (DEBUG) << {
"userAgent": "device",
"apikey": "0019e33f-d781-4bc2-87da-9751165960db",
"deviceid": "1000088350",
"action": "register",
"version": 2,
"romVersion": "1.3.0",
"model": "PSB-B04-GL",
"ts": 755
}
~~~ device sent action request, acknowledging / answering...
2017-08-26 22:30:19,817 (INFO) We are dealing with a PSB-B04-GL model.
~~~~ register
>> {
"error": 0,
"deviceid": "1000088350",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"config": {
"hb": 1,
"hbInterval": 145
}
}
2017-08-26 22:30:19,825 (DEBUG) << WEBSOCKET INPUT
2017-08-26 22:30:19,825 (DEBUG) << {
"userAgent": "device",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"deviceid": "1000088350",
"action": "date"
}
~~~ device sent action request, acknowledging / answering...
~~~~ date
>> {
"error": 0,
"deviceid": "1000088350",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"date": "2017-08-26T22:30:19.825Z"
}
2017-08-26 22:30:19,834 (DEBUG) << WEBSOCKET INPUT
2017-08-26 22:30:19,834 (DEBUG) << {
"userAgent": "device",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"deviceid": "1000088350",
"action": "update",
"params": {
"switches": [
{
"switch": "off",
"outlet": 0
},
{
"switch": "off",
"outlet": 1
},
{
"switch": "off",
"outlet": 2
},
{
"switch": "off",
"outlet": 3
}
],
"configure": [
{
"startup": "off",
"outlet": 0
},
{
"startup": "off",
"outlet": 1
},
{
"startup": "off",
"outlet": 2
},
{
"startup": "off",
"outlet": 3
}
],
"fwVersion": "1.3.0",
"rssi": -41
}
}
~~~ device sent action request, acknowledging / answering...
~~~~ update
>> {
"error": 0,
"deviceid": "1000088350",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900"
}
>> {
"action": "update",
"deviceid": "1000088350",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"userAgent": "app",
"sequence": "1503761419835",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
>> {
"action": "update",
"deviceid": "1000088350",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"userAgent": "app",
"sequence": "1503761419836",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
>> {
"action": "update",
"deviceid": "1000088350",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"userAgent": "app",
"sequence": "1503761419836",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
>> {
"action": "update",
"deviceid": "1000088350",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"userAgent": "app",
"sequence": "1503761419836",
"ts": 0,
"params": {
"switch": "on"
},
"from": "hackepeter"
}
>> {
"action": "update",
"deviceid": "1000088350",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"userAgent": "app",
"sequence": "1503761419836",
"ts": 0,
"params": {
"switch": "off"
},
"from": "hackepeter"
}
>> {
"action": "upgrade",
"deviceid": "1000088350",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"userAgent": "app",
"sequence": "1503761419839",
"ts": 0,
"params": {
"binList": [
{
"downloadUrl": "http://192.168.1.228:8080/ota/image_user1-0x01000.bin",
"digest": "97fe70d737390bbde7b8d208c79d590e29fc76962623c7bd198ee210210ea616",
"name": "user1.bin"
},
{
"downloadUrl": "http://192.168.1.228:8080/ota/image_user2-0x81000.bin",
"digest": "e6d0cbb641542bd0a27e6c4628fc9331f1f5d3ac3afa42c9307569cf4d70fcdc",
"name": "user2.bin"
}
],
"model": "PSB-B04-GL",
"version": "23.42.5"
}
}
2017-08-26 22:30:19,902 (INFO) 200 GET /ota/image_user2-0x81000.bin?deviceid=1000088350&ts=1344887256&sign=c9f1be539f9ec4c24c1e8637ee76dfffbce9d017e4aad87fdf8e321d4443290d (192.168.1.156) 40.46ms
2017-08-26 22:30:20,463 (DEBUG) << WEBSOCKET INPUT
2017-08-26 22:30:20,463 (DEBUG) << {
"error": 404,
"userAgent": "device",
"apikey": "490d0f02-a6f8-40cf-a6e3-eb1c88d3f900",
"deviceid": "1000088350",
"sequence": "1503761419839"
}
2017-08-26 22:30:20,463 (DEBUG) ~~~ device acknowledged our action request (seq 1503761419839) 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.
That's a bit weird - it looks like it failed the initial download...
I have done this on a Dual and a Basic (that's all I have), and it did work OK. What's the current status of it? Does it have an AP active? Which one? Is it connecting to the WiFi?
Cheers.
Yes, somehow it can not connect to the host to download image,
It has wifi AP ITEADxxx
that works ok and I can connect to it through EWelink
app
In additional it's 2017 version, does that related to anything?
As you can see
2017-08-26 22:30:20,463 (DEBUG) ~~~ device acknowledged our action request (seq 1503761419839) with error code 404
It can contact with the virtual server
but the file is not found with 404
response
I just had a thought, what OS are you on and what version of Python do you have (and what is the version of the current Sonoff firmware)?
It's MacOs 10 and Python 3.6
Sonoff Dual 1.3.0 firmware
Thanks for supporing
Hmm... I did all my dev and testing on a Mac, so I don't think it's that. However, mine came with firmware version 1.5.5 (I think, it was 1.5.x). So maybe connect using the eWeLink app first and update the normal way with Sonoff, then try this again.
Good luck!
PS: Let me know how you go and what version you upgraded to. We get the "romVersion" (that we just throw away at the moment), but I maybe able to make it alert if it is not a minimum version (when I get some more Sonoff's).
Huh, It shows 1.3.0 version on the EWeLink app
Are we talking on the Dual
version?
Also I have updated successful with Basic
1.5.5.
How can we update device firmware of Dual
to 1.5.5? Dont know how
Here the steps I did
- Install dependences
- Connect to normal wifi
- Run script
- Connect to ITEAD wifi
- Connect to normal wifi to start update (It's failed here)
- It should show
FinalStage
wifi to connect if previous step was succeed but it doesn't
PS: I also tried the original script of @mirko repo https://github.com/mirko/SonOTA
but no luck, still the same error 404
Unfortunately I don't remember the version for the Dual, I thought it was the same, but I could be very wrong (looking it the App now, it says version 1.1.0, but my Dual is flashed, so I don't know if this is accurate).
To update, in the EWeLink app, click on the ">" next to the Dual device, then the "..." in the top right, then "Setting". I would be interested what version it says is available.
This project is now part of https://github.com/mirko/SonOTA - so I'm closing this here. If you are still having issues please open an issue there and I'll take a look if I can.
In my experience (as per the linked tickets), I think an update to the stock Sonoff firmware should help sort this out.
Cheers.
Sorry for late of reporting the result.
I finally can solve that problem by build up another webserver for serve static firmwares. It basically a docker based nginx with static files serving.
Seem like there are many people faced that 404 issue on the original repo.
Just let you know, :D
Thanks.