Shop OBEX P1 Docs P2 Docs Learn Events
XBee Received Data Is Not Transfering to BS2. — Parallax Forums

XBee Received Data Is Not Transfering to BS2.

Set up: Propeller Activity Board control node running C to the main XBee (MXBee) module. The remote node is an XBee (RXBee) interfaced with BS2 Stamp running PBasic. I am using XCTU connected to the remote XBee (RXBee) USB adapter board. ( Propeller -> MXBee ~~~~~>RXBee ->BS2)

The control node sends a character via XBee to the remote node. Problem - The remote node STAMP does not receive or display the received character. I do know that the remote XBee is receiving the control nodes character as seen on XCTU. No display on the STAMP terminal. If I type a character in the XCTU console it is displayed on the STAMP console as planned. Based on the above I believe the Software on the Propeller and Stamp is okay.

Both XBee's are in the pass through mode (not API). I am self-learning this technology but I need some help figuring this out.

Thanks,

Tom

Comments

  • How do you have the remote XBee connected to the Stamp? Please show the Stamp program. I wonder if somehow the remote XBee is configured to use flow control and the Stamp is not supplying it. In that case, the XBee will buffer any incoming characters and not transmit to the Stamp. Often you want to use flow control so the Stamp won't miss any incoming characters, but your SERIN statement has to provide a pin for the flow control signal and that pin has to be wired to the XBee.
  • So here's what you sent me as a PM:
    '
    Initial XBee Stamp Transmit
    
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    '
    Constants & Assignments
    baud CON 84
    
    rx PIN 15
    tx PIN 14
    rts PIN 11
    
    DataIn VAR Byte
    
    '
    Main Program
    
    DEBUG "Program Start", CR
    PAUSE 500
    
    GOSUB init
    
    DEBUG "Awaiting Data...", CR
    
    PAUSE 500
    
    DO
    SERIN rx, baud,[DataIn]
    DEBUG "Data Received is ", DataIn,CR
    SEROUT tx,baud,[DataIn]
    LOOP
    
    init:
    PAUSE 500
    DEBUG CR,CR,"Configuring XBee...",CR
    PAUSE 200 ' Guard Time
    SEROUT Tx,Baud,["+++"] ' Command Mode sequence
    PAUSE 200 ' Guard Time
    SEROUT tx,baud,["ATD6 1,CN",CR] ' RTS enable (D6 1) Exit Command Mode (CN)
    PAUSE 100
    SEROUT tx,baud, ["Main Node Initialized"]
    RETURN
    
    
    END
    
    In your initialization, you enable RTS (Request To Send). That's the flow control I mentioned earlier and you've defined rts as I/O pin 11 which I assume you've connected to the XBee module's RTS pin. Your SERIN statement doesn't use flow control:

    SERIN rx, baud,[DataIn]

    You should add flow control as follows (see the Reference Manual's description for details):

    SERIN rx\rts, baud,[DataIn]
  • Thanks but I already tried that. Made really no difference. Still receive data from main node via xbee and displayed on remote xbee XCTU console. Does not get sent to STAMP. But if I type data on XCTU console stamp displays correctly.
  • You might give a call to Parallax Tech Support. I also suggest that you make up a block diagram of your setup under different circumstances or at least a clearer description and post that. I'm still a little confused about what happens when.
  • I called Parallax first and they suggested to try here.

    Block diagram of the system is attached along with a screen shot and code for both the main and remote processors. Thanks again for your help
  • As far as I can tell, you've got the USB Rx and the Stamp's Rx in parallel with the XBee's Tx and the USB Tx and Stamp's Tx in parallel with the XBee's Rx. The two Tx lines may fight each other. The RTS lines from the USB and Stamp are also in parallel feeding the XBee's RTS input. The XBee could theoretically send to both USB and the Stamp if the timing works out right, but you're courting damage to the paralleled outputs.
  • OK got it to work by unplugging the USB connection to the XBee adapter. That may be what you were saying above. Anyway I guess I got to smart for my own good by trying to follow the comms flow.

    Thanks again for your help.
Sign In or Register to comment.