Shop OBEX P1 Docs P2 Docs Learn Events
XBEE keeps pausing then sending big clumps — Parallax Forums

XBEE keeps pausing then sending big clumps

Keith YoungKeith Young Posts: 569
edited 2011-02-21 09:10 in Accessories
I have a 16 bit value I am sending from one Prop mounted XBEE to another.

I have yet to be able to get these XBEE's, whether Prop or PC mounted, to send a continuous data stream of sending the same 12 or 16 bit updated variable say 5 times a second.

Instead what I seem to always get, no matter what 100th way I code, some smooth data coming in, followed by say 4 seconds of nothing, then a sudden barrage of the past 4 seconds worth of data. It will then send smooth again for a short time untill repeating.

Is there a setting or specific RTS CTS thing I need to be doing? I'd like this to be smoothly sending a 16bit and 4 12bit values smoothly at 100 per second. That's only 6400bps and I have it at 9600 baud.

Tips?

Thanks,

Keith

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2010-12-28 10:13
    Even though the data rate is 9600, there's no guarantees it can handle continuous data rates at that speed. There's a lot that has to happen to get data across. It may be a bad frame needing some retries and slowing things down, and it may be trying to packetize quickly incoming bytes.

    A couple things you might try is to set RO to 0 (zero). This will prevent the XBee from trying to buffer data for a transmission, but send data as it arrives instead.

    Another thing you can do is reduce overhead of acknowledgments back and forth by sending to the broadcast address ($FFFF), though it can lead to more packets not being received (no acks/retries).

    -Martin
  • FranklinFranklin Posts: 4,747
    edited 2010-12-28 10:14
    How have you configured the xbees? What is your code?
  • John AbshierJohn Abshier Posts: 1,116
    edited 2010-12-28 15:07
    >16bit and 4 12bit values
    I would not be surprised if the 12 bit values are sent as two bytes. That is a total of 10 bytes and 10 bits per byte (need a start and a stop). At 100 per second that multiplies to 10,000; just a tad over 9600 baud.

    Why stay at 9600 baud? On the Prop side, even simple serial will handle 19,200 and the PC can also go much faster.

    John Abshier
  • Keith YoungKeith Young Posts: 569
    edited 2010-12-29 22:55
    The current code is

    Receiver:
    repeat
        DataIn := -1
        DataIn := XBE.RxTime(100)                         
        If DataIn == "!"          ' If start delimiter
          XBE.Tx("!")  
          shared := XBE.RxTime(250)
          !outa[4]         
          DBG.Str(String(16))                          
          DBG.Bin(shared,16)
          XBE.rxflush
    

    Transmitter:
    cognew(@entry, @Shared)
      repeat
        !outa[27]                  
        DataIn := -1
        DataIn := XBE.RxTime(100)
        XBE.Tx("!")
        if DataIn == "!"
          !outa[16]   
          'XBE.Tx("!")             ' Send start delimiter 
          XBE.Dec(Shared)
          XBE.CR
    

    They are both configured as default, I just threw a PanID number in.

    I am not against increasing the Baud, I just want to take one small step at a time getting this to work.
  • Keith YoungKeith Young Posts: 569
    edited 2011-01-19 15:37
    How do I put the UNSOLVED tag on the thread title?
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2011-01-20 04:41
    Typically, when things are not resolved after having been given some suggestions, the poster provides feedback on what effect the suggestions have been tried, any effects of them, and other information. This allows others to evaluate further.
  • RR Posts: 5
    edited 2011-02-17 18:03
    Roughwood, are you using series 1 or series 2 XBEE radios?

    I am seeing this same issue with series 2 radios and was wondering if maybe it is a series 2 specific issue.
  • i182willswi182willsw Posts: 3
    edited 2011-02-21 09:10
    Hey the problem, which isn't actually a problem at all is in the xbee. You can change how full the buffer on them has to be before it sends the data. You will need to download X-CTU connect your xbee to the computer(via the explorer) and then go to modem configuration. I'm pretty sure you need to change the RO (packetization timeout) to a very low number or even 0. this makes it so that the xbee doesn't wait until it has x amount of data before sending.
Sign In or Register to comment.