-
-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
device.get() never returns #634
Comments
+1 same problem |
Same problem, i have a switch atteched to zigbee sub and it stuck at device.get |
@duongvanba Can you please also post a log? |
same, refresh() return false, get() never return
|
It seems the sequenceN sent out is not matching the one received, something is wrong with the protocol or the sequenceN encoding. so any api call rely on _send() and sequenceN not works. the raw bytes send and received like this:
|
so, for now, my temp workaround is to calculate the sequence difference when the 3.4 handshake done, then use it in _send() for correct response slot key. still no idea why this happens. |
I'm working on new version of this hope it work |
in simple, the sequenceN sent is not directly related to the one responded. sometimes the device broadcast some message with command type 8, or 64, which also increase the sequence sent from device, but on the other side, the sender side (the tuyapi), still in it's own sequence step, so the sequence diff will change. Then it's hard to predict what the expected response sequence when send a request. we only know what's the newest sequenceN NEWEST_RESP_SEQ we received for now, and how many pending requests PENDING_REQ_NUM which not got response, could we tell the expected sequence is NEWEST_RESP_SEQ+PENDING_REQ_NUM? we can not. it can not cover race cases. then the predict sequence algorithm is no longer reliable. |
In my experience, the hubs (Zigbee, BLE, IR) do not have their own DPs, and therefore SET/GET to the Hub are not allowed and cause various malfunctions, with rare exceptions. Naturally SET/GET for connected virtual devices are allowed, although often very limited. I believe that in many cases Tuya uses other communication channels (e.g. images from WiFi camera), not implemented in tuyAPI. For more details see notes on gateways. |
Hello. I've just started using tuyapi, so please forgive me if this is a known issue. I couldn't find anything related on the web.
Describe the bug
Using tuyapi@7.5.2. When trying synchronous usage example on a protocol 3.4 device, device.get() never returns a value, although the data from device is received and parsed successfully. The device is a zigbee hub, but I'm not trying to communicate with subdevices, just with the hub itself. Unfortunately I don't have other devices to test.
To Reproduce
Here's the actual script:
Expected behavior
The await device.get() call returns, data is printed to console and device disconnects.
Debug Output
The received data is never printed to console, the script just keeps pinging the device forever.
Desktop (please complete the following information):
Additional context
Asynchronous usage example works just fine.
The text was updated successfully, but these errors were encountered: