Closed Saimond closed 1 year ago
This is odd:
Do you see the device in the devcies.json file that the wizard downloaded? It isn't matching the device ID to the record that it pulled (notice "Unknown device" and missing local key).
This is odd:
![]()
Do you see the device in the devcies.json file that the wizard downloaded? It isn't matching the device ID to the record that it pulled (notice "Unknown device" and missing local key).
Hello @jasonacox; First of all thanks for the module, very good.
I usually go to Tuya's website, get the device data, ID and Key.. I set the MAC to Static IP... And I put this information in Python... In the photo, I did the python scan without having done the wizard before.. But, in the other applications, I never used the scan or wizard...
But, I believe it must be a failure with Tuya... because in the Scan it finds the device, but in the program (d.status()), it indicates a Key failure..
Thus, I believe that the failure would not have a solution here..
I will proceed with the following solution:
After that, I'll let it run for 1 day, and if you don't have problems, I'll bring the information here.
DEBUG:session key negotiation failed on step 1
This usually means either a) the local key is wrong or b) the device needs to be rebooted.
I will proceed with the following solution:
Yes, that looks like a good plan.
Hello... I did the reset, registered the device again, and used the following code to monitor:
import tinytuya
# Debug removed from Runtime
#tinytuya.set_debug(True)
d = tinytuya.OutletDevice('*** ID ***','*** Static IP ***','*** Key ***')
d.set_version(3.4)
d.set_socketPersistent(True)
payload = d.generate_payload(tinytuya.DP_QUERY)
d.send(payload)
while(True):
data = d.receive()
if type(data) is dict:
print(data)
payload = d.generate_payload(tinytuya.HEART_BEAT)
d.send(payload)
I put the program to run the: 2023-04-06T05:17:15.189Z (UTC)
But, around 11:54:30 (UTC) switched to True and 12:26:30 (UTC) switched to False
Here's a print of Grafana comparing the Python registry with power monitoring:
@uzlonewolf
This usually means either a) the local key is wrong or b) the device needs to be rebooted.
a) It's ok, for initially it worked... b) why after a period, need to restart the device?
Hello;
After another reset, adding again to the account, the same situation happened, it worked for a period and then there was a problem...
I restarted the device, it worked for a while, stopped again...
so I left it off for about 10 minutes, turned it on and after that, for now it's working normally, it's been working for about 3 days
We occasionally see devices like this. I had one (requires a restart every few days) which I replaced and the rest (I have 27 devices) work fine. I don't know what causes them to be defective. They are rare but they are out there.
I wonder if some of them have ARP issues where they no longer respond with their MAC address for ARP requests. You could see if your host has a map for the device by doing arp -a
.
I also have 17 who never had any problems, but this one after these procedures, it's working... I don't know for how many days, but, so far, it's going well.
Well, the point is that after re-registering the device a few times and turning it back on a few times, it is now working fine (more than 7 days without any problems).
Thanks.
Hello;
I have a device, and I'm having a problem connecting to it...
There are moments that everything works out, but other moments that don't connect..
OBS:
Follow image with test..![Tuya_3_4](https://user-images.githubusercontent.com/12146537/230207869-14071900-c9e2-45ab-87f8-7b6cf002991e.jpg)
System:
Windows 10
Device:
Network:
Router:
Huawei AX3
New Tests, based on othres post....
File Python:
Result:
So as not to have any doubts, I went to the Tuya website again to confirm the Key...
Error in Debug => DEBUG:session key negotiation failed on step 1
Probably, if I reconfigure the device, register the account again, it should fix the problem...
But if there's another way...