ct-Open-Source / tuya-convert

A collection of scripts to flash Tuya IoT devices to alternative firmwares
MIT License
4.54k stars 497 forks source link

Failing to flash smart plug that connects, with an endless loop #1098

Open AzzieDev opened 11 months ago

AzzieDev commented 11 months ago

Device name: YTE CZ001 Smart Plug, unknown firmware version since its been a while since I've installed the Smart Life app in case I ever had a chance to finally do Tuya-Convert.

Ends up in a loop similar to #1058 . I'm worried it's issue #430 but want to confirm first since my logs don't seem to match it.

My plug switches from a blinking blue LED to a pink one once the tool is run, and then red when the tool is terminated, and next boot goes back to blinking blue to pair.

Thanks

Logs:

mqtt:

1689487785: New client connected from 127.0.0.1:60879 as auto-3F4772FD-5CE6-2506-D43A-5D588353795F (p2, c1, k60).
1689487785: No will message specified.
1689487785: Sending CONNACK to auto-3F4772FD-5CE6-2506-D43A-5D588353795F (0, 0)
1689487785: Received PUBLISH from auto-3F4772FD-5CE6-2506-D43A-5D588353795F (d0, q0, r0, m0, 'smart/device/in/0520001968c63ac65258', ... (147 bytes))
1689487785: Received DISCONNECT from auto-3F4772FD-5CE6-2506-D43A-5D588353795F
1689487785: Client auto-3F4772FD-5CE6-2506-D43A-5D588353795F disconnected.

psk

new client on port 443 from 10.42.42.40:41480
could not establish sslpsk socket: [SSL: NO_SHARED_CIPHER] no shared cipher (_ssl.c:1123)
don't panic this is probably just your phone!
new client on port 443 from 10.42.42.40:41486
could not establish sslpsk socket: [SSL: NO_SHARED_CIPHER] no shared cipher (_ssl.c:1123)
don't panic this is probably just your phone!

web

[I 230716 02:09:12 web:2344] 304 GET / (10.42.42.40) 3.03ms
[I 230716 02:09:12 web:2344] 302 GET /favicon.ico (10.42.42.40) 4.16ms
[I 230716 02:09:12 web:2344] 304 GET / (10.42.42.40) 8.27ms
[I 230716 02:09:12 web:2344] 302 GET /generate_204 (10.42.42.40) 4.13ms
[I 230716 02:09:13 web:2344] 302 GET /generate_204 (10.42.42.40) 2.27ms

POST /gw.json?a=s.gw.reset&gwId=0520001968c63ac65258&t=1689487765&sign=735d6cffb29b3524715027275372bd3c
Host: 10.42.42.1
Ty-Ua: HW
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 0

Answer generic (s.gw.reset)
reply {"t":1689487765,"e":false,"success":true}
[I 230716 02:09:25 web:2344] 200 POST /gw.json?a=s.gw.reset&gwId=0520001968c63ac65258&t=1689487765&sign=735d6cffb29b3524715027275372bd3c (10.42.42.29) 4.34ms

POST /gw.json?a=s.gw.token.get&gwId=0520001968c63ac65258&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":2,"source":"ap","path":"broadcast"}}&t=3&v=3.0&sign=7b85c6c067d3c31ff708f1f82739aed6
Host: a.gw.tuyaus.com
Ty-Ua: HW
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 0

Answer s.gw.token.get
reply {"t":1689487775,"e":false,"success":true,"result":{"gwApiUrl":"http://10.42.42.1/gw.json","stdTimeZone":"-05:00","mqttRanges":"","timeZone":"-05:00","httpsPSKUrl":"https://10.42.42.1/gw.json","mediaMqttUrl":"10.42.42.1","gwMqttUrl":"10.42.42.1","dstIntervals":[]}}
[I 230716 02:09:35 web:2344] 200 POST /gw.json?a=s.gw.token.get&gwId=0520001968c63ac65258&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":2,"source":"ap","path":"broadcast"}}&t=3&v=3.0&sign=7b85c6c067d3c31ff708f1f82739aed6 (10.42.42.29) 78.27ms

POST /gw.json?a=s.gw.dev.pk.active&gwId=0520001968c63ac65258&other={"token":"00000000"}&t=1689487775&v=3.0&sign=0d06e9c31b0cd5d414f0d56570f78ba0
Host: 10.42.42.1
Ty-Ua: HW
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 357

payload B2398C5358876BAA2008FA9224106940C01FFFEED9FC1725E6F45466E4B82C580E5F0E257E767B2B50CEAE09D84C28C6086F52926187A9BD28D0B5D8CEC7A05885146984793FDB549AC7C4B670949B202FE3CD4F5630F6450C67BFD048595D96FA08CAAC4A0BFFC15442C71622AAFBEE082A3667021289D5A515F6713941A6CE03AEA2F78B9FC2747F07849F393FDD9A25752D9DD2973DCA1FEEFF3DC96265B9B53A721BB5F819B3003462C012400FF7
Answer s.gw.dev.pk.active
reply {"t":1689487775,"e":false,"success":true,"result":{"schema":"[{\"mode\":\"rw\",\"property\":{\"type\":\"bool\"},\"id\":1,\"type\":\"obj\"}]","uid":"00000000000000000000","devEtag":"0000000000","secKey":"0000000000000000","schemaId":"0000000000","localKey":"0000000000000000"}}
TRIGGER UPGRADE IN 10 SECONDS
[I 230716 02:09:35 web:2344] 200 POST /gw.json?a=s.gw.dev.pk.active&gwId=0520001968c63ac65258&other={"token":"00000000"}&t=1689487775&v=3.0&sign=0d06e9c31b0cd5d414f0d56570f78ba0 (10.42.42.29) 8.25ms
encoding {"data":{"gwId":"0520001968c63ac65258"},"protocol":15,"s":1523715,"t":1689487785} using protocol 2.1
b'2.148c9888ca7cea306t5inCMDHpcJKQpxfOe2RbV0x19q+bo1VCBBrh/GSMkZ2R3B7OSB5shM5+X+XDu1yJsm5uMafEvnzLLz/1MQ4vy0qpu1MmUBEqVmsCO6m8yndg4SXZL9kLEC9aqKXAOwI'

POST /gw.json?a=s.gw.reset&gwId=0520001968c63ac65258&t=1689487812&sign=8cb2eff7d02289cb6ffa68f81f25ea0f
Host: 10.42.42.1
Ty-Ua: HW
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 0

Answer generic (s.gw.reset)
reply {"t":1689487812,"e":false,"success":true}
[I 230716 02:10:12 web:2344] 200 POST /gw.json?a=s.gw.reset&gwId=0520001968c63ac65258&t=1689487812&sign=8cb2eff7d02289cb6ffa68f81f25ea0f (10.42.42.29) 3.65ms

wifi

wlan0: AP-STA-CONNECTED 68:c6:3a:c6:52:58
wlan0: AP-STA-DISCONNECTED 68:c6:3a:c6:52:58
jonny190 commented 2 months ago

Same