Comments (6)
Yes, 3.0.3 has a logic error in the reconnect code which keeps it from reconnecting sometimes. I've had this happen on one of my devices as well.
As far as what causes it to disconnect, I have no idea. I have 5 different Tuya devices and most maintain connection for weeks/months, but one disconnects semi-regularly, several times a week at least. It seems to happen if it roams between access points (it's fairly far away and almost perfectly equal distance from two different APs). Regardless, from a code perspective, there's not anything I can do about it other than reconnect since it's a socket error happening at very low level. I'll try to push 3.0.4 soon with the reconnect fix.
from tuya-mqtt.
Thanks for your reply ... will watch out for the 3.0.4 release ...
from tuya-mqtt.
3.0.4 has been released. I'm pretty sure it will address the issue so I'm going to close this for now but can re-open if you still have issues, just let me know. Honestly, I need to rework the connect/reconnect handler along with the error handler but just don't know if I'll have time so I'm hoping this is good enough as it seems to work for me in all cases.
from tuya-mqtt.
Thanks a lot ... I'll check it out and let you know here ....
from tuya-mqtt.
Hi, unfortunately the same issue happened to me with 3.0.4 version, gradually all devices become disconnected with the error:
2021-02-16T09:10:38.280Z tuya-mqtt:tuyapi Search for device id xxx
2021-02-16T09:10:38.280Z tuya-mqtt:tuyapi Found device id xxx
2021-02-16T09:10:39.164Z tuya-mqtt:error Error: Error from socket
at Socket.<anonymous> (/home/node/tuya-mqtt/node_modules/tuyapi/index.js:387:30)
at Socket.emit (node:events:376:20)
at emitErrorNT (node:internal/streams/destroy:188:8)
at emitErrorCloseNT (node:internal/streams/destroy:153:3)
at processTicksAndRejections (node:internal/process/task_queues:80:21)
2021-02-16T09:10:39.165Z tuya-mqtt:tuyapi Disconnected from device xxx (yyyy, zzzz)
A restart of tuya-mqtt reconnects all devices successfully.
This happened 2nd time this month. Any chance to look into this?
from tuya-mqtt.
I would most likely need full logs to even have a shot as that snippet is not useful as none of that happens in tuya-mqtt. You can email logs to me if that's preferred, my email is the same username at gmail.
from tuya-mqtt.
Related Issues (20)
- TypeError: Cannot set property 'updated' of undefined HOT 9
- Problem installing on Synology RS914 HOT 32
- Home Assistant integration how? HOT 2
- tuya-mqtt publishes states only when app is opened. HOT 22
- What mqtt broker HOT 3
- Samples for nodejs script HOT 9
- New Maintainer Needed HOT 4
- Not sure when you went into Maintenance mode HOT 3
- Command Syntax for friendly topics HOT 3
- Setting switch state of a smart switch (custom template) HOT 11
- zombe state reconnecting issue? HOT 1
- Switch w/ Energy: DPS values reported only once at tuya-mqtt startup HOT 3
- Sudenly wrong responses from tuya device HOT 1
- tuya-mqtt not working (OpenHab) HOT 7
- Tuya bulb stopped working from tuya-cli, tuja-mqtt HOT 9
- Devices behind zigbee gateway available with tuya-cli but not tuya-mqtt HOT 1
- Different names after service restart HOT 9
- tuya-mqtt crushing HOT 1
- hsb type not suported in generic template HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tuya-mqtt.