Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@dole SonOTA]# ./sonota.py --legacy
- Select IP address of the WiFi interface:
- 0: 192.168.7.229
- 1: 192.168.122.1
- Select IP address [0]: 0
- WiFi SSID: Pjotr
- WiFi Password:
- Using the following configuration:
- Server IP Address: 192.168.7.229
- WiFi SSID: Pjotr
- 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": "100012f1af",
- "apikey": "67c74dbd-ea50-4e15-b7da-4c39d7f5079d",
- "accept": "post"
- }
- >> HTTP POST /10.10.7.1/ap
- >> %s {
- "version": 4,
- "ssid": "Pjotr",
- "password": "",
- "serverName": "192.168.7.229",
- "port": 443
- }
- << {
- "error": 0
- }
- ~~ Provisioning completed
- Starting stage2...
- ** The IP address of <serve_host> (192.168.7.229) is not assigned to any interface on this machine.
- ** Please change WiFi network to Pjotr and make sure 192.168.7.229 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.7.229",
- "port": 443
- }
- 2017-10-21 12:17:22,192 (INFO) 200 POST /dispatch/device (192.168.7.226) 2.72ms
- 2017-10-21 12:17:22,200 (INFO) 101 GET /api/ws (192.168.7.226) 0.83ms
- 2017-10-21 12:17:22,200 (DEBUG) << WEBSOCKET OPEN
- 2017-10-21 12:17:22,203 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:22,204 (DEBUG) << {
- "userAgent": "device",
- "apikey": "67c74dbd-ea50-4e15-b7da-4c39d7f5079d",
- "deviceid": "100012f1af",
- "action": "register",
- "version": 2,
- "romVersion": "2.0.2",
- "model": "PSC-B01-GL",
- "ts": 920
- }
- ~~~ device sent action request, acknowledging / answering...
- 2017-10-21 12:17:22,204 (INFO) We are dealing with a PSC-B01-GL model.
- ~~~~ register
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "config": {
- "hb": 1,
- "hbInterval": 145
- }
- }
- 2017-10-21 12:17:22,209 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:22,210 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "date"
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ date
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "date": "2017-10-21T12:17:22.210Z"
- }
- 2017-10-21 12:17:22,214 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:22,215 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "update",
- "params": {
- "switch": "off",
- "power": "0",
- "fwVersion": "2.0.2",
- "rssi": -45,
- "staMac": "D0:27:00:25:E0:AE"
- }
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ update
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881"
- }
- >> {
- "action": "update",
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "userAgent": "app",
- "sequence": "1508581042215",
- "ts": 0,
- "params": {
- "switch": "off"
- },
- "from": "hackepeter"
- }
- >> {
- "action": "update",
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "userAgent": "app",
- "sequence": "1508581042216",
- "ts": 0,
- "params": {
- "switch": "on"
- },
- "from": "hackepeter"
- }
- >> {
- "action": "update",
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "userAgent": "app",
- "sequence": "1508581042216",
- "ts": 0,
- "params": {
- "switch": "off"
- },
- "from": "hackepeter"
- }
- >> {
- "action": "update",
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "userAgent": "app",
- "sequence": "1508581042216",
- "ts": 0,
- "params": {
- "switch": "on"
- },
- "from": "hackepeter"
- }
- >> {
- "action": "update",
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "userAgent": "app",
- "sequence": "1508581042216",
- "ts": 0,
- "params": {
- "switch": "off"
- },
- "from": "hackepeter"
- }
- >> {
- "action": "upgrade",
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "userAgent": "app",
- "sequence": "1508581042221",
- "ts": 0,
- "params": {
- "binList": [
- {
- "downloadUrl": "http://192.168.7.229:8080/ota/image_user1-0x01000.bin",
- "digest": "1c467a7cb4058df22046ffbc0312272aed324a74e91b9b39e1bf2aef88eeca8a",
- "name": "user1.bin"
- },
- {
- "downloadUrl": "http://192.168.7.229:8080/ota/image_user2-0x81000.bin",
- "digest": "804e4f4a2316fbcc2c6b46aff53c24b9be252bf3fd8cf3ea2243e4475a052658",
- "name": "user2.bin"
- }
- ],
- "model": "PSC-B01-GL",
- "version": "23.42.5"
- }
- }
- 2017-10-21 12:17:22,222 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:22,222 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- Sending file: /ota/image_user2-0x81000.bin
- 2017-10-21 12:17:22,271 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:22,271 (DEBUG) << {
- "error": 404,
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "sequence": "1508581042221"
- }
- 2017-10-21 12:17:22,271 (DEBUG) ~~~ device acknowledged our action request (seq 1508581042221) with error code 404
- 2017-10-21 12:17:22,272 (INFO) 200 GET /ota/image_user2-0x81000.bin?deviceid=100012f1af&ts=715669847&sign=e999b743b30e984b0a65294c553dec3b4118e658fca08ffe964af06fa2689678 (192.168.7.226) 32.77ms
- .2017-10-21 12:17:24,617 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:24,618 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ...2017-10-21 12:17:29,623 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:29,624 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ..2017-10-21 12:17:34,631 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:34,632 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ...2017-10-21 12:17:39,654 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:39,654 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ..2017-10-21 12:17:44,661 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:44,662 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ...2017-10-21 12:17:49,669 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:49,670 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ..2017-10-21 12:17:54,680 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:54,680 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ...2017-10-21 12:17:59,685 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:17:59,686 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- .
- *** 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-21 12:18:04,694 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:04,694 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ...2017-10-21 12:18:09,703 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:09,703 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ..2017-10-21 12:18:14,714 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:14,714 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ...2017-10-21 12:18:19,720 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:19,721 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ..2017-10-21 12:18:24,728 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:24,729 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ..2017-10-21 12:18:26,983 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:26,983 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "update",
- "params": {
- "switch": "off",
- "power": "0",
- "rssi": -51
- }
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ update
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881"
- }
- .2017-10-21 12:18:29,736 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:29,737 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ...2017-10-21 12:18:35,133 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:35,133 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ..2017-10-21 12:18:40,139 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:40,139 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ...2017-10-21 12:18:45,147 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:45,148 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ..2017-10-21 12:18:50,156 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:50,156 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ...2017-10-21 12:18:55,327 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:18:55,327 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- ..2017-10-21 12:19:00,426 (DEBUG) << WEBSOCKET INPUT
- 2017-10-21 12:19:00,427 (DEBUG) << {
- "userAgent": "device",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "deviceid": "100012f1af",
- "action": "query",
- "params": [
- "timers",
- "timeZone"
- ]
- }
- ~~~ device sent action request, acknowledging / answering...
- ~~~~ query
- >> {
- "error": 0,
- "deviceid": "100012f1af",
- "apikey": "abf6d327-5ccf-4c8f-9f1f-d31dc1203881",
- "params": 0
- }
- .
- *** 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.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement