Giter VIP home page Giter VIP logo

Comments (6)

tsightler avatar tsightler commented on May 28, 2024

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.

thomasleitner avatar thomasleitner commented on May 28, 2024

Thanks for your reply ... will watch out for the 3.0.4 release ...

from tuya-mqtt.

tsightler avatar tsightler commented on May 28, 2024

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.

thomasleitner avatar thomasleitner commented on May 28, 2024

Thanks a lot ... I'll check it out and let you know here ....

from tuya-mqtt.

cameleon77 avatar cameleon77 commented on May 28, 2024

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.

tsightler avatar tsightler commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.