# connecting non-DIGI nodes to DIGI ConnectPort X8

**URL:** <https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965>\
**Category:** Python\
**Created:** [December 11, 2008, 2:25pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965 "2008-12-11T14:25:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![aldesa](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@aldesa](https://forums.digi.com/u/aldesa)\
**Post date:** [December 11, 2008, 2:25pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/1 "2008-12-11T14:25:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Admin1](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Admin1](https://forums.digi.com/u/Admin1)\
**Post date:** [December 12, 2008, 3:23pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/2 "2008-12-12T15:23:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jordanh](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jordanh](https://forums.digi.com/u/jordanh)\
**Post date:** [December 12, 2008, 4:21pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/3 "2008-12-12T16:21:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aldesa](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@aldesa](https://forums.digi.com/u/aldesa)\
**Post date:** [December 16, 2008, 7:53am UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/4 "2008-12-16T07:53:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Alejo](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Alejo](https://forums.digi.com/u/Alejo)\
**Post date:** [January 17, 2009, 9:37pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/5 "2009-01-17T21:37:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Server](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@Server](https://forums.digi.com/u/Server)\
**Post date:** [May 27, 2011, 1:53pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/6 "2011-05-27T13:53:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alejo](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Alejo](https://forums.digi.com/u/Alejo)\
**Post date:** [December 22, 2008, 11:27pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/7 "2008-12-22T23:27:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![52637p](https://avatars.discourse-cdn.com/v4/letter/5/c6cbf5/32.png) [@52637p](https://forums.digi.com/u/52637p)\
**Post date:** [December 22, 2008, 11:33pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/8 "2008-12-22T23:33:28Z")

</div>

Can you confirm the firmware revision running in your X8? That will help narrow down possible suspects.

---

<div class="post-metadata">

**Author:** ![Alejo](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Alejo](https://forums.digi.com/u/Alejo)\
**Post date:** [December 22, 2008, 11:43pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/9 "2008-12-22T23:43:38Z")

</div>

My firmware of the CP x8 is 2.8.1.12

---

<div class="post-metadata">

**Author:** ![MST\_616](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@MST\_616](https://forums.digi.com/u/MST_616)\
**Post date:** [May 27, 2011, 2:42pm UTC](https://forums.digi.com/t/connecting-non-digi-nodes-to-digi-connectport-x8/2965/10 "2011-05-27T14:42:34Z")

</div>

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!
