-
Notifications
You must be signed in to change notification settings - Fork 188
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
Communication errors with device that has local password containing single quote ' #532
Comments
Hi @RedFlh . I have multiple devices with single quotes in the local key and they all work fine, so it's not an issue with the library. I'd run the wizard again to make sure you have the correct local key. |
Thanks for your quick response |
Hi, |
Hi @RedFlh - when you ran the wizard, was it able to poll the device? Same for scan (e.g. If you unpair the device in the SmartLife app and re-pair it, Tuya will assign a new key. Now, if the key you are using is causing a bug to show up in tinytuya, that wouldn't address the bug in the code but may get it working for you. Also, you could post the old key so we can see if there are other characters that could be causing the issue. |
Hi Jasonacox, |
I've seen all those symbols before (see #341 ) and none of them have ever caused problems. I'm going to blame this one on the device itself. It's kinda late to ask this, but did you reboot the device at any point? I've seen them just up and "forget" what their local key is supposed to be until they get power cycled, at which point they work fine for a while before forgetting again. |
Hi Jasonacox, |
That's correct. These devices are designed to be cloud-first and the local access is an after thought. SmartLife will pull from cloud if it can't get a local update. The local socket on these devices can get into a bad state that will allow the device to work with the cloud but not for local access. As @uzlonewolf mentioned, I suspect if you rebooted the device it would have fixed it. Repairing essentially reset it. I don't know why I didn't think of that.
We don't know why the devices sometimes return all the data values. You can sometimes see them running the monitoring loop https://github.com/jasonacox/tinytuya/blob/master/examples/monitor.py
I assume you are using this same version 3.4 device? Are you using the right nonce (initialization vector)? |
Wait, AES-GCM is a v3.5 thing, v3.4 devices still use AES-CBC but with a negotiated session key. |
Hi Jasonacox, |
@jasonacox I guess I'm just an alt account of yours now 🤣 🤣 🤣 @RedFlh If it helps any, there's a "fake v3.5 device" script in the tools/ folder I wrote specifically to help debug crypto implementations. https://github.com/jasonacox/tinytuya/blob/master/tools/fake-v35-device.py |
No!!! Haha! 😛 @RedFlh just so you know, @uzlonewolf is the mastermind behind all the 3.4 and 3.4 code and 10x smarter than I am. 🙇 Send us the link to your C# project if you release it. |
Hi Jasonacox, |
HI,
first of all congratulations and thank you for your great work with this project
I have already used your code to communicate with several Tuya devices without problems.
But now I can't communicate with a device that has the single quota ' character contained in the local key
I have try to set the local key string closde by doble quote instead of single quote o escaping using \ but i can't comunicate with it.
Could it be that this character prevents your library from working properly?
I attach some explanatory images.
This is test code (I have change real data to xxxxx for pivacy):
And the result is:
"status() result {'Error': 'Check device key or version', 'Err': '914', 'Payload': None}"
Thanks for your time!!!!
Best regards
The text was updated successfully, but these errors were encountered: