Home/Support/Support Forum/Testing XBee S1 with DigiMesh firmware and Python
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Testing XBee S1 with DigiMesh firmware and Python

0 votes
I currently have two Raspberry Pis connected to XBee S1 modules with the DigiMesh firmware, though I plan on expanding the network to include more RPis. I have configured and tested them in XCTU and they appear to be connected.

I am now attempting to send data between the modules using some simple Python scripts. I've read through the article, 'XBee Extensions to the Python Socket API' but nothing seems to be directly related to the DigiMesh firmware and I'm still unsure of a few things.

From the article:
# The Format of the tuple is:
# (address_string, endpoint, profile_id, cluster_id)
#
# The values for the endpoint, profile_id, and
# cluster_id given below are the values used to write
# to the serial port on an Ember-based XBee module.
# For 802.15.4 use 0,0,0
DESTINATION=("00:0d:6f:00:00:06:89:29!", \
0xe8, 0xc105, 0x11)

From my understanding, the XBees are no longer running the 802.15.4 firmware, though I'm not sure that I'm using an Ember-based module either. I'm not sure what values I should be using to send data to the mesh network. My understanding of the DigiMesh network topology is that each node should be able to send/receive to/from all other nodes in range, but I'm unsure of how this would work if a single destination address is required for each communication.

I have attempted running the code from the tutorial but I am receiving an error from this line:
sd = socket(AF_XBEE, SOCK_DGRAM, XBS_PROT_TRANSPORT)

I receive the error:
NameError: name 'AF_XBEE' is not defined

I believe this means I have not correctly setup the Python socket extension but I am unsure of how to do this.
asked Oct 26, 2015 in Python by forcel96 New to the Community (0 points)
edited Oct 26, 2015 by forcel96

Please log in or register to answer this question.

2 Answers

0 votes
You use the same socket you would use for the Ember products as Digi standardized on the API interface for all of the mesh based XBee modules. It is only the 9xtend and 802.15.4 XBee modules that use a different API interface. Oh and don't forget that the XSC S3B does not use an API interface.
answered Oct 27, 2015 by mvut Veteran of the Digi Community (11,300 points)
"use the same socket you would use for the Ember products"

Which socket would that be?

And would anyone have advice on getting the Python socket extension working?
The same as DESTINATION=("00:0d:6f:00:00:06:89:29!", \
0xe8, 0xc105, 0x11)
0 votes
Hi there,
Sorry to join the post this way but I think I strickly have the same problem as forcel96.
My configuration is to have several Xbee pro 868 modules in a Digimesh network.
As I would like to address either several modules or just one particular module, I understood I have to use API mode ...
So I decided to use Python to send API frames but I just can't undderstand what to install as Python libraries and how to use it.

forcel96, it seems you already succeeded in getting libraries and coding something ...

Thanks in advance :-)
answered Oct 28, 2015 by digilex New to the Community (3 points)
I might be giving up on the S1 modules and switching over to S2 as the support for DigiMesh seems almost non-existent.
I haven't been able to get anything to work using Python. I'm now attempting to work with Node.js. Will keep you posted.
So how did it go?
...