Home/Support/Support Forum/How can I use utilize MQTT from Python script/application running on a Raspberry Pi with embedded XBee Cellular Modem?

How can I use utilize MQTT from Python script/application running on a Raspberry Pi with embedded XBee Cellular Modem?

0 votes
I am finding tons of simple examples of Using MicroPython on my embedded XBee Cellular LTE CAT 1 that are quite simple to follow along. However, I am currently using this connected to a XBIB-U-DEV and via Serial over USB using a Raspberry Pi; eventually connected directly to the RPi.

I am finding that I can explicitly send and receive IP Data directly with this setup (https://xbplib.readthedocs.io/en/latest/user_doc/communicating_with_xbee_devices.html#send-and-receive-ip-data) but need to be able to have an MQTTClient running on the RPi and able to use the Cellular network.

Am I just missing something small?
asked Apr 17 in XBee3 by cory.schooley New to the Community (4 points)
recategorized Apr 22 by LeonidM

Please log in or register to answer this question.

2 Answers

0 votes
 
Best answer
Cory,

Try the example at https://www.digi.com/resources/documentation/Digidocs/90001541/#concepts/c_mqtt.htm%3FTocPath%3DExamples%253A%2520IOT%2520protocols%2520with%2520transparent%2520mode%7CGet%2520started%2520with%2520MQTT%7C_____0

Digi Support
answered Apr 17 by mvut Veteran of the Digi Community (12,786 points)
selected May 8 by cory.schooley
@mvut, apologies for only getting back to this now; the day I posted this question, I got pulled into a different project with a short timeline.

So, I followed the examples and I was not able to get the publish to succeed; kept simply timing out using both the url and the ip I retrieved from dns. The m2m.eclipse.org in the publish example is active, yeah?

To be completely candid, the absolute ideal scenario would be where I could simply connect the cellular modem that rasbian would simply fallback to cellular if ethernet or wifi are not available. I understand that falls outside of digi and the context of this question, but I wanted to toss that out there if you had an example in that direction...should probably post another question for this...
Cory,

No we don't have what you are looking for in an example.

As for the issue, you may need to check with the carrier or who ever provided the SIM card to make sure it is still active and you have the proper APN entered. (Check AI).
It is certainly still active; I can run the explicit examples of sending SMS and making a GET call to an IP just fine.
Yes it is current and active. Are you able to connect to the Digi Remote Manager using TLS?
0 votes
For what was requested, @mvut provided a good response and I would recommend anything asking this specific question take a look at that.

For anyone interested in my ideal scenario in the comments on @mvut's answer, I was not able to find a way to successful do that, but I have a follow-up question that may be of interest to you. :)

https://www.digi.com/support/forum/73715/how-to-use-ssl-with-the-digi-xbee-xsocket-module
answered May 8 by cory.schooley New to the Community (4 points)
...