MQTT Library and SEMI_AUTOMATIC

That's probably the only viable route.
You could of course fork the library and do the adjustments yourself - and maybe even contribute the enhanced version to the public library repo - but having the original adapted would be best.

I've not checked the library, but I'd no limit the focus to client.connect() but check for potential blockages everywhere.

Hi, I’m having problems with the https://github.com/hirotakaster/MQTT library. my application does not connect with my broker. Can you tell me if client.connect (“myParticle”); It’s working correctly ? I’m using the mqtttest.ino example. Thank you.

Hello! I know that it’s an old thread, but did you find any solution about the .connect blocking function?

I have not dug into the issue back then but I just had a look at the library repository and found this pull request which may help

This with this other suggestion from an earlier post in this thread :wink:

hi,
If you running SYSTEM_THREAD(ENABLED) you have to set 4-th parameter in your client initialization
MQTT client("sample.com", 1883, callback, true);
here from official example:
sys_thread_en

In this case even if your broker is not available the code will not block :stuck_out_tongue_winking_eye:

3 Likes

Thanks. Never saw that. Was using code that was working in a Proton. Problem ending up being a firewall issue.

5310