jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
879 stars 159 forks source link

Unxecpected payload from device #372

Closed yaronb1 closed 1 year ago

yaronb1 commented 1 year ago

I am unable to connect to an RGB bulb. I have set the bulb up through the tuya app and can control it through there.

When i run the tinytuya wizard, it finds the device and gives it a local key and id however when i poll the device it says there is no response(even though it finds its ip) poll for the device appears as follows

[bar_t2] - 192.168.1.134 - No Response

when i run the tinytuya scan it again shows the id and key but brings up the following error:

Access rejected by 192.168.1.134: Unexpected Payload from Device

if i run status() command in python i get the same unexpected payload error

bar.status() {'Error': 'Unexpected Payload from Device', 'Err': '904', 'Payload': None}

if i use the tinytuya.cloud i can connect and control the device properly. but i would like to have local control as well

I would love to understand why the device fails to communicate with tuinytuya and fix the problem. any insight will be appreciated Thank you

uzlonewolf commented 1 year ago

Usually that means the local key or protocol version is wrong. Does the local key contain any special characters such as \ or "?

I'd start by rebooting the device (disconnect power for 10-15 seconds) and if that doesn't work, remove then re-add it to the app and run the wizard again.

yaronb1 commented 1 year ago

Usually that means the local key or protocol version is wrong. Does the local key contain any special characters such as \ or "?

I'd start by rebooting the device (disconnect power for 10-15 seconds) and if that doesn't work, remove then re-add it to the app and run the wizard again.

The local key does contain special characters ( a few of the actually) My first go to solution was to reboot the device. However the same error occurs. And the new local key that it produces, after rebooting the device, also has special characters

uzlonewolf commented 1 year ago

What is the output of python3 -m tinytuya scan -d?

yaronb1 commented 1 year ago

What is the output of python3 -m tinytuya scan -d?

/usr/lib/python3/dist-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (1.26.8) or chardet (3.0.4) doesn't match a supported version! warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported " TinyTuya [1.3.1]

is my tinytuya not updated? thats embarrasing

uzlonewolf commented 1 year ago

Yeah, that's a pretty ancient version. If the device is v3.4 or v3.5 then it's no surprise that it's not working as support for them was only recently added. I'd update and try again.

yaronb1 commented 1 year ago

so after updateting tinytuya to the recent version i am able to get info from the device throught the wizard and scan and have full local control. Thanks for the help and sorry for the noob issue

uzlonewolf commented 1 year ago

No worries. Glad you got it sorted out!