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

Poll error #385

Closed Rafahorn03 closed 10 months ago

Rafahorn03 commented 1 year ago

Hi,

I'm having errors when I try to poll my devices (len:22).

It works when I disconnect them from power or when I reboot my router, but some hours later, it stops working.

My devices are Tuya Smart Plugs, I have 4 and it does not work.

When I try pinging them, it does not work either.

jasonacox commented 1 year ago

Some devices seem to disappear from the local network after a while but they do seem to stay connected to the cloud.

A few things I would try:

Rafahorn03 commented 12 months ago

I tried it. As you said, they disappear, when I ping them they don't response, but I can see them connected to my router and tuya app still working.

jasonacox commented 12 months ago

Do you have other Tuya devices that don't do this?

Also, if it is related to a bug we have seen with some Tuya devices, the arp broadcasts stop working. If your router show the MAC address for the Tuya device, you can attempt to do a forced arp mapping on the host running tinytuya:

# set the IP to MAC mapping
sudo arp -s 192.168.31.5  0:1e:58:b1:64:40

# test it
ping 192.168.31.5
Rafahorn03 commented 10 months ago

It is working with that. Thanks.