Comments (3)
Hi, I am setting up method with keepalive and cleansession. When I turn off my device I still don't get any msg from lwt.
This is my "begin" configuration, but it doesn't work.
mqtt.begin(mqtt_broker_server, {.lwtTopic = status_topic, .lwtMsg = "offline", .lwtQos = 0, .lwtRetain = 1}, 600, false);
Is it something in common that keepalive here is specified in milliseconds, and default keepalive in mosquitto broker is in seconds. Or I am wrong?
If someone can help, I will be happy.
from esp8266mqttclient.
Hi, I am setting up method with keepalive and cleansession. When I turn off my device I still don't get any msg from lwt.
This is my "begin" configuration, but it doesn't work.
mqtt.begin(mqtt_broker_server, {.lwtTopic = status_topic, .lwtMsg = "offline", .lwtQos = 0, .lwtRetain = 1}, 600, false);
Is it something in common that keepalive here is specified in milliseconds, and default keepalive in mosquitto broker is in seconds. Or I am wrong?
If someone can help, I will be happy.
I strongly recommend checking out PubSubClient
It's much more mature and behaves more predictably for MQTT stuff. If your payload sizes are greater than 128 characters, you'll have to edit this in the header files
from esp8266mqttclient.
I changed PubSubClient lib with this one, because it support all qos levels and wifisecure. I am still searching for the perfect one.
I think I found solution for my problem. I replace this line in ESP8266MQTTClient.cpp
_connect_info.keepalive = _keepalive;
with this one
_connect_info.keepalive = _keepalive / 1000;
I am using mosquitto for broker and i just converting the milliseconds to seconds in connect data.
from esp8266mqttclient.
Related Issues (20)
- error: request for member 'read' in 'source', which is of non-class type 'unsigned char*' HOT 1
- problem Mqtt client ssl HOT 6
- Missing disconnect packet option.
- Possible error in out_buffer free memory
- Create release for bug fixed in #6 HOT 4
- Crash with data len: 0
- mqtt.begin is not working HOT 1
- Expose "connected()" HOT 1
- User exception (panic/abort/assert) HOT 8
- using ws with a context path leads to path starting with //
- ws communication headers are compared case sensitive
- _isSecure of MQTTTransportTraits is shadowed by MQTTWSTraits
- Support to MQTT, websockets, TSL HOT 1
- publish not send,but no error show
- Compilation error
- Error parsing URL password HOT 1
- WDT reset HOT 4
- onDisconnect not defined HOT 1
- Im testing it, but, why do not include wss connection?
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 esp8266mqttclient.