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

Connecting and publishing #56

Closed
mladedav opened this issue Oct 2, 2021 · 2 comments · Fixed by #99
Closed

Connecting and publishing #56

mladedav opened this issue Oct 2, 2021 · 2 comments · Fixed by #99

Comments

@mladedav
Copy link
Contributor

mladedav commented Oct 2, 2021

Hi, I really like the library and I'm trying to use the master version (which I noticed is considerably different from 0.3 which is latest), but I can't seem to be able to publish. The problem seems to be in that the connection is never established, so all the publish calls are silently dropped (might I suggest logging that?) but I have not seen any API for connecting.

Can you point me to the correct function to establish a connection so that I can publish messages to a broker?

@mladedav
Copy link
Contributor Author

mladedav commented Oct 2, 2021

For the record, I have found out that calling Minimq::poll() several times helps, but I believe there should be some other way to start the connection.

@ryan-summers
Copy link
Member

ryan-summers commented Oct 4, 2021

Hi there @mladedav! The current design requires that poll() is called continuously in a low-priority task to execute the MQTT state machine. If poll() is not called regularly, the MQTT connection will not be established and publish() calls will be silently ignored.

You're right that the docs here are lacking - I've noticed even myself forgetting this fact sometime. I'll look at a way to make this more obvious.

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 a pull request may close this issue.

2 participants