Open t3h-n00b opened 3 years ago
Does this happen every single time, or only sometimes?
Yep, so far haven’t been successful with these devices (other than to get the ID/Key values)
Did you try omitting the protocol version parameter / setting it to 3.1 (the default)?
Are you able to capture the network traffic between your device and app to see if the packets look similar to what TuyAPI sends?
Yep, tried using no protocol version, and then iterating from 3.1-3.3.
I’ll try and capture some traffic over the next couple of days
Alrighty, I've had a look at the wireshark data.
The responses received seem pretty accurate.
TuyAPI seems to be sending a SYN message to Port 6668 on the device, receive an ACK, then send an ACK.
It then seems to send (with protocol set to 3.3):
000055aa000000010000000a000000887dd4c8fc414aaaef33337a15ca02b6162d8854fee5583d05aff271bc5d1871bf0be2d365fe5623eaf7b0f83fcbafb848d5e9cae2a2a1a135c9ea60ff636ce0533d8b92947c046e26c7f63614790fa7a18a9c5920d82d37a9eca0c7a182a74feaab3a98c2cf2c10ac3d72d7021a64cfe630423d71bf69b0007acf53d0d569bf1629afc2fe0000aa55
which looks pretty similar to the data that it is receiving later.
For protocol set to 3.1:
000055aa000000010000000a000000837b2267774964223a2262666266363537373030636634663639376566766c77222c226465764964223a2262666266363537373030636634663639376566766c77222c2274223a2231353936363139393535222c22647073223a7b7d2c22756964223a2262666266363537373030636634663639376566766c77227d1dde88cb0000aa55
Next command it sends is:
000055aa000000040000000900000008387f5d2e0000aa55
Not sure how much help this is...
Those are the packets that TuyAPI sends, correct? Could you also try recording the packets the official app sends to see how similar they are?
Hi guys, I got same error with tuya plug socket. Here is the tcpdump from app. dump.zip
@nug321 have you retried getting the local key / relinking your device to confirm it's not an issue with that? The key changes every time you relink it / add it to the app.
Yep, checked the keys twice.
@nug321 can you post / email me the local key for that dump you posted earlier so I can try to decode it?
@nug321 I emailed back with a possible solution. Feel free to post here with the results.
Any news regards to this I'm having the same error?
@chrisca26 @nug321 hasn't responded to my last email yet.
It looks like their uid
parameter may be different then their id
/devId
parameter. Not sure if that helps, but I can help investigate further if you email me a packet capture (+ device ID and key) of the app controlling your device.
@nug321 thank you for the additional information. I'm not really sure what's going on at this point; but more data would be helpful. @chrisca26 are you able to provide a packet capture?
How would I go about to do a packet capture? Wireshark and filter on the IP?
Yep. 👍
I seem to getting an error too. Not sure if the error is related:
` TuyAPI Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('json obj data unvalid')
TuyAPI at TuyaDevice.emit (events.js:303:17)
TuyAPI at Socket.
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('json obj data unvalid')
at TuyaDevice.emit (events.js:303:17)
at Socket.
Hi,
Facing an issue with some new LED Strip Controllers. Originally bought these expecting to find an ESP inside to flash with Tasmota, but they use a W600 chip that rules that out...
Version of TuyAPI is 5.3.1.
I noted some similar issues (#23, #64), however all of those seemed to be resolved with protocol changes and some time ago - so wondering if this is yet another new protocol or similar...
Example Set commands:
Example Get Command