Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribing to messages using Homie.getMqttClient() is not reliable: topic is truncated #526

Merged
merged 3 commits into from
Nov 12, 2019

Conversation

peret2000
Copy link
Contributor

It is not possible to subscribe to MQTT messages in general using Homie framework, as BootNormal::_onMqttMessage() truncates the topic.
Issue #524

With this change, topics can afterwards be intercepted by any other subscribed function, without loosing functionality

@stritti stritti requested review from euphi and kleini March 30, 2019 22:27
Copy link
Collaborator

@bodiroga bodiroga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! It doesn't seem to be harmful, but has anyone test it?

@peret2000
Copy link
Contributor Author

I tested it, seemed correct. Unfortunately I do not have any test environment nor something with robust tests; I just tested with some code examples

@luebbe luebbe merged commit a055cd1 into homieiot:develop Nov 12, 2019
luebbe pushed a commit that referenced this pull request Nov 14, 2019
…topic is truncated (#526)

* Declare _mqttTopicCopy in BootNormal.hpp
* Using _mqttTopicCopy to manage subscribed topics
* Removed leading spaces
@sradner13
Copy link

Updated my environment (develop-v3) with this change and OTA updates started to encounter very inconsistent watchdog timer errors. With this change backed out, I can once again reliably update. I believe the extra copy causes enough of a delay to make the script unstable. If others have encountered problems recently with OTA updates, I would be curious if this change is suspect.

Sorry I do not have an alternative fix to the original problem.

@sradner13
Copy link

A few more details if this helps anyone. I'm not sure the right issue to be updating, so apologize if this is in the wrong place.

My hardware is ESP8266 based MakerFocus D1, Mini, which seems to be very similar to the Wemos D1 Mini.
I'm building for: ESP-12E / 4M: 1M spiffs / LwIP 2.0 higher bandwidth.

Since backing out this change I have been very successful with OTAs (about 12 tests with no failures). It also appears the boards are more reliably keeping up MQTT connections to the broker.

While I do not have another code solution for the original problem, I'm happy to help test if someone has a proposed fix.

Thanks for the awesome library.

@mkfrey mkfrey mentioned this pull request Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants