Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

WSN + Gateway connectPort X4

xbee

  • Please log in to reply
3 replies to this topic

#1 urzan

urzan

    New Member

  • Members
  • Pip
  • 2 posts

Posted 14 March 2013 - 12:08 PM

i need some help , i receiver the data with the gateway (not like a tuto xbee/X-CTU) first,i configure with the X-CTU  the XBee and the gateway  and there are data from xbee to the gateway script python: 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) payload, src_addr = sd.recvfrom(255) print "payload" print payloa Now,i like send data like the tuto with the arduino but i usr the gateway i receiver this :picture thanks Sincererly,

Attached Files

  • Attached File  pyt.png   19.25KB   7 downloads


#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 14 March 2013 - 07:37 PM

Hi there! I think you have to describe in more detail what you are trying to do and what equipment you are using. I've never used Python but as for the image, what makes you so sure the results are wrong? Assuming "tuto" means tutorial, could you supply a link to it?

#3 urzan

urzan

    New Member

  • Members
  • Pip
  • 2 posts

Posted 17 March 2013 - 09:37 AM

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


#4 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 18 March 2013 - 01:11 AM

Is it always the same Xbee board that fails to report in or does that vary from one test run to another? Try swapping the configs of the both xBees - is it still the same physical board that fails to report?





Also tagged with one or more of these keywords: xbee

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.