Comments (2)
Ok, I have looked into this issue and see more underlying problems. We have two options, 1) on variable change, connect, send, disconnect/tear-down or 2) maintain persistent connection as the code attempts today.
Option 1 is super simple but will only support sending from the vera-mqtt plugin
Option 2 is a bit more complicated but doable. Need to call handler() more frequently, on the order of 1/second and change the client KEEP_ALIVE time from 3600 to 60 seconds so the handler will send an mqtt PINGREQ to the broker every 60 seconds otherwise the broker will disconnect the client.
To preserve what's already here and leave the door open for someone in the future to add a subscription with a callback to process incoming MQTT messages on specific topics, I am going to implement Option 2. If this were clean slate, I would probably just implement #1.
from vera-mqtt.
Great work @bblacey congrats!
from vera-mqtt.
Related Issues (9)
- MQTT Client does not reconnect
- Consider adding polling for user-specified variables
- Enable multiple Vera controllers to connect to a single broker
- Ability to respond to variable queries over MQTT
- Port plugin to dkjson
- Extend Connection Model to attempt re-connect based upon user-supplied reconnect interval
- Add the MQTT Client ID to the settings tab
- Error: Error executing function MQTT_showExistingServices(): MQTT_showExistingServices is not a function 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 vera-mqtt.