-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [issue #869] Added 'LWT' to last will topic and improved CPU load See #869 for discussion on Last Will Topic. Also changed the way it tried to reconnect to make it return a lot faster when connection is not (yet) possible and call the PubSubClient::loop() at a much slower pace to reduce CPU usage. (See #847) This higher CPU load was probably introduced when fixing #683. * [MQTT] Fix error reporting success status with longer payloads Applied PR https://github.com/knolleary/pubsubclient/pull/360/files * made MQTT_CALLBACK_SIGNATURE for esp32 functional Applied PR knolleary/pubsubclient#336
- Loading branch information
Showing
4 changed files
with
59 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a93a078
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LWT message are correctly sended after a broker restart but they haven't the retain flag enabled, even if I enable the option "MQTT Retain Msg" in Tools -> Advanced:
Edit: it works for "Lost Connection" message, but not with "Connected" message:
a93a078
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it something like this issue?
If I'm correct, the retained flag is only between publisher and broker. Not between broker en subscriber.
And I override the 'retained' flag (set to true) for connect and last will message, since those are status flags which I think should be retained.
a93a078
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, like this pull request. I meant that I received this line:
with r0 when the message is "Connected" (9 bytes) and r1 when the message is "Lost Connection" (15 bytes).
I think that the line 173 has to be:
Right now, if I subscribe to the topic after a broker restart, I receive nothing or "Lost Connection" but never "Connected".
a93a078
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I now get it.
Will look into it. Not sure if I have time for it this afternoon.
a93a078
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a PR (#925 ) for this.
Can you test it, when released?
a93a078
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no problem. For the time being I can easily access my setup, but at some point I have to install it in a rollershutter box so I'm looking for a stable enough firmware or at the possibility to upgrade via OTA (#303)
Thanks for the PR, I would have done myself if I had the chance to test it at least.