Closed WyattSmithTritium closed 3 months ago
Thanks for posting, and sorry that you're having trouble with this. At a first glance your code looks fine; I think we would conventionally bring the cellular network up first, then the GNSS network, but that shouldn't make any difference.
Would you be able to post the debug output from ubxlib
here, so that I can see the nature of the failure?
Thanks for the quick response @RobMeades. After some additional testing this morning, I've found that I actually am able to use both networks this way. Sorry for the confusion. My test is to be able to receive MQTT messages while also getting a GNSS fix.
What's interesting though, is that if I bring up cellular first and then GNSS, I am not able to receive MQTT messages. I've attached a partial log below.
I can confirm that the code above does work though, so I don't need any further help. The cell connection is more important than GNSS so I would prefer to bring it up first, but what I have will work. Thanks!
I'm happy if you're happy, so feel free to close this issue. 🙂
That's excellent news. And it seems, from your log, that I have made another of those "schoolboy" errors in the MQTT example code, which is that I have:
...whereas of course that should be:
if (uMqttClientSubscribe(pContext, topic,
U_MQTT_QOS_EXACTLY_ONCE) == 0) {
D'oh! Is that what you were referring to with the "Unable to subscribe to topic" message in the attached log? Will fix...
Yes, thank you!
FYI, the MQTT example is fixed in 1c57c42930e69a7e049ab19185e8b9f1f49c2fe1: it happened to work in our case because the function can return 0, 1 or 2 (it returns the QOS of the subscription).
Hi! I'm working with the SARA-R510M8S on the ESP-IDF platform. I'm looking to get a constant location from the GNSS module while also maintaining an MQTT connection over the cellular network. I've gotten each part working independently, but once I try to do both at once, I lose the first network (GNSS or Cellular) despite which network I bring up first. I've followed some of the steps mentioned in #155 and merged it with the MQTT example.
Essentially my problem is that I can't seem to keep both networks on at the same time. I've included the main part of my code below. Any thoughts? Thank you!