Shop OBEX P1 Docs P2 Docs Learn Events
XBee Series 2 Getting Started — Parallax Forums

XBee Series 2 Getting Started

teckertecker Posts: 7
edited 2014-04-05 12:13 in Accessories
Could anyone point me to resources for getting started with the XBee Series 2 modules. My professor and I purchased the series 2 because of the long range capabilities (we figured the better the distance the less likely hood we would loose connection at a bad time). However I am finding that the Series 2 take a little work to get running. We failed to purchase a USB interface (soon to be fixed) to do programming.

This is what I understand so far:
  • At least one XBee module needs to be in Coordinator mode. The rest can be in Router or EndPoint.
  • Series 2 can be run in either AT or API modes
  • Firmwares exist for all 6 configurations (Cord-At,Route-At,EP-At,Cord-API,Route-API,EP-API) and at least 1 must be flashed to the module to begin using it.
  • Example code is primarily geared to series 1 modules and is not necessarily compatible with series 2
Here is what I am trying to do:
  1. Create a simple Point-2-Point wireless connection
  2. The system will likely be setup as Coordinator <<->> Router
  3. Get a firmware on the XB2 sans USB Programer if it is even doable
  4. Find example code to get our project ported from 433MHz links to XB2-Mesh
If anyone can kindly point to any howto or can give any idea where I can get started that would be nice. Thanks.

Comments

  • Daniel HarrisDaniel Harris Posts: 207
    edited 2010-09-20 16:49
    Hello Tecker!

    I have been working on a document to be posted for EXACTLY this application - point to point with XBee Series 2. With what I have, I get really snappy communication between both modules - like what you would get if you have the series 1 modules. I have the content down but its not yet in a "prettied up" format to post on the website.

    It would be a great test for me if you went through it and tried to configure your modules with it. You could give me some good feedback on how to make the document better. :) If you would like to give it a go, send me a PM and I'll send you what I have.

    You have the idea right, you will configure one module as a Coordinator and the other as a Router. The trick is to configure the Coordinator to ONLY talk with the Router, and visa-versa.

    As for configuring the modules without the USB adapter, you can totally do that! You just have to do a little extra wiring. Check out the attached pic. Basically, you need to connect the TX and RX lines to the XBee's DIN and DOUT pins respectively and then connect the XBee's ground pin to give it a reference to the computer. Be careful using a line level COM port - those typically operate at higher voltages than the USB COM port and will likely damage your module (maybe use a MAX232 chip to manage this).

    Lemme know how things go :D

    xbee%20prop%20plug.png
  • teckertecker Posts: 7
    edited 2010-09-21 06:12
    Excellent, I will send you that email.

    As for the XBee module via the propeller plug, we only have Basic Stamp boards. I have a Board of Education with BS2 and BS2x modules and a BS2pe MOBO board and SIP adaptors for the XBee modules. Can I program through one of those BS2s or do I need to hack up a USB cable/use a USB-Serial adapter (got one of those)/buy the board to make the connection you diagrammed below?
  • Daniel HarrisDaniel Harris Posts: 207
    edited 2010-09-21 15:41
    The big thing here is that you need to set one of the XBees up as a coordinator which requires changing the firmware. Otherwise, you can just send commands to the XBee to do the configuration. I'll get to that in a moment.

    Solving the connection issue... It would be best if you could use the USB-serial adapter. That way, you wouldnt have to convert RS232 levels to TTL. Hopefully you have an extra serial extension cable. If so, you can plug one end into your USB-serial adapter and cut the other to gain access to the Transmit, Receive, and Vss/ground pins. Just connect those to the XBee SIP header like you would with the Prop plug. That should get you communicating.

    Ok, the commands. From what I can tell, all the commands that you can change using the X-CTU tool, you can issue the XBee serially and modify. All you have to do is put the XBee in command mode ("+++" by default, wait for the OK) and then issue your AT command. For example, if you wanted to get the node identifier, you would do the following (my commands in regular font, XBee responses in bold):

    +++OK
    ATNI <enter>
    COORDINATOR

    You can set these attributes by adding your setting as an argument to the command. For example, setting the Node Identifier:

    +++OK
    ATNI BOB<enter>
    OK
    ATWR <enter>
    OK
    ATNI <enter>
    BOB

    The command ATWR stands for "write". This writes the settings to the XBee's flash memory. Since this is flash memory, it does have a limited number of write cycles. The XBee datasheet notes this - its ok to use, just dont issue the command after EVERY change. If you dont write the flash the setting will stay loaded into RAM until the XBee is rebooted/power cycled.

    If you want to know more about issuing commands to the XBee manually with a serial connection (either by PC or uController), just let me know. I could go on about it. (dont want to bore you or confuse with extraneous fine details though) :D
  • teckertecker Posts: 7
    edited 2010-10-01 17:59
    Hmmm. Sorry for the delay on this message. I have been moving to a new room at our office and didn't have much time to work on this. Here is the status update.

    I still am having trouble connecting to the modules to the computer. I am trying to hack up a serial DB9 cable. I have the following configuration

    Computer/BOE
    XBee Sip Adapt 32402A
    BOE Vdd
    +5V
    BOE Vss
    GND
    PC Tx (Pin 3)
    Din
    PC Rx (Pin 2)
    Dout
    <nothing>
    /RTS (Unconnected)

    With this hooked up I have on the SIP board PWR, On_Sleep, ASSOC and TX lights on. Using a Prolific USB-Serial (Com5) adapter when I query out of XCTU Nothing comes up. It tells me communications failed. I have even put XTCU in XP compatibility on Win7 to no avail. Am I doing things right? I think I am going to need to break down and buy a USB to XBee adapter but that will take time to come in.
  • FranklinFranklin Posts: 4,747
    edited 2010-10-01 18:23
    Depending on your pc you could have burned out your adapter or the xbee. If your computer has rs232 levels on the db9 you are putting 10 to 12v on the 5v inputs of your adapter. Check this with a meter before going any further.
  • Daniel HarrisDaniel Harris Posts: 207
    edited 2010-10-05 18:10
    Since you are using the XBee SIP adapter, your module is likely protected from voltage spikes. That SIP adapter has a 5V to 3.3V translator on it, essentially acting as a buffer. IF things did go wrong, it probably didnt hurt your XBee.

    Did you make sure that you tied the GND pin on your XBee to the computer's GND somehow? This provides the module a common reference point with the computer so that the two can "talk apples to apples".

    The minimum connections you need to power and talk to the XBee are as follows:

    +5V/3.3V
    > Vdd/Vcc respectively (make SURE that only 3.3V is connected to Vcc as this goes straight to the XBee. I.E. only run power to the Vcc line if its coming through a 3.3V regulator.) Otherwise, connecting +5V to Vdd will be fine as it goes through a voltage regulator on the SIP adapter.

    DIN
    > Conncet to Tx
    DOUT
    > Connect to Rx
    GND
    > Connect to GND
  • teckertecker Posts: 7
    edited 2010-10-06 13:43
    Franklin wrote: »
    Depending on your pc you could have burned out your adapter or the xbee. If your computer has rs232 levels on the db9 you are putting 10 to 12v on the 5v inputs of your adapter. Check this with a meter before going any further.

    I pulled out my multimeter and checked. I am seeing about -6.6v on the Tx line and 0.0 on the Rx line when checked off of the Signal ground pin (mm+ to pin 3, mm- to pin 5 on USB-Serial). Trying Pin3 to Vss on a BOE shows 0.0 volts.
    Did you make sure that you tied the GND pin on your XBee to the computer's GND somehow? This provides the module a common reference point with the computer so that the two can "talk apples to apples".
    No I really didn't. I had thought of that but didn't know quite sure how to go about that. Below is what I tried for a wiring diagram, I have the XBee SIP adapter hooked up as follows:

    +5V
    > Vdd {5v coming from a Board of Education Vdd pin}
    DIN
    > Conncet to Tx {pin 3 on serial converter}
    DOUT
    > Connect to Rx {pin 2 on serial converter}
    GND
    > Connect to GND {connected to BOE Vss and pin5 of serial converter}

    If I try to run the GND to just pin 5 on the Serial converter nothing lights up on the board. I dont know if tyings pin 5 to PowerNegitive/Ground will help but there is not Ground port on the Xbee side.

    When I connect the system as shown above then what I get is the Tx light always on. This happens even if I don't connect anything but Vdd and Vss to +5 and Gnd respectively. Should I at this point assume the SIP adapter is fried?
  • donnpangydonnpangy Posts: 49
    edited 2010-10-09 12:45
    I am also trying to communicate with the Xbee Pro series 2 unit attached to the Parallax sip adapter. I have 2 sets that I am trying to configure with the series 1 code that I found on the OBEX. Is there any documentation ready, which will walk me through the setup?
    Is there any test code to just transfer some text and variables that is written for the series 2?

    I would love to see these communicating.

    Thanks,
    Don
  • teckertecker Posts: 7
    edited 2010-10-12 22:59
    @don: Dan Harris sent me a draft form of some documentation. I dont quite know what you are trying to do. If you are wanting to do point-to-point serial communication then his guide will get you up and running. If you are trying to mesh net then that will take some more work. Email him to be a beta tester of the guide.

    If you follow Dan's guide you can use most of the simple serial transmit and receive code. I was successfully using just some test code to my computer over my link I made. I to am going to be looking at more complex solutions but for the time being what I have works.

    @Dan, I am going to send you some suggestions. I was able to get it working but I think some things could be explained better for more novice users.
  • donnpangydonnpangy Posts: 49
    edited 2010-10-13 19:25
    Thanks,
    That is exactly what I am looking for . . . a very simple network.

    I will send Dan an e-mail to ask him for his instructions.

    I will let you know how it works.

    Thanks again,
    Don
  • donnpangydonnpangy Posts: 49
    edited 2010-10-18 21:19
    Daniel Harris,
    Thanks so much for the instructions for the XBEE Pro series 2. You did a great job, which would have been a lot harder without your instructions.

    The terminal test at the end is great diagnostic tools to verify simplest communications exist. I keep going back to verify it still works.

    The propeller drivers are great. I go between the onboard prop driver and the "parallax serial terminal" with no problems at all.
    Thanks again,
    Don
  • donnpangydonnpangy Posts: 49
    edited 2010-10-18 21:27
    Daniel Harris,
    I am trying to communicate between 2 props now and I am having a problem with the RX command on the full duplex serial. I have no problem transmitting, but I loose data using the RX command (on the receive side).
    I am using 9600 baud and get very intermittent loss of data from prop to prop.

    This should be like trying to send data from prop to prop directly . . . maybe I should look up code on the OBEX under that.


    Thanks again,
    Don
  • donnpangydonnpangy Posts: 49
    edited 2010-10-21 00:20
    Daniel Harris,

    The Xbee pro series 2 network is running great.

    I am now communicating prop to prop, with no problems.

    Thanks again,
    Don
  • donnpangydonnpangy Posts: 49
    edited 2010-10-21 18:28
    Daniel Harris,

    2 questions for you . . .

    It now takes 8 seconds for association, when you first turn it on. Is there any way to shorten this?

    Now that these Xbees just communicate with each other, how difficult is it to add another?

    Thanks again,
    Don
  • Kevin CookKevin Cook Posts: 159
    edited 2010-10-21 19:09
    donnpangy,

    To add more devices to your network, it will just be a matter of updating the new device with the same PAN ID and setting up the Function Set for the device you added. Then based on the Function you setup for that device, determines how you address it.

    You may see some association time increases if you have some of the notifications and verifications enabled which could slow you down.
  • donnpangydonnpangy Posts: 49
    edited 2010-10-21 19:38
    Kevin Cook,
    Thanks for the quick reply.

    Do you know which notifications and verifications I can safely turn off? I would like to shave off as much time as I can.

    I am looking at putting this in a hand held battery operated device, so every second counts.

    Thanks,
    Don
  • ikeetikeet Posts: 1
    edited 2014-04-05 11:12
    Hi guys, I realise that I am posting in an extremely old thread, but I wonder if Daniel ever managed to upload his text document anywhere, as I am having difficulty getting my Xbee S2 coordinator and router to talk in a two way manner! Any advice appreciated
  • PublisonPublison Posts: 12,366
    edited 2014-04-05 11:17
    ikeet wrote: »
    Hi guys, I realise that I am posting in an extremely old thread, but I wonder if Daniel ever managed to upload his text document anywhere, as I am having difficulty getting my Xbee S2 coordinator and router to talk in a two way manner! Any advice appreciated

    Welcome to the forums!

    Have you downloaded the book from:

    http://www.parallax.com/product/122-32450

    Free to download.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-05 12:13
    Have you seen this book?

    It deals primarily with the Series 2 (ZigBee) XBees.

    What processor are you using?

    I have a project using two Series 2 XBees. I haven't worked out all the kinks yet but I do have the XBees talking with each other.

    I could take a snap shot of my X-CTU screen if you think it would help.
  • KC8DKTKC8DKT Posts: 76
    edited 2016-02-04 20:19
    Here is an EASY how to get 2 S2 units talking in AT mode FAST like the xbee S1 units.

    http://tutorial.cytron.com.my/2012/03/08/xbee-series-2-point-to-point-communication/


    Coordinator
    SH-Coordinator (copy to router/endpont DH)
    SL-Coordinator (copy to router/endpont DL)

    DH-Router/Endpont = Coordinator SH
    DL-Router/Endpont = Coordinator SL



    Router/Endpont
    SH-Router/Endpont (copy to Cordinator DH)
    SL-Router/Endpont (copy to Cordinator DL)

    DH-Coordinator=Router/Endpont SH
    DL-Coordinator=Router/Endpont SL


    This will fix the huge delay when you TX/RX between 2 units. This is for 2 units ONLY like
    a XBeeS1setup for AT transparent mode.





Sign In or Register to comment.