codetheweb / tuyapi

🌧 An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is there a breaking change at tuya ?

geertschneider opened this issue · comments

Describe the bug
I'm trying to connect to my devices through this library. But seems to hang on Error: find() timed out. Is the device powered on and the ID or IP correct?
I'm sure deviceID and localKey are correctly filled in.
I tried the same with CURL (generated by the tuya API explorer), and those requests pass, but trying to connect to the same device via the library fails.

I also tried node-red, which uses the same library under the hood.

Any idea ?

find is using UDP to find the device IPS, so it really depends on your configuration ... make sure UDP is available and correctly routed

Thanks for your reply!

Well I was running node-red in a container, I can imagine the networking might be an issue there...

I didn't look at the code of tuyaapi, I thought the library was just created a developer-friendly wrapper on top of the tuya REST api, and as I could execute the REST API from the node-red container, I was expecting it to work via the tuyaapi as well.

But than I just ran the library from nodeJS from the command line with a basic .find(deviceID,localKey).
The tuya app runs on the same wifi network, and my PC runs without issues, so I would not expect to have to do something special for UDP on my laptop/network?

This library is for communicating with Tuya devices on your local network, it does not interact with the cloud.

in a container

Then use macvlan on the container to have UDP forwarded

in a container

Then use macvlan on the container to have UDP forwarded

That makes sense, so now I'm poking @geertschneider

This library is for communicating with Tuya devices on your local network, it does not interact with the cloud.

Oh My Lord.... thank you for pointing that out. I had the very same problem and stumbled upon this "issue" by chance. This error message realy is not that self-explanatory. 😇