Home/Support/Support Forum/cellular modem micropython reference?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

cellular modem micropython reference?

0 votes
I'm interested in reading references of the micropython on the cellular xbee 3 modems. I've used micropython on other microcontrollers before so I'm primarily looking at what objects and modules are on the modem and how to use them. If I can use API mode to talk to the modem, then what is the advantage of having micropython on board, is it intended for developing iot projects on board the modem using the modem's ADC and GPIO and a few other sensors parts so I won't need a separate MCU? I'm just gauging the pros and cons.
asked Feb 18 in Python by liudr New to the Community (43 points)

Please log in or register to answer this question.

2 Answers

0 votes
 
Best answer
I don't know if you have come across this guide yet, but I would check this out (Digi Micropython Programming Guide):

https://www.digi.com/resources/documentation/digidocs/PDFs/90002219.pdf

This will help show you a robust set of features that expand beyond API mode and make it to where you do have a capable MCU that is cellular connected that also supports excellent sleep functionality. So for example, I utilize these modules for IOT projects that demand cellular connection, local edge computing ability, and also the ability to reach impressively low (for a cellular capable module) sleep currents. I am also able to utilize libraries to where I gain I2C functionality which was one of the main reason why I migrated to the Xbee3 platforms in the first place. I personally think the cellular module they have is a rich offering with a ton of potential.

Hopefully this helps build the case for taking the Xbee3 Cellular modules for a spin.

Also, as a side note, I was able to get up and running with a Hologram.io SIM which is another point. The ability to be more operator agnostic is a bonus, I am coming from the particle.io platform where you are locked into AT&T which does not always get it done, especially in remote areas. The Xbee3 Cellular is a certified product with multiple operators, including Verizon which historically seems to offer better rural area support.

Food for thought!
answered Feb 18 by backpacker87 New to the Community (48 points)
selected Feb 19 by liudr
0 votes
Thank you! So if I understand you correctly, you developed your micropython project code to run on the xbee module itself so your device is the xbee module, voltage regulation, and I2C peripherals, correct?

If you're doing everything within the xbee module, does it matter what AP mode you put it in? Does it have to be micropython REPL mode [4] or AP modes?

About IOT, digi claims the module supports azure iot. I didn't find any references. Any pointers you could share? Maybe I'll post a separate question on that.
answered Feb 19 by liudr New to the Community (43 points)
Great questions. First that is one thing to be aware of is that the XBee3 (RF or Cellular) do not voltage regulation or any hardware for battery charging (which differs from a Particle.io Boron). There is a window of 3.3V - 4.3V for the supply voltage.

I suggest you include a external voltage regulator for 3.3V that can supply the appropriate current for the module you are using (a max of 610mA @ 3.3V for the cellular with BLE on as well. Running off battery for backup or solar applications will require a separate IC, but I believe it is still worth it because of pros I mentioned in the first post.

Now that we have a steady 3.3V being supplied to the module, yes, it is now your main device is the Xbee module itself which can work with I2C peripherals and basically do anything you want it to do.

I recommend micropython REPL mode [4]. Keep in mind that you can create code to interact with peripherals AND you can execute AT commands that you would normally perform in XCTU all from the convenience of the the micropython environment.

For example if I want the ICCID of my setup in micropython I use the following lines:

x = xbee.XBee()
print("ICCID: ", x.atcmd("S#"))

As for Azure, I personally do not have an experience, but when you download Pycharm and install the Digi Xbee Plugin there are micropython samples that are also included (these are extremely helpful!!!) Under cellular, there is a listed example called Azure that states, "This example uses the 'mqtt' library to connect to an Azure IOT Hub and publish data to a specific topic. Hopefully that could get you going.

Hopefully this helps and provides some further insight.
Thank you backpacker87! I might have to try something such as constructing python commands in my mcu, send it over to xbee micropython repl and have it execute. This is what I dread, having some support of azure iot but only on the xbee modem under micropython. For some iot sensor nodes it's enough but I need usb hosting and a lot more such as freeRTOS. I have to run the main code on my MCU and possibly talk to micropython by sending commands in some raw repl mode. I checked out azure support that I found:
https://github.com/Azure/azure-iot-device-ecosystem/blob/master/get_started/micrium-xbee-cellular-python.md

The whole example has an AzureMQTT class with very few things defined. I hope digi isn't calling THAT azure iot support.
...