Hello, I have Ember-based nodes (I have an Ember Jump Start Kit) and want to collect their data by using my CP X8. First of all, is it possible ? I’am at the beginning and will appreciate any suggestion.
I think some things I must surely do to assure Ember nodes and gateway radio share common parameters as: Zigbee protocol (2006 or 2007), same radio channel, same PAN ID …
Next, what to do ? Should I program my zigbee socket in the ZBS_PROT_APS protocol (for “standards-compliant ZigBee modules”) instead of ZBS_PROT_TRANSPORT, which is usual) ? Is it right ? What I forgot ?
Is there a useful link ?
Thanks
Yes, it would be possible for your Ember nodes to appear on the CP-X8 gateway, as long as the CP-X8 is using the 2.8.1.x EOS firmware, and the CP-X8 gateway rf module is using the ZB firmware. Once these two conditions have been met (and provided the Ember is also using Zigbee 2007), if you send at least 1 byte of data from the Ember to the 64-bit address of the embedded rf module in the CP-X8, the Ember radio will appear on the CP-X8’s “display mesh” screens and be associated with it.
As for the python question, that one I’m not sure of so I defer to someone that knows that answer.
If you are using the XBee ZB firmware (version 2xxx), by default your stack profile is 2007.
The Digi Python implementation uses the sockets API. You can send a frame to a third-party ZigBee device by using an appropriate address header. The header is formed by constructing a four element Python tuple in the following format:
(‘aa:aa:aa:aa:aa:aa:aa:aa!’, 0xee, 0xpppp, 0xcccc)
Where:
‘aa:aa:aa:aa:aa:aa:aa:aa!’ is the 64-bit address of the node you wish to communicate with (16-bit address translation will be performed for you automatically).
0xee is the destination endpoint (the source is defined by which endpoint you’ve bound to, covered below).
0xpppp is your profile id.
0xcccc is the 16-bit cluster id.
Please node that all digits above are in hexidecimal.
So, assuming you wish to send a frame with the payload “hello, world” to endpoint 0x42 of node 12:34:56:78:12:34:56:78!, from endpoint 0x99 using profile id 0xc199 and cluster id 0x4, the following code could be used:
from socket import *
create socket
sd = socket(AF_ZIGBEE, SOCK_DGRAM, ZBS_PROT_APS)
bind to endpoint 0x99
sd.bind( (‘’, 0x99, 0, 0) )
send frame:
bytes_sent = sd.sendto(“hello, world”, 0, ('12:34:56:78:12:34:56:78!, 0x42, 0xc199, 0x4))
Reception on endpoint 0x99 would then be performed in this manner:
payload, from_addr = sd.recvfrom(128)
Where the maximum size of the packet is not to exceed 128 bytes.
I hope this helps you!
Jordan
Thank you, I will follow your indications. Now I have updated the firmware of my CP X8 to 2.8.1.12 release, the next step will be converting the radio firmware to ZB version (yes, also my Ember nodes use Zigbee 2007).
Finally I will try jordanh Python snippets and let you know the results.
Hi, I tried the example and I got this error when creating the socket:
File “”, line 3, in ?
File “WEB/python/python.zip/socket.py”, line 156, in init
socket.error: <88, ‘Function not implemented’>
Do you know what I have to do?
Thank you
Hello!
I am connecting a non-DIGI node to DIGI ConnectPort X2 trying to firstly establish a server connection with the gateway and then connecting it to a zigbee device. The code is working on another laptop other than mine while I am having this error:
NameError: global name ‘AF_ZIGBEE’ is not defined
While I have all the libraries installed.
Here’s the code:
import sys
Used for receiving samples from the nodes
Used for parsing sample data packets
from xis import XBeeIOSample
Used for discovering and configuring nodes
import zigbee
import socket # Our main function called at program start
#from socket import *
host = ‘127.0.0.1’
port = 52200
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((host, port))
def main():
# First we create our socket to listen
# for nodes joining the network
# The socket is configured to listen on the
# data endpoint (0xE8) and to time out after
# blocking for 1 second
#sd = socket.socket(socket.AF_ZIGBEE,
# socket.SOCK_DGRAM,
#socket.ZBS_PROT_TRANSPORT)
#sd = socket.socket(socket.AF_ZIGBEE,socket.SOCK_DGRAM, socket.ZBS_PROT_TRANSPORT)
sd = socket(AF_ZIGBEE, SOCK_DGRAM, ZBS_PROT_TRANSPORT)
sd.bind(('', 0xe8,0,0))
sd.settimeout(1)
#Create TCP socket and connect
Please I need a reply as soon as possible
Thank You
I have the same problem…
i followed the instructions here but i couldn’t run the python file into the CP x8 because of this error when trying to create the socket:
File “WEB/python/python.zip/socket.py” line 156, in init
socket.error:<88, ‘Function not implemented’>
Is there any action i can take for that?
Thanks a lot.
Can you confirm the firmware revision running in your X8? That will help narrow down possible suspects.
My firmware of the CP x8 is 2.8.1.12
Hi there,
It sounds like you’re missing the file “zigbee.py”. There are actually two different versions of this: one which is used on the ConnectPort X Gateways, the other which would be used if developing/running the app from a PC.
CP-X ver:
ftp://ftp1.digi.com/support/sampleapplications/zigbee.py
PC ver (within zip):
ftp://ftp1.digi.com/support/sampleapplications/zigbee_py-for-PC.zip
Hope that helps!