Dear Hanzibal,
I build my Network with two XBee pro S2 as Router and gateway ConnectPort x4 as Cordinator ... i want to use the topology Star ... the xbee(s) communicate only with the gateway (but I do not know if what I want is feasible or not with this topology)
The configuration:
--->In the gateway:*PAN ID: 0x4a59
*channel: 0xc
*scan all channels
[font="arial, helvetica, sans-serif;"]---->In router 1: XBee Pro 2:[/font]
*PAN ID: 4a59
*channel scan: 16
*DH, DL destination: 0
---->In router 2 : XBee Pro 2:
*PAN ID: 4a59
*channel scan: 16
*DH, DL destination: 0
With this script int the gateway , i discover my network :(work 1000%)
----
import sysimport osimport zigbeeimport binasciiimport timefrom socket import *import structprint 'Starting up...'nodes = zigbee.getnodelist(refresh=True)nodes = filter(lambda x: x.type != 'coordinator', nodes)# Print the table:print "%12s %12s %8s %24s" % ("Label", "Type", "Short", "Extended")print "%12s %12s %8s %24s" % ("-" * 12, "-" * 12, "-" * 8, "-" * 24)for node in nodes:print "%12s %12s %8s %12s" % (node.label, node.type, node.addr_short, node.addr_extended)
----
Now i want to receive data from the network :
i tried this script But i receive data from only one Xbee not all my network!!
from socket import *# Create the socket, datagram mode, proprietary transport:sd = socket(AF_XBEE, SOCK_DGRAM, XBS_PROT_TRANSPORT)sd.bind(("", 0xe8, 0, 0))# Block until a single frame is received, up to 255 bytes:print "Waitting For New Packet"#sd.recvfrom(packetSize)data, src_addr = sd.recvfrom(255)print "the data :"print dataprint "src"print src_addr