-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Hi all,
I purchased a Sparkfun AssetTracker development kit with MicroMod ESP32 add-on, GNSS antenna and so on.
I’m wondering how to find examples about using MQTT (I would use the onboard LTE modem instead of the Wi-Fi connection, so no "PubSubClient" library ....).
I’ve looked at AssetTracker APIs and tested some examples, all working with my environment (Arduino IDE on Windows 11), but I didn’t find how to correctly use the “MQTT” APIs.
I mean, I’ve written some code which seems to be able to connect (i.e., the connectMQTT() method returns OK) to some public MQTT brokers (e.g., MOSQUITTO, EQMX, etc) but:
- Publish and subscribe methods return errors.
- I didn’t actually understand how/where to use the readMQTT() method.
- I set the command callback, but I don’t understand its purpose (I would use readMQTT() instead to read topic contents).
- How to set a callback to read incoming topics which I’ve subscribed to ?
Please find attached below the code I've written, just to understand where I’m doing wrong...
Thanks in advance for your support! :-)
Best regards
David