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.