We would like to build a gateway to send data gathered on a XBee ZigBee network to the internet via a XBee 3g cellular modem. I was anticipating a micro controller between the 2 XBee modules to control the process, but I was wondering how easy this would be using the MicroPython environment inside the XBee modem in place of the micro controller. This seems feasible as the 2 modules can be simply connected through their serial ports. However, that would then be tricky to program as we would need to keep swapping over the serial ports.
Would it be possible to connect the ZigBee module serial pins to some of the digital I/O pins of the modem and read/control the ZigBee module that way?
Or does anyone have any other suggestions?
1 Like
MicroPython on the XBee Cellular module includes support for an alternate UART on DIO4 and DIO12 and you could connect that to the primary serial port on the XBee3 Zigbee hardware. The XBee3 Zigbee product only supports the primary UART (via sys.stdin and sys.stdout) for MicroPython serial communications.
Without knowing how much processing you need to do on your gateway, it will be hard to say if you can accomplish it solely through MicroPython. You could have the Zigbee hardware do some processing in MicroPython, and pass data in an easy-to-parse format to a MicroPython program running on the XBee Cellular.
At a certain point, it is probably easier to use stock XBee firmware on the two radio modules and write your own code for an inexpensive ARM processor with a UART to each XBee. Digi has reference libraries in C, Python and Java for communication with an XBee in API mode, and they would serve as a good starting point for a gateway.
Thank you, I had not realised there was an an additional UART available from microPython. That should certainly make things simpler. For the moment we are going down the cheap/low power ARM based microcontroller route you mentioned. This is a straightforward way to get the gateway working. Will certainly look into the microPython alternative at some point as well.
We have found that the cellular modem works really well and is straightforward to control in API mode 2 via the serial port.