Shop OBEX P1 Docs P2 Docs Learn Events
XBee Problem — Parallax Forums

XBee Problem

ryfitzger227ryfitzger227 Posts: 99
edited 2014-02-28 14:27 in Propeller 1
Hi everyone.

I'm trying to get a propeller to send a string to the computer via XBee. I have one XBee plugged into a USB Adapter Board and then connected to the computer. No other connections are made on that. The other XBee is just plugged into a regular adapter board. It has +3.3V from the QuickStart board going to VCC and VSS is connected to VSS on the QuickStart board also. I have DOUT going to P0 and DIN going to P1. All of the XBee settings have been set to default with X-CTU. Here's my code:
OBJ


  XB  :  "Extended_FDSerial"


CON


  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000


VAR


  long count


Pub Go


  XB.start(0, 1, 0, 9600) ' Initialize comms for XBee


  repeat
    XB.str(string("Hello"))

When I open up the Parallax Serial Terminal and set it to COM11 (the Serial Port of the XBee in the USB Adapter Board) with 9600 baud, nothing comes up. Any ideas on what I'm doing wrong?

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-02-25 21:03
    Which flavor of XBee -- Series 1 (802.15.4 or Digimesh), 2 (zigbee or znet) or 3 (digimesh or XSC)? If they are series 1, 802.15.4 they should talk to one another right out of the box with the default settings. Series 2 are a different matter, because one of them needs to be set up as a coordinator.


    You might want to put a pause of about 5 milliseconds between the "hello"s. The default "packetization timeout" is 3 character widths, about 3ms at 9600 baud. If there isn't a pause, it will continue to accept characters until it has 100 in its transmit buffer.
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2014-02-26 04:40
    I'm using two XBee Pro 900HP. I assume that's series 2, right? Which XBee should I set up as the coordinator? The one that's connected up to the USB Adapter or the one that's connected to the Propller?
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-02-26 12:25
    That's series S3B, and you should see "S3B" printed on top of the module. The default firmware these days is Digimesh. With default settings out of the box it should just work, in the manner you are expecting. The destination address on all modules is set for broadcast mode, all on the same channel etc., so the network like a party line.

    On the bottom of the module, you can find the model number that probably starts with XBP9B-D, and the 16 digit hex MAC address that will be used as the device specific network address.

    I like to start off with a simple terminal loop on the Prop:
    [SIZE=1][FONT=courier new]  repeat
        if (char := uarts.rxcheck(DEBUG)) > 0
          uarts.tx(XPORT,char)
          uarts.tx(DEBUG,char)
        if (char := uarts.rxcheck(XPORT)) > 0
           uarts.tx(DEBUG,char)[/FONT][/SIZE]
    
    A full object is attached. (it uses fullDuplexSerial4port, one port for the debug terminal and one for the XBee.) What you type at the terminal is sent out through the XBee to another XBee, and vice versa. You can also enter "+++" at the debug terminal in and enter commands such as ATVL to see the firmware version, or ATDL to read or set the destination address.
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2014-02-28 14:27
    It turns out this was completely my fault! I wasn't doing anything wrong with the XBee or the code! Haha. The Baud Rate in a VB.NET application I had created was set to 2400 while the XBee was set to 9600. That'll do it! Haha. Thank you for everything.
Sign In or Register to comment.