-
Notifications
You must be signed in to change notification settings - Fork 196
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
TinyTuya based devices stop responding after years of working. #559
Comments
Hi, Strange, I had the same problem you describe but since the major update of Tuya Smart last week, my devices are now always working locally, and more strange is that I didn't need to unplug them to reset them and have them working. I didn't see any firmware update on my device but perhaps I miss some because I'm in automatic update. Regards |
Hmm, I have auto update turned off on my devices - but going in to manually check on them I can see that it says there are no updates available. Main Module Version: v3.1.4 |
My problematic devices were
All other Socket were working without any issue It doesn't look like I had firmware update, so I think they change something on "Tuya Smart App" that were locking my devices on LAN (via cloud API it was always working) I just saw my IOT Core license on Tuya Cloud expired in september, just to be sure I have renewed it, w&s |
Hmm, My IOT Core License is good until January. I havent seen any notice about a Tuya Smart change last week, do you have a news blast about that? Is there any settings in the tuya smart app other then the basic setup? |
Tuya Smart App has been updated the 8 November (v6) on Android App Store no other settings :/ |
Have you tried rebooting the devices? Do they respond at all to the Smart Life app? |
I have not tried rebooting the devices yet, as they are light switches in the wall without a power button to see. I would have to kill power to the whole house to reboot them lol. They do respond to smart life app as well as the google home integration. |
Well, at least that makes it easy to reboot them all at the same time 🤣 If they're v3.4 devices, well, I'd say a few years without needing a reboot is really good, I have a couple that need to be rebooted every few days/weeks. |
This morning I have some v3.3 devices that were working for years without any issue that stop to work again on LAN. Edit, this morning more and more devices become unreachable ... I kill Smart App to see if it's better or not |
I suspect mine were 3.3 devices as well, but I am not fully sure. |
I have been playing around with the python scripts, seeing if i can gleam any more information. So far this is what I found: set_status() result {'Error': 'Network Error: Unable to Connect', 'Err': '901', 'Payload': None} Edit: Here is some debug info:
|
I had to reset some breakers the other day to install a new light switch, so figured while I was there I would turn the whole house "off and on" again :P. No luck unfortunately! Any other suggestions? |
Are you getting the same debug trace? |
The debug trace seems to be the same yes.
The Wizard gave the same results as before as well (I can upload a new debug log if you want). I had been peeking around in the code, but I dont know enough python to change the code and run the changed code to attempt to extract more information when the code fails out with a generic error catch:
I have more experience with C# where you might be able to write out err.Message to get a bit more information about the type of error that is being thrown? EDIT: This is the PY script I am using:
|
A ConnectionResetError typically occurs when the remote server or peer unexpectedly closes the connection. This can be due to various reasons such as:
For the Tuya device, have you tried running from a different host to eliminate a host issue? |
I tried to run the scan from a docker image on my windows machine - it didnt work but it also was on a different subnet due to how the docker was setup and I am not fully sure how to change that in windows docker! That said, I did some network sniffing on the router with tcpdump while I ran a wizard and got this the first time I did it, but never again when I tried to repeat it (So I think it was just a coincidence / luck I saw this)
The zibgee switch I have shouldnt be talking to the LightSwitches (which are wifi) I didnt see any other traffic to the tuya devices, except one device gave this:
I also found this one: Is the zibee switch firing off its own "whos there" call? |
Yesterday I changed my router and also changed my LAN CIDR, what is my surprise the devices that was offline on LAN become available again without unplugging them. So the networking is not totally stuck. For me the problem is the Android App that stuck them randomly. I'm looking for an alternative android app to switch on/off some devices and nothing more. Perhaps I will write a Django app. |
What router software are you running, openwrt? if so what settings in there did you change? |
My suspicion is the devices stop responding to ARP requests that do not come from the gateway, but I've been unable to verify this as none of my 50+ device stop responding like this. I do use Unifi APs with the Proxy ARP ("Remaps ARP table for station") option turned on. |
Yes, if it's a hub device (has both WiFi and Zigbee) it'll try and connect to all your other devices so it can manage scenes. |
An option for scanning within docker (or from any other routed network for that matter) is the force scan option. |
oo, Making progress @uzlonewolf ! I am not sure what that tells me - but with the force and defining the subnet I can see more information Running from inside a docker on my laptop I am able to ping the devices it seems: # python3 -m tinytuya scan -force 192.168.0.0/24
$ ./venv/bin/python3.12 -m tinytuya scan
Then with the Force: $ ./venv/bin/python3.12 -m tinytuya scan -force 192.168.0.0/24)
Fatal error message``` DEBUG:Force-Scan Found Device 192.168.0.201 DEBUG:final payload: b'0123456789abcdef' DEBUG:payload encrypted=b'000055aa00000001000000030000004468547ac859cffe5561d50866068d05d1139b4a20221c2027296b8b981065f9515dd9d87f27ce8d9e538abfd9256cc1714a31f11a0d3ee6afa1253ef83c8fccdf0000aa55' Traceback (most recent call last): File "/home/user/.local/bin/tinytuya", line 5, in from tinytuya.__main__ import dummy File "/home/user/.local/share/pipx/venvs/tinytuya/lib/python3.12/site-packages/tinytuya/__main__.py", line 124, in scanner.scan( scantime=args.max_time, color=(not args.nocolor), forcescan=args.force, discover=(not args.no_broadcasts), assume_yes=args.yes ) File "/home/user/.local/share/pipx/venvs/tinytuya/lib/python3.12/site-packages/tinytuya/scanner.py", line 1034, in scan devices(verbose=True, scantime=scantime, color=color, poll=True, forcescan=forcescan, discover=discover, assume_yes=assume_yes) File "/home/user/.local/share/pipx/venvs/tinytuya/lib/python3.12/site-packages/tinytuya/scanner.py", line 1482, in devices all_socks[sock].write_data() File "/home/user/.local/share/pipx/venvs/tinytuya/lib/python3.12/site-packages/tinytuya/scanner.py", line 604, in write_data self.v34_negotiate_sess_key_start() File "/home/user/.local/share/pipx/venvs/tinytuya/lib/python3.12/site-packages/tinytuya/scanner.py", line 388, in v34_negotiate_sess_key_start self.sock.sendall( self.device._encode_message( step1 ) ) ConnectionResetError: [Errno 104] Connection reset by peer ```Weirdly the devices report as 3.4 version? I thought they were 3.3 or 3.2. When I run a test python on that docker that is working going from version 3.1 to 3.4 (then leaving the version blank) I get this:
|
I believe this might be the same issue as #556 but I dont want to hijack their thread
History: I have about 20 devices, mostly Feit style light switches. When I set them up years ago, tinytuya was working with them, and then I migrated to using Home assistant Local Tuya to control them. No major issues for years.
Current: Some time last week a few of my devices stopped responding and I didnt think much about it - as that happens from time to time and usually resolves itself. Instead of resolving this got worse and worse, eventually getting to the point where no devices were responding. I tried a bunch of things but nothing seemed to get the devices back up and running. Unfortunatly the logs for LocalTuya are quite minimal, so I disabled that and fired up TinyTuya to see if I can debug the problem better.
I can run the wizard without any issues, it seems to download the details for all the devices, however when doing a local polling nothing seems to be working (It also cant seem to get an IP address for most of the devices). Even when I manually edit the devices.json file to put in the device IP Address I get a No Response issue. The two devices that automatically return IPs are a tuya switch (like a white box, not a light switch) and a zigbee hub.
I have not made any changes to the network that I know of... I have tried rebooting the network, and the PC that is doing the polling with no luck.
Here is the debug log: https://pastebin.com/JdYzWSzb
Any thoughts?
The text was updated successfully, but these errors were encountered: