Shop OBEX P1 Docs P2 Docs Learn Events
xbee not transmitting or receiving any data — Parallax Forums

xbee not transmitting or receiving any data

SRLMSRLM Posts: 5,045
edited 2009-06-10 16:13 in Propeller 1
Hi,

I'm probably forgetting something simple, but I can't seem to get any data through two xbees. I'm trying to use the serial interface ("transparent" from the documentation) and I thought it would be easy. I guess I've proved myself wrong once again. [noparse]:)[/noparse]

I'm trying to send data over the wireless link from one Xbee to another, but in the same Propeller (different cogs).

On the receiving end, I simply get "ÿ" as the output, which I've figured out corresponds to binary '11111111'.

I tried connecting the TX pin to the receive pin directly across the PPDB I/O header with a 470ohm resistor and it worked fine. I've tried both FullDuplexSerialPlus.spin and Xbee_Object.spin, and neither seem to do the job. I've posted the code and a photograph of the setup. Any thoughts?


{{Tests two modules on one board.}}

CON

  'These are clock constants
  _xinfreq = 5_000_000                      
  _clkmode = xtal1 | pll16x
 
OBJ 
  XBTransmit   : "XBee_Object"
  XBReceive    : "XBee_Object"       
  debug : "FullDuplexSerialPlus"  

Pub Start | counter
    XBTransmit.start(0,1,0,9600)           ' XBee Comms - RX,TX, Mode, Baud
    XBReceive.start(15,16,0,9600)
    debug.start(31,30,0,57600)       ' Initialize comms from Prop to PC
    waitcnt(clkfreq*5 + cnt)

    repeat                               'repeat infinitely
      repeat counter from 97 to 122     'output a-z
        
        XBTransmit.tx(counter)
        debug.tx(counter)                'output sent char to terminal
        waitcnt(clkfreq/2 + cnt)
        debug.tx(XBReceive.rxcheck)      'output received char

2048 x 1152 - 790K

Comments

  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-06-10 00:48
    XBee's are not the easiest things to use.
    That said, did you set the XBee's up?
    Run the X-CTU setup program yet ?
    There is more to XBee's than one thinks, BUT, once you get the hang of it, they are great.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2009-06-10 03:29
    Hi SRLM,

    You have series 2 XBees. You can't simply use the MAC address, as you could with the series 1. One of XBees has to have the coordinator firmware, as opposed to router/endpoint firmware. Or, you have to have another XBee nearby that that acts as a coordinator. The coordinator has to be present at least initially to assign network addresses, but after that it is optional until the address assignment expires.

    If you purchase series 2 XBees from a supplier like Mouser, they will come to you programmed as router/endpoint. Use XCTU to reflash one of them as a coordinator. Then it should work just fine and you can use the MAC addresses to do point to point communication.

    IMHO Digi has not done themselves a favor by having so a multiplicity of devices they call "XBee". To add to the confusion or to the potential, depending on perspective, the series 2 XBee hardware can be flashed with either the ZNet or the ZB firmware, and the series 1 XBee hardware can be flashed with either the 802.15.4 or the DigiMesh firmware. The two hardware platforms are different, and each platform has multiple possible firmware versions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • SRLMSRLM Posts: 5,045
    edited 2009-06-10 05:39
    Thanks both. I downloaded and ran the X-CTU program, and setup the Xbees as found in this guide (one as router, one as coordinator, with the same unique PAN). I hooked it back into my propeller circuit, and hooked up an associate LED on the router and another LED on the coordinator. I turn it on and the LEDs begin to flash (the coordinator's is about twice as fast the routers, which according to the manual is what it's supposed to do. Unfortunately, always blinks, even if I remove cut the power to one of the Xbees.

    I tried it in a different location that may or may not have less RF interference, but even with only one Xbee powered I still got a blinked associate.

    I also tried the AT_init command in the Xbee_Object.spin, but it didn't seem to help.

    I think that my problem might be that according to the PDF page 12 of the manual (here) I'm not giving it a start bit. I'm not sure how to go about doing that though?

    The data is still the same...

    Edit: I'm a little bit lost on all the different Xbee modules. Is this one the same that I have and is it compatible with this one? It appears that mine differ only in the text.

    Post Edited (SRLM) : 6/10/2009 5:46:15 AM GMT
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2009-06-10 16:13
    I suggest you start with each XBees in turn connected to the terminal mode of XCTU. Program each XBee with the MAC address of the other as its destination using the ATDH and ATDL commands, and then write it to eeprom with ATWR. Be sure to check that the addresses stick, because the time allowed to enter commands is limited. (although there is an AT command to change the timeout too.) With the destination addresses preprogrammed it should be easier to get going with point to point communication.

    Once that is done, leave the coordinator attached to XCTU and move the other XBee over to the Prop.

    Now see if both will associate. Use the ATND (node discover) in the XCTU terminal to see what is out there. For purpose of development, I found it very useful to start with the command set manually from the terminal mode on the PC. Watch out for the timeouts!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.