Shop OBEX P1 Docs P2 Docs Learn Events
XBee help - two modules won't comm with each other — Parallax Forums

XBee help - two modules won't comm with each other

shmowshmow Posts: 109
edited 2010-06-23 01:24 in Propeller 1
Hello All,
I'm in chapter 5 of the Parallax programming and customizing...(official book).
I have two xbee pros. One module is connected to my desktop with a carrier board.
The other module is wired to a propeller demo board.

I've triple-checked all the connections and the spin program.
I've put an oscilloscope on the "remote" xbee (which sends data to the desktop-connect xbee), and there is a signal going to the Tx pin of the remote xbee.

I know they communicate when I jumper TX with Rx on the remote module (previous lessons in chapter 5).

I'm just complete befuddled that the remote data won't show up on the X-CTU terminal display.

Here's the relevant code (with some minor changes for simplification -for my sake).

{{
***************************************
* Simple_PC_Monitoring_from_Remote *
* Martin Hebel *
* Version 1.0 Copyright 2009 *
***************************************
* See end of file for terms of use. *
***************************************

Sends sensor information to remote
XBee for displaying on PC.

}}

CON

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

' Set pins and Baud rate for XBee comms
XB_Rx = 7
XB_Tx = 6
XB_Baud = 9600

OBJ
XB : "FullDuplexSerial"

PUB Start
XB.Start(XB_Rx,XB_Tx,0,XB_Baud) ' Initiate XB Comms

delay(3000) ' Guard time for cmd mode
XB.str(string("+++")) ' Send AT command request
delay(3000) ' Guard time
XB.str(string("ATDL 0,CN")) ' Send code to set DL = 0
XB.tx(13) ' Send carriage return


XB.str(string("Remote unit Ready!",13)) ' send ready string to base
delay(1000) ' 1 second delay

repeat
SendData


Pub SendData | range
range := 250 ' Get range in mm
' Get bearing (0-8191)
XB.str(string(13,13,"Ping Range(mm): "))' Send string to base
XB.dec(range) ' Send range as decimal

Pub Delay(ms)
'' Accepts number of milliseconds for delay time
waitcnt(clkfreq/1000 * ms + cnt)



I can't seem to get the two xbees to communicate in this case.

Am I missing something?

Regards,
Shmow

Comments

  • Erik FriesenErik Friesen Posts: 1,071
    edited 2010-06-22 18:39
    Can you get us a screen shot of xctu? There are a couple of things HIGH on the list of things to check first.

    Have you selected the correct com port on pc settings?

    Have you selected the correct baud rate in the same screen?

    Does the test/query button find the module?

    I had one module(xtend) that had its baud rate set at 1200, and boy did it take a while to get that one figured out. You can reset the module and use +++ to enter command mode, then set your baud rate to a known value.
  • shmowshmow Posts: 109
    edited 2010-06-22 20:02
    Erik,
    yes, I've done the test/query and it can find the module.
    The configuration looks correct as I can send one way (main -> remote) but not the other (remote -> main).
    The spin code on the remote sets the configuration so that's looks correct.
    Can you wire the Tx/Rx pins of the xbee directly to the prop's pins? That's what I've done. Could that be the problem?
    Regards,
    Shmow
  • shmowshmow Posts: 109
    edited 2010-06-22 20:39
    Erik,

    also, I've even connected the prop plug directly to the xbee and tried to get a response with the X-CTU. No luck.

    Regards,
    Shmow
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2010-06-22 20:43
    Do you get an echo if you tie the rx/tx pins together on the other module?
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2010-06-22 20:44
    I also assume you are using the terminal window, and that the window opens ok.
  • shmowshmow Posts: 109
    edited 2010-06-22 22:33
    Erik,
    Yes, on both points.
    Shmow
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2010-06-22 22:44
    You get an echo?
  • shmowshmow Posts: 109
    edited 2010-06-22 23:04
    Yep.
  • rpdbrpdb Posts: 101
    edited 2010-06-22 23:20
    Connect a jumperwire from Tx to Rx on the XBee that you connect to your USB. That will establish a "loop-back" and you should get an "echo" of all that you send on your terminal screen. I had problems at first because the PC settings were wrong. check the baud, parity, stopbits and xON xOFF settings. Set to XBee defaults.

    The biggest problem I had was with matching the Terminal "PC" settings to the XBee.

    Once you get the local Xbee to loop back, take the jumper off the local xbee and jumper Tx/Rx on the remote Xbee.
    Then you can check the RF link.
    The XBee tool has a search function to find other Xbees, do a search for remotes, look at their addresses. Make sure the ATMY address is consistent on both the master/slave, use the xbee tool for this, make sure baud etc match between both.

    If you don't yet have it, get the PCMP (programming and configuring the Propeller) book. Chapter 5 got me through setting these up.

    They work wonderfully once you set them up, I am running about 230_400 bps for half a mile so far.

    Did you get the latest xbee object off the OBEX?


    ps what board are you connecting to? If it is a MSR1 you might have a problem with connecting a capacitive load to the translators. They will go in to oscillation at > 10pF.
    Let me know if this helps.

    rpdb

    Post Edited (rpdb) : 6/22/2010 11:39:49 PM GMT
  • shmowshmow Posts: 109
    edited 2010-06-22 23:36
    rpbd,
    thanks for your reply.
    the funny thing is that I'm in Chapter 5 of that book you suggested.
    I've performed the loop back on the remote xbee, and with the xbee connected to my computer, I can see the echo (via the terminal).
    But, it's the prop plug that doesn't seem to work. I've followed the diagrams from the book but when I query, nothing is found.
    That I can't figure out.
    I'm glad your project is working - that gives me hope.
    regards,
    Shmow
  • rpdbrpdb Posts: 101
    edited 2010-06-22 23:40
    Ok,

    So you have a loop back accross the rf link, Yes?
  • Ken GraceyKen Gracey Posts: 7,401
    edited 2010-06-22 23:44
    Are both XBees on the same channel?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ken Gracey
    Parallax Inc.

    Follow me at http://twitter.com/ParallaxKen for some insider news.
  • shmowshmow Posts: 109
    edited 2010-06-22 23:50
    rpdb,
    yes, I've jumpered the Tx/Rx of the remote and I get a reply.

    ken,
    yes, they are both channel C.

    Regards,
    Shmow
  • shmowshmow Posts: 109
    edited 2010-06-23 00:04
    Hey all,
    thanks for your time & help; I figured the prop plug out - I misinterpreted the pin assignments - Dout of the xbee connects to the Rx of the prop plug and Din of the xbee connects to the Tx of the prop plug.
    Cheers all 'round!
    Shmow
  • rpdbrpdb Posts: 101
    edited 2010-06-23 00:07
    Ok,

    so divide and conquor. The rf link is working with a loopback so it is time to look at the code (hardware up and working).

    on the remote do something like:

    repeat
    Xbee.tx("i am the remote,can you hear me")

    to run a continuous xmit loop to see if you find that on your local xbee terminal recieve panel.
  • rpdbrpdb Posts: 101
    edited 2010-06-23 00:12
    Do you have Communication now that you have RX din and TX dout?
  • shmowshmow Posts: 109
    edited 2010-06-23 01:15
    Yes, thanks rpdb.
  • rpdbrpdb Posts: 101
    edited 2010-06-23 01:24
    Noooo,

    Is it working now, so we can all breath a sigh of relief with you? What range? What Baud rate?

    I just love succsess stories that you can share where or how you tackled the problem...

    What did you find that worked for you. (200 word essay requested) The other users could use this.


    rpdb

    Post Edited (rpdb) : 6/23/2010 1:36:52 AM GMT
Sign In or Register to comment.