Git Product home page Git Product logo

smartplug's People

Contributors

adapt0 avatar xmb5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smartplug's Issues

Compiled firmware

Can you post the compiled firmware, I'm having trouble compiling it

status?

I know its a work in progress, but what state is the project in? Do you have it working? Is it just on and off or does it do power monitoring as well with the new firmware?

user2.bin getting written but not activating

I'm halfway through debugging an issue similar to the behaviour seen here: #4 (comment)

Specifically that the image download finishes and then nothing seems to happen after that. Unlike the above mentioned comment though these switches are one of the original ones and contain a firmware version (1.89) that has been known to work previously.

Known relevant details:

  • Using mac (11.1 Big Sur) with airkiss mode
  • master branch
  • build with pio core (installed 2021-06, build log attached)
  • switch firmVersion: '1.89'

Log from the hijack server:

$ node ./index.js -p <redacted>  
Using en0 192.168.88.254
Looking for local WiFi interface (use --ssid & --bssid to override)
Using SSID "<redacted> " (BSSID: <redacted> , Local IP: 192.168.88.254)
Starting web server on TCP port 17273
Listening for devices on UDP port 18266
Sending Smart Config...
Connected to device 192.168.88.253
<= {"uri":"/beginConfigRequest","wifiID":"<redacted> ","wifiBssid":"","wifiPassword":"<redacted> ","account":"0","key":1623597219849,"serverIP":"192.168.88.254"}
0000 257b22757269223a222f626567696e436f6e6669675265706c79222c22657272
0020 223a2230227d
Accepted WebSocket from ::ffff:192.168.88.253
{ account: '0',
  id: '01cb455a-4714-45e6-bc5b-<redacted> ',
  deviceName: 'vesync_wifi_outlet',
  deviceVersion: '1.5',
  deviceVersionCode: 5,
  type: 'wifi-switch',
  apptype: 'switch-measure',
  firmName: 'cosytek_firm_a',
  firmVersion: '1.89',
  firmVersionCode: 89,
  key: 2147483647,
  relay: 'open' }
Initiating device upgrade
::ffff:192.168.88.253 - - [13/Jun/2021:15:13:41 +0000] "HEAD /user2.bin HTTP/1.1"
::ffff:192.168.88.253 - - [13/Jun/2021:15:13:41 +0000] "HEAD /user2.bin HTTP/1.1" 200 332548 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 "
::ffff:192.168.88.253 - - [13/Jun/2021:15:13:44 +0000] "GET /user2.bin HTTP/1.1"
::ffff:192.168.88.253 - - [13/Jun/2021:15:13:45 +0000] "GET /user2.bin HTTP/1.1" 200 332548 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 "
{ account: '0',
  id: '01cb455a-4714-45e6-bc5b-<redacted> ',
  deviceName: 'vesync_wifi_outlet',
  deviceVersion: '1.5',
  deviceVersionCode: 5,
  type: 'wifi-switch',
  apptype: 'switch-measure',
  firmName: 'cosytek_firm_a',
  firmVersion: '1.89',
  firmVersionCode: 89,
  key: 0,
  relay: 'open' }
(node:44916) UnhandledPromiseRejectionWarning: undefined
(node:44916) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:44916) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
{ uri: '/report', e: '17', t: 'b7' }
{ uri: '/ka', rssi: -26 }
{ uri: '/report', e: '24', t: 'b6' }

Log from the serial interface:

scandone
SC_STATUS_FIND_CHANNEL
TYPE: ESPTOUCH
SC_STATUS_GETTING_SSID_PSWD
SC_TYPE:SC_TYPE_ESPTOUCH
F|pswd: <redacted>
F|ssid: <redacted>
SC_STATUS_LINK
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt

connected with <redacted>, channel 1
dhcp client start...
event 0
connect to ssid <redacted>, channel 1
ip:192.168.88.253,mask:255.255.255.0,gw:192.168.88.1
event 3
ip:192.168.88.253,mask:255.255.255.0,gw:192.168.88.1
cs_wifi_on_station_connected, status:5
cs_wifi_on_station_connected, null callback
cs_configer_on_sniffer_completed, state:1
softap_tcp_server_listen
webserver_recv, length:163
found uri
uri value:/beginConfigRequest
wifiID:<redacted>
wifiBssid:
wifi password:<redacted>
account:0
key:2147483647
serverIP:192.168.88.254
cs_configer_on_app_begin_config
send_device_config_status_to_app
start dhcp
cs_switch_client_do_reconnect
cs_switch_client_do_reconnect, now connect to server
cs_switch_client_start ...
cs_switch_client_start ok


....

cs_timer_schedule_timer_today
start_time has passed
end_time has passed too
cs_timer_schedule end, valid timer:2, sch-ing timer:0, sch-new timer:0
cs_switch_on_login_completed, err:0
cs_set_last_error, error:0
cs_configer_on_login_ok
cs_switch_client_recv_cb
re-start beacon timer:180000
ws got text msg
cs_server_handler_on_message, data length:74
found uri
uri value:/upgrade
execute_upgrade_command
upgrade url:http://192.168.88.254:17273
upgrade newVersion:2.00
system_upgrade_start
upgrade_connect 39752
upgrade_connect_cb
pusrdata = HTTP/1.1 200 OK
Content-Length: 332548
Date: Sun, 13 Jun 2021 15:13:41 GMT
Connection: close


sumlength = 332548
sec_block 82
..................................................................................pusrdata = HTTP/1.1 400 Bad Request
Connection: close


server do not support HEAD method now send GET message
upgrade_get_sum_disconcb 36096
erase sector=129 ok
erase sector=130 ok
erase sector=131 ok
erase sector=132 ok
erase sector=133 ok


...

erase sector=194 ok
erase sector=195 ok
erase sector=196 ok
erase sector=197 ok
erase sector=198 ok
erase sector=199 ok
erase sector=200 ok
cs_timer_schedule_timer_today
start_time has passed
end_time has passed too
cs_timer_schedule_timer_today
start_time has passed
end_time has passed too
cs_timer_schedule end, valid timer:2, sch-ing timer:0, sch-new timer:0
erase sector=201 ok
erase sector=202 ok
erase sector=203 ok
erase sector=204 ok
erase sector=205 ok
erase sector=206 ok
erase sector=207 ok
erase sector=208 ok
erase sector=209 ok
erase sector=210 ok

ALL=82 sectors erase ok!
upgrade_connect_cb
sumlength = 332548
upgrade file download start.
totallen = 2816
totallen = 4276
totallen = 5736
totallen = 7196
totallen = 8656
totallen = 10116
totallen = 11576



...

totallen = 324016
totallen = 325476
totallen = 326936
totallen = 328396
totallen = 329856
cs_timer_schedule_timer_today
start_time has passed
end_time has passed too
cs_timer_schedule_timer_today
start_time has passed
end_time has passed too
cs_timer_schedule end, valid timer:2, sch-ing timer:0, sch-new timer:0
totallen = 331316
totallen = 332548
upgrade file download finished.
flash_crc = 2746132336
img_crc = 1548834960
upgrade_check
cs_switch_on_upgrade_completed, result:1
register device info json length:291
cs_switch_client_send, WSPacket length is:299
re-start beacon timer:180000
cs_switch_client_sent_cb
free sent buffer
cs_switch_client_recv_cb
re-start beacon timer:180000
ws got text msg
cs_server_handler_on_message, data length:116
found uri
uri value:/loginReply
on_login_reply
error:0

build log:

bootstrap-firmware <redacted>$ ~/.platformio/penv/bin/pio run
Processing app (platform: espressif8266; board: esp12e; framework: esp8266-rtos-sdk)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Platform Manager: Installing espressif8266
Platform Manager: espressif8266 @ 3.0.0 has been installed!
The platform 'espressif8266' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.                                                                                                                       
Tool Manager: Installing platformio/toolchain-xtensa @ ~1.40802.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: toolchain-xtensa @ 1.40802.0 has been installed!
Tool Manager: Installing platformio/framework-esp8266-rtos-sdk @ >=1.5.0-beta
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: framework-esp8266-rtos-sdk @ 1.5.0-beta.5 has been installed!
Tool Manager: Installing platformio/tool-esptool @ <2
Tool Manager: tool-esptool @ 1.413.0 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.30000.0
Downloading  [####################################]  100%
Tool Manager: tool-esptoolpy @ 1.30000.201119 has been installed!
Tool Manager: Installing platformio/tool-scons @ ~4.40100.2
Tool Manager: tool-scons @ 4.40100.2 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp12e.html
PLATFORM: Espressif 8266 (3.0.0) > Espressif ESP8266 ESP-12E
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-esp8266-rtos-sdk 1.5.0-beta.5 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - toolchain-xtensa 1.40802.0 (4.8.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/app/src/http_connection.o
Compiling .pio/build/app/src/task_blink.o
Compiling .pio/build/app/src/task_connect.o
Compiling .pio/build/app/src/task_upgrade.o
Compiling .pio/build/app/src/user_main.o
Compiling /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/lib/driver/driver/gpio.o
Compiling /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/lib/driver/driver/hw_timer.o
Compiling /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/lib/driver/driver/i2c_master.o
Compiling /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/lib/driver/driver/spi_interface.o
Compiling /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/lib/driver/driver/uart.o
In file included from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/ip_addr.h:38:0,
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/netbuf.h:37,                                                                                           
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/api.h:41,                                                                                              
                 from src/net_conn.h:16,                                                                                                                                                                    
                 from src/http_connection.h:12,                                                                                                                                                             
                 from src/http_connection.cpp:10:                                                                                                                                                           
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:23: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                       ^                                                                                                                                                                                    
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:31: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                               ^                                                                                                                                                                            
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:40: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                                        ^                                                                                                                                                                   
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:49: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                                                 ^                                                                                                                                                          
In file included from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/ip_addr.h:39:0,                                                                                        
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/netbuf.h:37,                                                                                           
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/api.h:41,                                                                                              
                 from src/net_conn.h:16,                                                                                                                                                                    
                 from src/http_connection.h:12,                                                                                                                                                             
                 from src/http_connection.cpp:10:                                                                                                                                                           
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:23: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                       ^                                                                                                                                                                                    
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:31: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                               ^                                                                                                                                                                            
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:40: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                        ^                                                                                                                                                                   
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:49: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                 ^                                                                                                                                                          
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:58: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                          ^                                                                                                                                                 
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:67: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                   ^                                                                                                                                        
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:76: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                            ^                                                                                                                               
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:85: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                                     ^                                                                                                                      
In file included from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/ip_addr.h:38:0,                                                                                        
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_misc.h:28,                                                                                         
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_common.h:96,                                                                                       
                 from src/task_connect.h:13,                                                                                                                                                                
                 from src/task_connect.cpp:10:                                                                                                                                                              
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:23: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                       ^                                                                                                                                                                                    
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:31: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                               ^                                                                                                                                                                            
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:40: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                                        ^                                                                                                                                                                   
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:49: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                                                 ^                                                                                                                                                          
In file included from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/ip_addr.h:38:0,                                                                                        
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_misc.h:28,                                                                                         
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_common.h:96,                                                                                       
                 from src/user_main.cpp:12:                                                                                                                                                                 
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:23: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                       ^                                                                                                                                                                                    
In file included from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/ip_addr.h:39:0,                                                                                        
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_misc.h:28,                                                                                         
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_common.h:96,                                                                                       
                 from src/task_connect.h:13,                                                                                                                                                                
                 from src/task_connect.cpp:10:                                                                                                                                                              
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:23: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                       ^                                                                                                                                                                                    
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:31: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                               ^                                                                                                                                                                            
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:31: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                               ^                                                                                                                                                                            
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:40: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                        ^                                                                                                                                                                   
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:49: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                 ^                                                                                                                                                          
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:40: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                                        ^                                                                                                                                                                   
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:58: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                          ^                                                                                                                                                 
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:49: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                                                 ^                                                                                                                                                          
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:67: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                   ^                                                                                                                                        
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:76: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                            ^                                                                                                                               
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:85: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                                     ^                                                                                                                      
In file included from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/ip_addr.h:38:0,                                                                                        
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_misc.h:28,                                                                                         
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_common.h:96,                                                                                       
                 from src/task_connect.h:13,                                                                                                                                                                
                 from src/task_upgrade.cpp:11:                                                                                                                                                              
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:23: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                       ^                                                                                                                                                                                    
In file included from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/ip_addr.h:39:0,                                                                                        
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_misc.h:28,                                                                                         
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_common.h:96,                                                                                       
                 from src/user_main.cpp:12:                                                                                                                                                                 
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:23: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                       ^                                                                                                                                                                                    
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:31: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                               ^                                                                                                                                                                            
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:31: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                               ^                                                                                                                                                                            
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:40: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                        ^                                                                                                                                                                   
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:40: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                                        ^                                                                                                                                                                   
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:49: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                 ^                                                                                                                                                          
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv4/lwip/ip4_addr.h:213:49: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F,             \                                                                                                                                   
                                                 ^                                                                                                                                                          
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:58: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                          ^                                                                                                                                                 
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:67: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                   ^                                                                                                                                        
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:76: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                            ^                                                                                                                               
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:85: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                                     ^                                                                                                                      
In file included from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/lwip/ip_addr.h:39:0,                                                                                        
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_misc.h:28,                                                                                         
                 from /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/espressif/esp_common.h:96,                                                                                       
                 from src/task_connect.h:13,                                                                                                                                                                
                 from src/task_upgrade.cpp:11:                                                                                                                                                              
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:23: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                       ^                                                                                                                                                                                    
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:31: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                               ^                                                                                                                                                                            
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:40: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                        ^                                                                                                                                                                   
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:49: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                 ^                                                                                                                                                          
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:58: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                          ^                                                                                                                                                 
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:67: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                   ^                                                                                                                                        
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:76: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                            ^                                                                                                                               
/Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/include/lwip/ipv6/lwip/ip6_addr.h:263:85: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]                                                                                                                                                                                                     
   LWIP_DEBUGF(debug, ("%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F, \                                                                                                           
                                                                                     ^                                                                                                                      
cc1: warning: command line option '-fno-threadsafe-statics' is valid for C++/ObjC++ but not for C [enabled by default]                                                                                      
cc1: warning: command line option '-fno-threadsafe-statics' is valid for C++/ObjC++ but not for C [enabled by default]                                                                                      
cc1: warning: command line option '-fno-threadsafe-statics' is valid for C++/ObjC++ but not for C [enabled by default]                                                                                      
cc1: warning: command line option '-fno-threadsafe-statics' is valid for C++/ObjC++ but not for C [enabled by default]                                                                                      
cc1: warning: command line option '-fno-threadsafe-statics' is valid for C++/ObjC++ but not for C [enabled by default]                                                                                      
Archiving /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/lib/libdriver.a
Indexing /Users/<redacted>/.platformio/packages/framework-esp8266-rtos-sdk/lib/libdriver.a
Linking .pio/build/app/firmware.elf
Linking .pio/build/app/user1.elf
Linking .pio/build/app/user2.elf
elf_to_user_bin([".pio/build/app/user1.elf"], [".pio/build/app/src/http_connection.o", ".pio/build/app/src/task_blink.o", ".pio/build/app/src/task_connect.o", ".pio/build/app/src/task_upgrade.o", ".pio/build/app/src/user_main.o"])
elf_to_user_bin([".pio/build/app/user2.elf"], [".pio/build/app/src/http_connection.o", ".pio/build/app/src/task_blink.o", ".pio/build/app/src/task_connect.o", ".pio/build/app/src/task_upgrade.o", ".pio/build/app/src/user_main.o"])
======================================================================================= [SUCCESS] Took 20.95 seconds =======================================================================================
hijacking-server <redacted>$ npm install
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

added 143 packages from 144 contributors and audited 143 packages in 1.946s
found 9 vulnerabilities (5 low, 1 moderate, 3 high)
  run `npm audit fix` to fix them, or `npm audit` for details


cp ../bootstrap-firmware/.pio/build/app/user*.bin assets/

Local Control?

Chris, first off, great work on this project!

I have a simple question and hoping you have an answer since you've basically got down to the bare-bones of this device.

Do you know if it's possible to control the device directly (not using a VeSync account) from the network it's joined to?

It has to be possible because this is what I've done and tested so far (ESW01-US):

  1. Install the VeSync app on an old cellphone
  2. When the app starts it asks you to sign-in to VeSync or Create an Account.
  3. I chose Create account, but on the top right of the next screen there's a convenient "Skip" option
  4. Next screen was setting up the device on the network.
  5. Once set up on the network, the app can turn it on and off, etc.

So, after extensive googling all I found was other python apps that leverage the VeSync server to issue commands (hence you need a VeSync account). That's not what I want. I'd prefer to lock down the device, not have to use the VeSync app at all, but still issue on/off (not interested in power monitoring or schedules atm) commands directly to the device as-is.

In your investigation did you find a default username / password the app uses to talk to the device? There must be one as the app works fine w/o an account.

I did a quick nmap scan of the TCP ports on the device and everything is closed:

sudo nmap -sT -p- 10.100.1.195

Starting Nmap 6.47 ( http://nmap.org ) at 2019-12-06 11:22 PST
Nmap scan report for 10.100.1.195
Host is up (0.0097s latency).
All 65535 scanned ports on 10.100.1.195 are closed

UDP port scanning is still running...

Maybe if all else fails creating a basic firmware for direct control via a simple API would work?

Thanks in advance and keep up the good work.

Marc

original firmware

is there a way to flash back the otiginal firmware?
i am currently running esphome on these smart outlets
tia
Miguel

running on linux

Hi Chris,
I would like to get this running on an Ubuntu workstation and use it to load different firmware.

Could this be easily done?

Hijack EU plug

Hi, I would like to ask for help with hijacking EU plugs. I own some ESW01-EU version plugs, and trying to flash it with alternative firmware. I have found guide on esphome but I can't disassemble plugs. Something in construction is changed so it's impossible to make it without damaging plug. After hours of browsing I have found this project which brings new hope to me :)

According to esphome guide https://esphome.io/cookbook/esw01-eu.html I can communicate with plug soldering some wires without removing PCB from plug case. However I can't locate PIO0 so can't turn ESP into flash mode :-(

As I can see from serial communication my FW version is 1.1.02

ESP8266 SDK version : 2.2.0(f28eaf2)
VeSync SDK version : 2.1.8
Flash-Size-Map: FLASH_SIZE_8M_MAP_512_512
User run area : user1
Device MAC : dc:4f:22:d0:98:89
Device channel : 1
Device type : 10AOutletEU.Firmware version : 1.1.02.

System started ...

mode : sta(dc:4f:22:d0:98:89)
add if0

after calling node ./index.js -s SSID -b BSSID -p password -i 192.168.133.x -d 192.168.4.1 i see somethin like this

Using SSID "xxxx" (BSSID: 00:00:00:00:00:00, Local IP: 192.168.133.226)
Starting web server on TCP port 17273
Attempting to connect to device 192.168.4.1
Connected to device 192.168.4.1
0000 498e3c762468c689c8e9793e1b040ad80385276ae4aa61eac22c3f98211fe3f3
0020 4fa4ab08199533880d0bc0d40a32f77f24234376048b0df0c81b237176ab26b2
0040 e844a15173a397d702bbed082f8e5562f9979b64b6434a689afbeec5a6e8ac48
0060 9c7c77572a659412cef81761aca41f89fae34a09deeb066e23721184159589e6
0080 6831d12ecb9ee7f753fbbf5239e1a967b0621cba82c614f418d1b94b26e8bb83
00a0 b0882f6f5fd1ff2bc58e496ee098c988
undefined:1
�<v$hƉ��y>

and Etekcity AP stop responding ...

I have tryed to update FW using VeSync APP but with no luck hijack output is the same, only changed thing is that the AP is still functional .

0000 498e3c762468c689c8e9793e1b040ad80385276ae4aa61eac22c3f98211fe3f3
0020 4fa4ab08199533880d0bc0d40a32f77f24234376048b0df0c81b237176ab26b2
0040 `e844a15173a397d702bbed082f8e5562f9979b64b6434a689afbeec5a6e8ac48`
0060 9c7c77572a659412cef81761aca41f89fae34a09deeb066e23721184159589e6
0080 6831d12ecb9ee7f753fbbf5239e1a967b0621cba82c614f418d1b94b26e8bb83
00a0 b0882f6f5fd1ff2bc58e496ee098c988
undefined:1
�<v$hƉ��y>
 

So it will be so good if somebody can help be to manage hijacking of this EU plugs.
thank you
mk

Use of hijack to install other firmwares

Is it possible to use the hijacking loader to load a different FW image (eg tasmota)? I'll be reading through the code later to see if I can figure it out, however a definitive answer would be appreciated.

ps. Great work on the hijack reverse engineering, I came across this while looking for a firmware dump to decompile for exactly the same reason, always nice when you find someone's already done it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.