-
Notifications
You must be signed in to change notification settings - Fork 118
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
MQTT client does not subscribe to all topics - mqtt_loop() missing? #424
Comments
Hi I haven't got this problem here, but if it solves yours I'll add a temp on the subscribing |
Can you try just adding a yield() instead of mqtt_loop() ? |
Hi, |
Thanks for testing. :) I'm gonna submit a PR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I haven't been able to access the MQTT API using the <base_topic>/claim/set topic. I have found in my mqtt server (mosquitto) logs that the client does not subscribe to all topics, only the first four listed in the source code (mqtt.cpp)
`// MQTT Topic to subscribe to receive RAPI commands via MQTT
String mqtt_sub_topic = mqtt_topic + "/rapi/in/#";
`
mqtt_vrms is the last topic subscribed, and I cannot see the reason why the next four subscribe() are not reached.
Incidentally, I found the very same problem with an Arduino project several years ago, using the PubSubClient library. The reason then was that the background process of the mqtt client library was not able to attend more than 4 or 5 subscribe() calls in a row. A call to the loop() function of the mqtt library after each subscribe() call solved this issue.
I have tried to add a call to mqtt_loop() after each subscribe() in mqtt.cpp, and it solves the problem.
I don't know if this is a specific issue with my wifi setup, but maybe it won't hurt to add those mqtt_loop() calls just in case.
Thankyou!
Adolfo.
The text was updated successfully, but these errors were encountered: