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

netduino XBee Sample


  • Please log in to reply
20 replies to this topic

#1 Terry Massey

Terry Massey

    Advanced Member

  • Members
  • PipPipPip
  • 77 posts
  • LocationPekin, IL

Posted 13 February 2011 - 12:15 PM

All, There was a request last night in the chat room for some help wiring up an xbee connection from the PC to the netduino. I offered to write up a tutorial. This is the first step in the tutorial. Some of this code maybe a little over kill. However By threading it out this way it allows other more important logic to have better control. Please take a look provide feed back and use as you wish. Thanks, Terry Massey

Attached Files


Thanks,
Terry Massey

#2 DeepClick

DeepClick

    New Member

  • Members
  • Pip
  • 4 posts
  • LocationUSA

Posted 13 February 2011 - 02:50 PM

Wow! that was fast! Thx Terry

#3 hari

hari

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts

Posted 13 February 2011 - 05:46 PM

Coincidentally, I was playing with xbees the other day and made these two videos.
One end is a FEZ Domino, the other end is a Netduino.
Not exactly a tutorial, but you may find it interesting.

http://www.youtube.com/watch?v=3BaEKbKiCIo

You may want to watch this one on youtube to so you can read the text. Posted Image
http://www.youtube.com/watch?v=DLTohG6iODM

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 February 2011 - 11:42 PM

Coincidentally, I was playing with xbees the other day and made these two videos.


hari, that's a great video. You do a great job at explaining things. Thanks for posting this!

Chris

#5 DeepClick

DeepClick

    New Member

  • Members
  • Pip
  • 4 posts
  • LocationUSA

Posted 14 February 2011 - 03:26 AM

That's pretty cool!

#6 elettrozero

elettrozero

    Advanced Member

  • Members
  • PipPipPip
  • 58 posts

Posted 22 May 2011 - 07:55 AM

Nice work guys. I'm tryin' to do the same with 2 Series 2 Xbee boards and I'm having no luck. I'm able to "talk" to each board and setting port speed and so on by AT commands but I'm not able to make them talk each other. By watching the video I can seen that pin involved are 1,2,3 and 10, used for VCC, DOUT, DIN and GND. DOUT --> RX on netduino DIN --> TX on netduino I guess I've connected the right way because I receive right answers from Xbee boards. Now: is it correct to suppose that when I send on COM port a string the Xbee board will broadcast the message ?

#7 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 05 December 2011 - 05:59 AM

Hari, Excellent article/tutorial! I love your thorough explanations, clean code and awesome holder kits. I do have some questions. I bought my xbee pro series 2 modules used on Ebay. All the settings were jacked up and I had to play with X-CTU for quite some time to get them to talk to each other. These are what I came up with.... Module #1: --------------------------------------- PAN: 1111 Serial High: 13A200 Serial Low: 4070455E Function Set: ZNET 2.5 COORDINATOR AT Destination High/Low: Other module's serial numbers Baud: 115200 Module #2: --------------------------------------- PAN: 1111 Serial High: 13A200 Serial Low: 407047B2 Function Set: ZNET 2.5 ROUTER/END DEVICE AT Destination High/Low: Disabled... because its set as a router function set and discovers on its own? I don't know. Baud: 115200 too high???? Questions: 1. Are these the correct function sets for simple point to point? 2. Can an XBee shield that doesn't utilize the 6 pin XBEE/USB jumper set (not available on Netduino... used to switch shield to write to module without a USB explorer) work with Netduino since it utilizes 3.3v? 3. Am I reading correctly that your code is actually configuring the address of the module to act as Com1? 4. I see you are sending ATMY command in the event an address is not supplied. ATMY returns an error in terminal mode for me. Is this because I am using the wrong function set? Thank you so much for any assistance. I have wasted an entire weekend trying to get this hooked up and blew up an arduino chip doing it... ugh!

#8 awaiK

awaiK

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 05 December 2011 - 02:21 PM

Module #1:
---------------------------------------
PAN: 1111
Serial High: 13A200
Serial Low: 4070455E
Function Set: ZNET 2.5 COORDINATOR AT
Destination High/Low: Other module's serial numbers
Baud: 115200

Module #2:
---------------------------------------
PAN: 1111
Serial High: 13A200
Serial Low: 407047B2
Function Set: ZNET 2.5 ROUTER/END DEVICE AT
Destination High/Low: Disabled... because its set as a router function set and discovers on its own? I don't know.
Baud: 115200 too high????

Questions:

1. Are these the correct function sets for simple point to point?

Hi Bendage,
to communicate bidirectional you have to configure both side's Destination High/Low registers.

May you should check if you can upgrade your XBee modules to the ZB Firmware.
ZNet 2.5 is an old proprietary mesh-enabling firmware. Since the "ZB featureset pro" firmware is released, ZNet2.5 is no longer support and recommend. It's somewhat confusing, because to old one is called ZNet 2.5 and the new modules "Series 2".
For more information see: Upgrading from ZNet 2.5 to ZB firmware

#9 awaiK

awaiK

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 05 December 2011 - 03:31 PM

4. I see you are sending ATMY command in the event an address is not supplied. ATMY returns an error in terminal mode for me. Is this because I am using the wrong function set?

Hi again,

according to the manual ATMY command is supported by ZNet 2.5.
Did you enter the Command Mode before issuing the ATMY? The default sequence to enter the Command Mode is +++, refer to page 18.

#10 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 05 December 2011 - 06:32 PM

Thank you very much for your response! Had no idea ZNET 2.5 was outdated. I will attempt to upgrade firmware this evening. Should have just bought new ones. Do you recommend using series 2 type modules for simple point to point or should I just buy series 1 modules and set these aside?

#11 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 05 December 2011 - 06:39 PM

based on the link of the pdf you specified, just to confirm... both modules should be burned with Function Set: ZIGBEE ROUTER AT?

#12 awaiK

awaiK

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 05 December 2011 - 09:31 PM

Do you recommend using series 2 type modules for simple point to point or should I just buy series 1 modules and set these aside?

Hi,

series 1 modules are designed for point-to-(multi-)point communication. Series 2 extend this by enabling mesh-networks.
Some people suggest using series 1 modules to start with. But honestly I see no point in using series 1 modules. If you want to use the "easier point-to-point communcation" you can use series 2 modules too.

based on the link of the pdf you specified, just to confirm... both modules should be burned with Function Set: ZIGBEE ROUTER AT?

Hmm,
I'm not 100% sure, but I think you have to flash one with the Coordinator firmware and the other modules with the Router firmware (or End Device firmware).
I'm using Series 2 ZB modules only, there you have to flash one modules with the Coordinator firmware,

#13 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 06 December 2011 - 05:22 PM

Thank you for your help. I actually bought a book called "Building Wireless Sensor Networks" which explains all this in the first 2 chapters. You are right... XBee Series 2 must be set up with one as an AT Coordinator and the other as a AT Router. Also I have two different XBee shields and both seem to work just fine with Netduino. ZB is basically just lower power but same performance correct?

#14 Magpie

Magpie

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts
  • LocationAustralia (south island)

Posted 06 December 2011 - 10:08 PM

Hi


ZB is basically just lower power but same performance correct?


If you're comparing ZB with Wlan then your getting less throught put, probably from less bandwidth but more range for the same power because of the lower data rate. You also get the ad hoc network capability.

I removed a section here, it was wrong and confusing.

If you are comparing Series 1 Xbee with Series 2 then the former is 802.15.4 and the later is Zigbee. At some stage they changed the chipset to make the series 2. Digi has a knowledge base summary entitled "The Major Differences in the XBee Series 1 vs. the XBee Series 2"



Sorry this is straight out of Wikipedia but they can say it better than I.

ZigBee is a specification for a suite of high level communication protocols using small, low-power digital radios based on an IEEE 802 standard for personal area networks. Applications include wireless light switches, electrical meters with in-home-displays, and other consumer and industrial equipment that requires short-range wireless transfer of data at relatively low rates. The technology defined by the ZigBee specification is intended to be simpler and less expensive than other WPANs, such as Bluetooth. ZigBee is targeted at radio-frequency (RF) applications that require a low data rate, long battery life, and secure networking. ZigBee has a defined rate of 250 kbps best suited for periodic or intermittent data or a single signal transmission from a sensor or input device.



RE: Coordinator. if you enable channel hopping ( which is normally a good idea) then you always need the coordinator, then he selects what channel to use. It all goes to sh#$ if your device can't find the coordinator. If two devices next to each other boot up and neither can find the coordinator then they can't even talk to each other.

Edited by Magpie, 07 December 2011 - 11:15 AM.

STEFF Shield High Powered Led Driver shield.

#15 427v8

427v8

    Member

  • Members
  • PipPip
  • 11 posts
  • LocationMinnesota

Posted 06 December 2011 - 11:26 PM


So ZB firmware XBees should be able to talk to non XBee ZB devices.


Agreed with the caution that ZigBees are NOT all that compatible across manufacturers. At the basic level they are OK, but as soon as start doing anything real, you run into different interpretations of the spec and just plain "we didn't think anyone would care about that feature" responses...

I like 802.15.4 the best...then write my own application layer. Sooooo much simpler.
Unless of course you need to interface to a device that uses a specific ZigBee profile.

#16 Magpie

Magpie

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts
  • LocationAustralia (south island)

Posted 07 December 2011 - 01:59 AM

Hi 427v8


Just wondering, I use the terms 802.15.4 and Zigbee as meaning exactly the same, do you?


I like 802.15.4 the best...then write my own application layer. Sooooo much simpler.
Unless of course you need to interface to a device that uses a specific ZigBee profile.


I wasn't 100% sure what you mean here. pls Explain again.

ps. My entire Zigbee knowledge is based on one long term part time project using XBees.
STEFF Shield High Powered Led Driver shield.

#17 awaiK

awaiK

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 07 December 2011 - 07:34 AM

Just wondering, I use the terms 802.15.4 and Zigbee as meaning exactly the same, do you?

Hi,

ZigBee (ZigBee PRO / 2007) is based on 802.15.4.
Digi's Series 1 XBee talk 802.15.4.
Digi's Series 2 XBee talk ZigBee.

Agreed with the caution that ZigBees are NOT all that compatible across manufacturers. At the basic level they are OK, but as soon as start doing anything real, you run into different interpretations of the spec and just plain "we didn't think anyone would care about that feature" responses...

I like 802.15.4 the best...then write my own application layer. Sooooo much simpler.
Unless of course you need to interface to a device that uses a specific ZigBee profile.

That's a nice point regarding Series 1 vs Series 2 modules.

#18 laik777

laik777

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 January 2012 - 10:03 PM

Hei Could you please give me a code for your example? thanks by

#19 hari

hari

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts

Posted 20 January 2012 - 01:53 PM

I've lost track of where those source codes are. Posted Image
Sorry...

Hei

Could you please give me a code for your example?

thanks

by



#20 laik777

laik777

    Member

  • Members
  • PipPip
  • 12 posts

Posted 27 January 2012 - 09:48 AM

Thanks for answear. Now i copied your code from a video, but sometimes i am losing information between xbees. Do you know what is a problem? I am using xbee pros2b thanks by




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.