mirko / SonOTA

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

Hang on at stage2 with sonoff th10 v2.6.0 #146

Closed szabogyula closed 5 years ago

szabogyula commented 5 years ago

The sonoff does not start the download of the image at the stage 2. Some TCP connection traffic is detectabe but nothing else. I attach the wireshark summary lines. Can you give me some further tips?

debug:

2018-09-01 16:38:09,108: DEBUG: Current IPs: ['192.168.0.103']
2018-09-01 16:38:10,066: INFO: Using the following configuration:
2018-09-01 16:38:10,067: INFO:  Server IP Address: 192.168.0.103
2018-09-01 16:38:10,067: INFO:  WiFi SSID: szabohq
2018-09-01 16:38:10,067: INFO:  WiFi Password: **********
2018-09-01 16:38:10,067: INFO: Platform: darwin
2018-09-01 16:38:10,076: INFO: ** Now connect via WiFi to your Sonoff device.
2018-09-01 16:38:10,076: INFO: ** Please change into the ITEAD WiFi network (ITEAD-100001XXXX). The default password is 12345678.
2018-09-01 16:38:10,076: INFO: To reset the Sonoff to defaults, press the button for 7 seconds and the light will start flashing rapidly.
2018-09-01 16:38:10,076: INFO: ** This application should be kept running and will wait until connected to the Sonoff...
2018-09-01 16:38:20,126: DEBUG: Current IPs: ['10.10.7.2']
2018-09-01 16:38:20,129: DEBUG: ~~ Connection attempt
2018-09-01 16:38:20,129: DEBUG: >> HTTP GET /10.10.7.1/device
2018-09-01 16:38:20,141: DEBUG: << {
2018-09-01 16:38:20,142: DEBUG:     "deviceid": "100022052d",
2018-09-01 16:38:20,142: DEBUG:     "apikey": "946e7429-a0a3-406e-9892-93333c8bb691",
2018-09-01 16:38:20,142: DEBUG:     "accept": "post"
2018-09-01 16:38:20,142: DEBUG: }
2018-09-01 16:38:20,142: DEBUG: >> HTTP POST /10.10.7.1/ap
2018-09-01 16:38:20,143: DEBUG: >> {
2018-09-01 16:38:20,143: DEBUG:     "version": 4,
2018-09-01 16:38:20,143: DEBUG:     "ssid": "szabohq",
2018-09-01 16:38:20,143: DEBUG:     "password": "**********",
2018-09-01 16:38:20,143: DEBUG:     "serverName": "192.168.0.103",
2018-09-01 16:38:20,143: DEBUG:     "port": 8443
2018-09-01 16:38:20,143: DEBUG: }
2018-09-01 16:38:20,318: DEBUG: << {
2018-09-01 16:38:20,318: DEBUG:     "error": 0
2018-09-01 16:38:20,318: DEBUG: }
2018-09-01 16:38:20,318: INFO: ~~ Provisioning completed
2018-09-01 16:38:20,319: INFO: Starting stage2...
2018-09-01 16:38:20,327: INFO: ** The IP address of <serve_host> (192.168.0.103) is not assigned to any interface on this machine.
2018-09-01 16:38:20,329: INFO: ** Please change WiFi network to szabohq and make sure 192.168.0.103 is being assigned to your WiFi interface.
2018-09-01 16:38:20,329: INFO: ** This application should be kept running and will wait until connected to the WiFi...
2018-09-01 16:38:32,359: DEBUG: Current IPs: []
2018-09-01 16:38:36,369: DEBUG: Current IPs: ['192.168.0.103']
2018-09-01 16:38:36,370: INFO: ~~ Starting web server (HTTP port: 8080, HTTPS port 8443)
2018-09-01 16:38:36,375: DEBUG: Using selector: KqueueSelector
2018-09-01 16:38:36,379: INFO: ~~ Waiting for device to connect
2018-09-01 16:38:36,382: INFO: *** IMPORTANT! ***
2018-09-01 16:38:36,383: INFO: ** AFTER the first download is COMPLETE, with in a minute or so you should connect to the new SSID "FinalStage" to finish the process.
2018-09-01 16:38:36,383: INFO: ** ONLY disconnect when the new "FinalStage" SSID is visible as an available WiFi network.
2018-09-01 16:38:36,383: INFO: This server should automatically be allocated the IP address: 192.168.4.2.
2018-09-01 16:38:36,383: INFO: If you have successfully connected to "FinalStage" and this is not the IP Address you were allocated, please ensure no other device has connected, and reboot your Sonoff.
2018-09-01 16:38:44,413: DEBUG: Current IPs: []
2018-09-01 16:38:54,434: DEBUG: Current IPs: ['192.168.0.103']
2018-09-01 16:39:25,780: INFO: Quitting.

wireshark summary export:

╰─$ cat wireshark.txt 
No.     Time           Source                Destination           Protocol Length Info
     70 5.632049       192.168.0.148         192.168.0.103         TCP      58     27515 → 8443 [SYN] Seq=0 Win=5840 Len=0 MSS=1460
     71 5.632219       192.168.0.103         192.168.0.148         TCP      58     8443 → 27515 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1360
     72 5.646044       192.168.0.148         192.168.0.103         TCP      138    27515 → 8443 [PSH, ACK] Seq=1 Ack=1 Win=5840 Len=84
     73 5.646135       192.168.0.103         192.168.0.148         TCP      54     8443 → 27515 [ACK] Seq=1 Ack=85 Win=65535 Len=0
     74 5.662812       192.168.0.103         192.168.0.148         TCP      1073   8443 → 27515 [PSH, ACK] Seq=1 Ack=85 Win=65535 Len=1019
     75 5.673535       192.168.0.148         192.168.0.103         TCP      56     27515 → 8443 [FIN, ACK] Seq=85 Ack=1020 Win=4821 Len=0
     76 5.673635       192.168.0.103         192.168.0.148         TCP      54     8443 → 27515 [ACK] Seq=1020 Ack=86 Win=65535 Len=0
     77 5.673986       192.168.0.103         192.168.0.148         TCP      54     8443 → 27515 [FIN, ACK] Seq=1020 Ack=86 Win=65535 Len=0
     78 5.679842       192.168.0.148         192.168.0.103         TCP      56     27515 → 8443 [ACK] Seq=86 Ack=1021 Win=4820 Len=0
    131 12.677337      192.168.0.148         192.168.0.103         TCP      58     29322 → 8443 [SYN] Seq=0 Win=5840 Len=0 MSS=1460
    132 12.677488      192.168.0.103         192.168.0.148         TCP      58     8443 → 29322 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1360
    133 12.754101      192.168.0.148         192.168.0.103         TCP      138    29322 → 8443 [PSH, ACK] Seq=1 Ack=1 Win=5840 Len=84
    134 12.754194      192.168.0.103         192.168.0.148         TCP      54     8443 → 29322 [ACK] Seq=1 Ack=85 Win=65535 Len=0
    135 12.756588      192.168.0.103         192.168.0.148         TCP      1073   8443 → 29322 [PSH, ACK] Seq=1 Ack=85 Win=65535 Len=1019
    136 12.765802      192.168.0.148         192.168.0.103         TCP      56     29322 → 8443 [FIN, ACK] Seq=85 Ack=1020 Win=4821 Len=0
    137 12.765888      192.168.0.103         192.168.0.148         TCP      54     8443 → 29322 [ACK] Seq=1020 Ack=86 Win=65535 Len=0
    138 12.766239      192.168.0.103         192.168.0.148         TCP      54     8443 → 29322 [FIN, ACK] Seq=1020 Ack=86 Win=65535 Len=0
    139 12.773638      192.168.0.148         192.168.0.103         TCP      56     29322 → 8443 [ACK] Seq=86 Ack=1021 Win=4820 Len=0
sillyfrog commented 5 years ago

This is the known issue with the current Sonoff firmware - please see the home page more more info.

rzr commented 5 years ago

What Firware is your sonoff device ? mine is 2.6.0 it seems to use: https://www.espressif.com/sites/default/files/documentation/esp-touch_user_guide_en.pdf