Can I have access to the pins of my Xbee 3 (non-cellular) in micropython ?

Hello everyone,
I’m working on a “Digi XBee3, 2.4 Ghz ZB 3.0, U.FL Ant, SMT” (XB3-24Z8US-J) on an Xbee (SMT) Grove Development Board. In the documentation “Digi MicroPython”, there is a section entitled “I/O pin examples” that explain how to use the module pin that allow to have control over the pins.
However this module is only available to Xbee “cellular” model. So I have 2 questions:

  • If it’s possible, how can I have access to the pins in micropython with my non-cellular Xbee?
  • Why does my Xbee do not have access to this module: Not already implemented or is it not possible to adapt it to my Xbee?
    I would really interested in having the answers, even for only one of my questions…
    Thanking you in advance,
    Julien
2 Likes

I was very please to see this question I was struggling with the same thing.

The Xbee3 marketing literature says

Eliminate the need for an external microcontroller and create smart end nodes and low-end gateways using MicroPython.

But without the ability to read and process local I/O with MicroPython on the end or routing node. Without this functionality, I struggle to see how these modules can be used to create anything very smart.

We need a bit more guidance here from Digi on how to access and process the local I/O pins on the xbee3 RF module using MicroPython, because the guidance in the different sets of documentation is contradictory as set out below.

The getting starting instructions (XBee Zigbee Mesh Kit User Guide) only refer to Java not Micro-Python

The Digi XBee3® Zigbee®
RF Module manal on page 138

I/O sampling

The XBee3 Zigbee RF Modules have the ability to monitor and sample analogue and digital I/O lines. I/O samples can be read locally or transmitted to a remote device to provide an indication of the current I/O line states. You must enable API mode on the receiving device to send I/O samples out the serial port. If you do not enable this mode, the device discards the remote I/O samples.

Does this mean that I/O sampling will not work in MicroPython mode, with the AP field select MicroPython and only in API mode.

it also says
IS (Force Sample)
Immediately forces an I/O sample to be generated. If you issue the command to the local device, the sample data is sent out the local serial interface. If sent remotely, the sample data is returned as a AT Command Response frame - 0x88.

However, in contradiction on page 97 of the Digi MicroPython (programming guide) it says that.

For the XBee3 Zigbee RF Module, the xbee.atcmd() function does not support the following AT commands: IS, ED, AS, ND and DN.

So the force sample function is not available on the XBee3 Zigbee RF Module.

Some guidance on how to locally read and process with MicroPython the I/O pins on an end node and router nodes would be really useful. So, for example, a basic end node functionally programmed in MicorPython might be to

Read a button I/O pin on an end node and calculate how long the button was pressed for.
If pressed for more than 5 seconds send a message to the coordinator.
If less than 5 seconds Beep a local buzzer and flash an led on the end node and enable a local I/o pin.

That’s what I call eliminate the need for an external microcontroller and create smart end nodes and low-end gateways using MicroPython.