parsed data not showing

my parsed data is not showing but my serial read is
tx

/*
 Example sketch for the PS4 Bluetooth library - developed by Kristian Lauszus
 For more information visit my blog: http://blog.tkjelectronics.dk/ or
 send me an e-mail:  kristianl@tkjelectronics.com
 */
#include <PS4BT.h>
#include <usbhub.h>
// Satisfy the IDE, which needs to see the include statment in the ino too.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#include <SPI.h>
#endif

USB Usb;
//USBHub Hub1(&Usb); // Some dongles have a hub inside
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
/* You can create the instance of the PS4BT class in two ways */
// This will start an inquiry and then pair with the PS4 controller - you only have to do this once
// You will need to hold down the PS and Share button at the same time, the PS4 controller will then start to blink rapidly indicating that it is in paring mode
//PS4BT PS4(&Btd, PAIR);
// After that you can simply create the instance like so and then press the PS button on the device
PS4BT PS4(&Btd);

#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial xbee(5, 4); // TX, RX
int LYVALUE;
int LXVALUE;
int oldLYvalue;
int oldLXvalue;
int RYVALUE;
int RXVALUE;
int oldRYvalue;
int oldRXvalue;
int oldCvalue;
int oldDvalue;
int angleC = 96;
int angleD = 90;
int Forward;
int Backward;
int Movement;
int oldmove;
const byte numChars = 32;
char *msgForRx = "";
char *oldmsgForRx = "";
boolean Frwrd = false;
boolean Bkwrd = false;
bool printAngle, printTouch;
uint8_t oldL2Value, oldR2Value;
char receivedChars[numChars];
char tempChars[numChars];
char messageFromRx[numChars] = {0};
boolean newData = false;
boolean connection = false;
int tick = 0;
int timeout = 0;
int oldtimeout = 0;

void setup() {

  Serial.begin(19200);
#if !defined(__MIPSEL__)
  while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
#endif
  if (Usb.Init() == -1) {
    Serial.print(F("\r\nOSC did not start"));
    while (1); // Halt
  }
  Serial.print(F("\r\nPS4 Bluetooth Library Started"));
  xbee.begin(19200);
}
void loop() {
  Usb.Task();

  if (PS4.connected()) {
    if (PS4.getAnalogHat(LeftHatX) || PS4.getAnalogHat(LeftHatY) || PS4.getAnalogHat(RightHatX) || PS4.getAnalogHat(RightHatY))
    {
      //Stick Values
      LYVALUE = PS4.getAnalogHat(LeftHatY);
      LYVALUE = map(LYVALUE, 0, 255, 130, 45);
      LXVALUE = PS4.getAnalogHat(LeftHatX);
      LXVALUE = map(LXVALUE, 0, 255, 39, 120);

      RYVALUE = PS4.getAnalogHat(RightHatY);
      RXVALUE = PS4.getAnalogHat(RightHatX);

    }

    //==================================================
    if (PS4.getAnalogButton(R2) != oldR2Value && !Bkwrd) {// Only write value if it's different
      oldR2Value = PS4.getAnalogButton(R2);
      Forward = PS4.getAnalogButton(R2);
      Forward = map(Forward, 0, 255, 88, 130);
      Frwrd = true;
      Movement = (Forward);
    }
    else {
      Frwrd = false;
    }
    //==================================================
    if (PS4.getAnalogButton(L2) != oldL2Value && !Frwrd) { // Only write value if it's different
      oldL2Value = PS4.getAnalogButton(L2);
      Backward = PS4.getAnalogButton(L2);
      Backward = map(Backward, 0, 255, 87, 45);
      Bkwrd = true;
      Movement = (Backward);
    }
    else {
      Bkwrd = false;
    }

    if (PS4.getButtonClick(PS)) {
      Serial.print(F("\r\nPS"));
      PS4.disconnect();
    }
    else {
      if (PS4.getButtonClick(TRIANGLE)) {
        msgForRx = "Triangle";
      }
      if (PS4.getButtonClick(CIRCLE)) {
        msgForRx = "Circle";
      }
      if (PS4.getButtonClick(CROSS)) {
        msgForRx = "Crosss";
        // PS4.setLedFlash(10, 10); // Set it to blink rapidly
      }
      if (PS4.getButtonClick(SQUARE)) {
        msgForRx = "Square";
        //PS4.setLedFlash(0, 0); // Turn off blinking
      }

      if (PS4.getButtonClick(UP)) {
        msgForRx = "Up";
        //PS4.setLed(Red);
      } if (PS4.getButtonClick(RIGHT)) {
        msgForRx = "Right";
        //PS4.setLed(Blue);
      } if (PS4.getButtonClick(DOWN)) {
        msgForRx = "Down";
        //PS4.setLed(Yellow);
      } if (PS4.getButtonClick(LEFT)) {
        msgForRx = "Left";
        //PS4.setLed(Green);
      }

      if (PS4.getButtonClick(L1))
        msgForRx = "L1";
      if (PS4.getButtonClick(L3))
        msgForRx = "L3";
      if (PS4.getButtonClick(R1))
        msgForRx = "R1";
      if (PS4.getButtonClick(R3))
        msgForRx = "R3";

      if (PS4.getButtonClick(SHARE))
        msgForRx = "Share";
      if (PS4.getButtonClick(OPTIONS)) {
        msgForRx = "Options";
        printAngle = !printAngle;
      }
    }
  }
  //pan
  if (RXVALUE < 40 && angleC >= 0 && angleC < 180 ) {
    angleC += 1;
  }
  if (RXVALUE > 160 && angleC > 0 && angleC <= 180) {
    angleC -= 1;
  }
  //tilt
  if (RYVALUE < 40 && angleD >= 0 && angleD < 180) {
    angleD += 1;
  }
  if (RYVALUE > 160 && angleD > 0 && angleD <= 180) {
    angleD -= 1;
  }
  delay(10);
   recvWithStartEndMarkers();
  if (newData == true) {
    strcpy(tempChars, receivedChars);
    // this temporary copy is necessary to protect the original data
    //   because strtok() replaces the commas with \0
    parseData();
    if (strcmp(messageFromRx, "connected")  == 0)  // test to see if the two strings are equal
    {
      connection = true;
      timeout = 0;
    }
    delay(10);
    newData = false;
  }
  //checkconnect();
  if (Movement != oldmove || LXVALUE < (oldLXvalue - 1) || LXVALUE > (oldLXvalue + 1) || angleC != oldCvalue  || angleD != oldDvalue || msgForRx != oldmsgForRx) {
    Serial.print(F("<"));
    Serial.print(msgForRx);
    Serial.print(F(","));
    Serial.print(Movement, DEC);
    Serial.print(",");
    Serial.print(LXVALUE, DEC);
    Serial.print(F(","));
    Serial.print(angleC, DEC);
    Serial.print(F(","));
    Serial.print(angleD, DEC);
    Serial.println(F(">"));

    xbee.print("<");
    xbee.print(msgForRx);
    xbee.print(",");
    xbee.print(Movement, DEC);
    xbee.print(",");
    xbee.print(LXVALUE, DEC);
    xbee.print(",");
    xbee.print(angleC, DEC);
    xbee.print(",");
    xbee.print(angleD, DEC);
    xbee.println(">");
    
    oldLXvalue = LXVALUE;
    oldLYvalue = LYVALUE;
    oldRXvalue = RXVALUE;
    oldRYvalue = RYVALUE;
    oldCvalue = angleC;
    oldDvalue = angleD;
  }
  msgForRx = "connected";
  oldmsgForRx = msgForRx;
  oldmove = Movement;
}
//=============
void recvWithStartEndMarkers() {
  static boolean recvInProgress = false;
  static byte ndx = 0;
  char startMarker = '<';
  char endMarker = '>';
  char rc;

  while (xbee.available() > 0 && newData == false) {
    rc = xbee.read();
    if (recvInProgress == true) {
      if (rc != endMarker) {
        receivedChars[ndx] = rc;
        ndx++;
        if (ndx >= numChars) {
          ndx = numChars - 1;
        }
      }
      else {
        receivedChars[ndx] = '\0'; // terminate the string
        recvInProgress = false;
        ndx = 0;
        newData = true;
      }
    }

    else if (rc == startMarker) {
      recvInProgress = true;
    }
  }
}

//============

void parseData() {

  // split the data into its parts
  char * strtokIndx; // this is used by strtok() as an index

  strtokIndx = strtok(tempChars, ",");     // get the first part - the string
  strcpy(messageFromRx, strtokIndx); // copy it to messageFromPC

}

//============

void showParsedData() {
  Serial.print(messageFromRx);
}

void checkconnect() {
  if (!connection && tick == 0) {
    Serial.println("Not connected");
    tick = 1;
  }
  if (!connection || timeout >= 40) {
    xbee.print("<");
    xbee.print("connected");
    xbee.print(",");
    xbee.println(">");
  }
  delay(10);
  if (connection && tick == 1) {
    Serial.println("Connected!");
    tick = 0;
  }
  delay(5);
  if (connection) {
    timeout += 1;
    oldtimeout = timeout;
    if (timeout >= 150) {
      connection = false;
      tick = 0;
    }
  }
}

rx

#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial xbee(53,50); // TX, RX
Servo SteerServo, MotorServo, CamServoC, CamServoD;
const byte numChars = 32;
char receivedChars[numChars];
char tempChars[numChars];
char messageFromTX[numChars] = {0};
boolean newData = false;
boolean connection = false;
int tick = 0;
int timeout = 0;
int oldtimeout = 0;
//ints for incoming servo data
int ServoA = 0;
int ServoB = 0;
int ServoC = 0;
int ServoD = 0;

int OldservC = 0;
int OldservD = 0;

//============
void setup() {
  Serial.begin(19200);
  xbee.begin(19200);
  MotorServo.attach(9);
  SteerServo.attach(6);
  CamServoD.attach(3);//tilt
  CamServoC.attach(5);//pan
}
//============

void loop() {
  recvWithStartEndMarkers();

  if (newData == true) {
    strcpy(tempChars, receivedChars);
    // this temporary copy is necessary to protect the original data
    //   because strtok() replaces the commas with \0
    parseData();
    delay(5);
    void showParsedData();
    if (strcmp(messageFromTX, "connected")  == 0)  // test to see if the two strings are equal
    {
      timeout = 0;
      connection = true;
      xbee.print("<");
      xbee.print("connected");
      xbee.print(",");
      xbee.println(">");
    }
    delay(5);
    newData = false;
  }
  //checkconnect();
}



//============

void recvWithStartEndMarkers() {
  static boolean recvInProgress = false;
  static byte ndx = 0;
  char startMarker = '<';
  char endMarker = '>';
  char rc;

  while (xbee.available() > 0 && newData == false) {
    rc = xbee.read();
    if (recvInProgress == true) {
      if (rc != endMarker) {
        receivedChars[ndx] = rc;
        ndx++;
        if (ndx >= numChars) {
          ndx = numChars - 1;
        }
      }
      else {
        receivedChars[ndx] = '\0'; // terminate the string
        recvInProgress = false;
        ndx = 0;
        newData = true;
      }
    }

    else if (rc == startMarker) {
      recvInProgress = true;
    }
  }
}

//============

void parseData() {

  // split the data into its parts
  char * strtokIndx; // this is used by strtok() as an index

  strtokIndx = strtok(tempChars, ",");     // get the first part - the string
  strcpy(messageFromTX, strtokIndx); // copy it to messageFromPC

  strtokIndx = strtok(NULL, ","); // this continues where the previous call left off
  ServoA = atoi(strtokIndx);     // convert this part to an integer

  strtokIndx = strtok(NULL, ",");
  ServoB = atoi(strtokIndx);

  strtokIndx = strtok(NULL, ",");
  ServoC = atoi(strtokIndx);

  strtokIndx = strtok(NULL, ">");
  ServoD = atoi(strtokIndx);

}

//============

void showParsedData() {
  Serial.print(messageFromTX);
  Serial.print(", ");
  Serial.print(ServoA);
  Serial.print(", ");
  Serial.print(ServoB);
  Serial.print(", ");
  Serial.print(ServoC);
  Serial.print(", ");
  Serial.println(ServoD);
}
void movement() {
  MotorServo.write(ServoA);
  SteerServo.write(ServoB);
  if (ServoC > 0 && ServoC < 180 && ServoC != OldservC)
  {
    CamServoC.write(ServoC);
    OldservC = ServoC;
  }
  if (ServoC > 0 && ServoC < 180 && ServoD != OldservD) {

    CamServoD.write(ServoD);
    OldservD = ServoD;
  }
}
void Functions() {

  if (strcmp(messageFromTX, "Options")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "Share")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "R3")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "L3")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "L1")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "R1")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "Left")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "Right")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "Up")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "Down")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "Square")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "Cross")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "Circle")  == 0)  // test to see if the two strings are equal
  {

  }
  if (strcmp(messageFromTX, "Triangle")  == 0)  // test to see if the two strings are equal
  {

  }

}
void checkconnect() {
  if (!connection && tick == 0) {
    Serial.println("Not connected");
    tick = 1;
  }

  delay(10);
  if (connection && tick == 1) {
    Serial.println("Connected!");
    tick = 0;
  }
  delay(10);
  if (connection) {
    timeout += 1;
    oldtimeout = timeout;
    if (timeout >= 100) {
      connection = false;
      tick = 0;
    }
  }
}
void showParsedData();

Why do you have a function prototype in the middle of the loop on your rx code? Did you mean to be calling the showParsedData function?

yes i ment to call the function....and that could be why it isnt working thank you

the data is not matching though

Pic from Reply #4 (so I can see it)

I can't read that, and I can't see how I should know what would match with what.

Post a few relevant examples as text

Add to your program so it displays the data before it is parsed, as well as after.

...R

thank you robin. yes i did serial print the data before it is parsed an i get the same results the left and right serial monitor in the picture should match exactly ( except the bluetooth library start) but as you can see in the screen shot on the rx side (left side monitor) sometimes it comes across with differant symbals and characters and sometimes just 0s even know i did not send 0s

merkzilla:
but as you can see in the screen shot

I already said that I can't read the screen shot.

Also I'm not sure if this "an i get the same results" means that you get the same incorrect results or the same correct results.

Please just post the example output as text - what was sent, what was received and what was parsed - for two or three typical examples.

...R

sent

<connected,0,0,125,119>
<connected,0,0,127,121>
<connected,0,0,129,123>
<connected,0,0,131,125>
<connected,0,0,133,127>
<connected,0,0,135,129>
<connected,0,0,137,131>
<connected,0,0,139,133>
<connected,0,0,141,135>
<connected,0,0,143,137>
<connected,0,0,145,139>
<connected,0,0,147,141>
<connected,0,0,149,143>
<connected,0,0,151,145>
<connected,0,0,153,147>
<connected,0,0,155,149>
<connected,0,0,157,151>
<connected,0,0,159,153>
<connected,0,0,161,155>
<connected,0,0,163,157>
<connected,0,0,165,159>
<connected,0,0,167,161>
<connected,0,0,169,163>
<connected,0,0,171,165>
<connected,0,0,173,167>
<connected,0,0,175,169>
<connected,0,0,177,171>
<connected,0,0,179,173>
<connected,0,0,180,175>
<connected,0,0,180,177>
<connected,0,0,180,179>

received

connected, 0, 0, 125, 119
coÜ•�Ñ•‘‚b‚b’b’j
<connected, 0, 0, 0, 0
connected, 0, 0, 131, 125
connected, 0, 0, 133, 127
connected, 0, 0, 135, 129
connected, 0, 0, 137, 131
connected, 0, 0, 139, 133
connected, 0, 0, 143, 137
connected, 0, 0, 145, 139
connected, 0, 0, 147, 141
connected, 0, 0, 151, 145
connected, 0, 0, 153, 147
connected, 0, 0, 155, 149
connected, 0, 0, 157, 151
connected, 0, 0, 159, 153
connected, 0, 0, 161, 155
connected, 0, 0, 163, 157
connected, 0, 0, 165, 159
connected, 0, 0, 167, 161
connected, 0, 0, 171, 165
connected, 0, 0, 173, 167
connected, 0, 0, 175, 169
connected, 0, 0, 177, 171
connected, 0, 0, 179, 173
cܹ•�•±b‚‚)ò¤ø<connected, 0, 0, 1, 0
connected, 0, 0, 180, 179

that is parsed data received btw
this is unparsed received

<,0,0,97,91>
<connected,0,0,99,93>
<connected,0,0,101,95>
ÖÖW,LLL&)ºòj
ž··ctedÁÁbŠª)Êòj
<connected,0,0,107,101>
<connected,0,0,109,103>
<cܹ•Ñ‚bbb‚jü<connected,0,0,113,107>
<connected,0,0,115,109>
<connected,0,0,117,111>
žcoÜ•�Ñ•‘±0,0,119,113>
<connected,0,0,121,115>
ëË«,%KKLKLLŸ
<connected,0,0,125,119>
<connected,0,0,127,121>
<connected,0,0,129,123>
<conÊ�Ñ•±b‚bšb’¤ø<connected,0,0,133,127>
<connected,0,0,135,129>
<connected,0,0,137,131>
§¬[YºY–,0,139,133>
<connected,0,0,141,135>
<connected,0,0,143,137>
<connected,0,0,145,139>
<connected,0,0,147,141>
<connected,0,0,149,143>
<c¹¹•Ñ‚b0,151,145>
<connected,0,0,153,147>
<connected`ÁŪªjø<connected,0,0,157,151>
<connected,0,0,159,153>

this is what was sent for unparsed

<,0,0,97,91>
<connected,0,0,99,93>
<connected,0,0,101,95>
<connected,0,0,103,97>
<connected,0,0,105,99>
<connected,0,0,107,101>
<connected,0,0,109,103>
<connected,0,0,111,105>
<connected,0,0,113,107>
<connected,0,0,115,109>
<connected,0,0,117,111>
<connected,0,0,119,113>
<connected,0,0,121,115>
<connected,0,0,123,117>
<connected,0,0,125,119>
<connected,0,0,127,121>
<connected,0,0,129,123>
<connected,0,0,131,125>
<connected,0,0,133,127>
<connected,0,0,135,129>
<connected,0,0,137,131>
<connected,0,0,139,133>
<connected,0,0,141,135>
<connected,0,0,143,137>
<connected,0,0,145,139>
<connected,0,0,147,141>
<connected,0,0,149,143>
<connected,0,0,151,145>
<connected,0,0,153,147>
<connected,0,0,155,149>
<connected,0,0,157,151>
<connected,0,0,159,153>
<connected,0,0,161,155>
<connected,0,0,163,157>
<connected,0,0,165,159>
<connected,0,0,167,161>
<connected,0,0,169,163>

Vaclav:
Are you sure you are resenting your buffers?

resenting?

merkzilla:
resenting?

Sorry RESETTING

@merkzilla, can you please post a single item that is sent and the corresponding item that is received in direct response to that. Give 3 or 4 pairs of those examples with the sent and received next to each other. And just post the received data before it is parsed. Get the reception under control before worrying about the parsing.

The garbled line in your data looks like it might be caused when the Arduino resets because the Serial monitor is opened. If so that means that the data in your two tables do NOT correspond with each other line for line. Hence the need to present the data in corresponding pairs rather than in two separate tables.

If necessary put a temporary delay between sending each row to make it easier to see what corresponds with what.

It is a good idea to include something like Serial.println("I am starting"); in setup() so you can see when the Arduino restarts.

...R

merkzilla:
that is parsed data received btw
this is unparsed received

<,0,0,97,91>

<connected,0,0,99,93>
<connected,0,0,101,95>
ÖÖW,LLL&)ºòj
ž··ctedÁÁbŠª)Êòj
<connected,0,0,107,101>
<connected,0,0,109,103>
<cܹ•Ñ‚bbb‚jü<connected,0,0,113,107>
<connected,0,0,115,109>
<connected,0,0,117,111>
žcoÜ•�Ñ•‘±0,0,119,113>
<connected,0,0,121,115>
ëË«,%KKLKLLŸ
<connected,0,0,125,119>
<connected,0,0,127,121>
<connected,0,0,129,123>
<conÊ�Ñ•±b‚bšb’¤ø<connected,0,0,133,127>
<connected,0,0,135,129>
<connected,0,0,137,131>
§¬[YºY–,0,139,133>
<connected,0,0,141,135>
<connected,0,0,143,137>
<connected,0,0,145,139>
<connected,0,0,147,141>
<connected,0,0,149,143>
<c¹¹•Ñ‚b0,151,145>
<connected,0,0,153,147>
<connected`ÁŪªjø<connected,0,0,157,151>
<connected,0,0,159,153>



this is what was sent for unparsed


```
<,0,0,97,91>

<connected,0,0,99,93>
<connected,0,0,101,95>
<connected,0,0,103,97>
<connected,0,0,105,99>
<connected,0,0,107,101>
<connected,0,0,109,103>
<connected,0,0,111,105>
<connected,0,0,113,107>
<connected,0,0,115,109>
<connected,0,0,117,111>
<connected,0,0,119,113>
<connected,0,0,121,115>
<connected,0,0,123,117>
<connected,0,0,125,119>
<connected,0,0,127,121>
<connected,0,0,129,123>
<connected,0,0,131,125>
<connected,0,0,133,127>
<connected,0,0,135,129>
<connected,0,0,137,131>
<connected,0,0,139,133>
<connected,0,0,141,135>
<connected,0,0,143,137>
<connected,0,0,145,139>
<connected,0,0,147,141>
<connected,0,0,149,143>
<connected,0,0,151,145>
<connected,0,0,153,147>
<connected,0,0,155,149>
<connected,0,0,157,151>
<connected,0,0,159,153>
<connected,0,0,161,155>
<connected,0,0,163,157>
<connected,0,0,165,159>
<connected,0,0,167,161>
<connected,0,0,169,163>

Can I ask a question?

yes?

<connected,0,0,103,97> <connecºY b‚bŠÁ3,97>
<connected,0,0,106,100> <connected,0,0,106,100>
<connected,0,0,109,103> <connecºY b‚bŠÀ9,103>
sent recieved as

im apsolutly open to other ways if they work lol this is for a xbee controlled rc car i will be sending button data along with ints for the esc, steering servo and for the two servos on the camera pan tilt and od course sometimes at the same time so if it will work what that i will try it

All I will say about Reply #16 is that I am quite happy for everyone on the Forum to see and comment on my advice. I don't always get things right - but the tutorial examples I have posted work.

Now that I can see the data in your Reply #15, I have had a look at your two programs in your Original Post - am I correct to assume that they are what produced the output in Reply #15?

I'm not sure why you are calling your SoftwareSerial instance "xbee" because there are XBee modules which have nothing to do with Bluetooth. However, the compiler will neither know nor care. It is just us humans who can be confused.

Have you tried working SoftwareSerial at 9600 baud to see if that improves things?

Can you try the TX code without any of the USB and PS4 - library stuff? Just get it to send some pre-programmed values - for example millis() / 1000.

...R

Sorry I should have said the Bluetooth library is connecting the ps4 controller to the arduino uno that is the tx side but the xbee are what I'm using to communicate between uno and the mega( rc car xbee)

with this simple code everything match exact parsed and unparsed
tx

#include <SoftwareSerial.h>
SoftwareSerial xbee(5, 4); // TX, RX
void setup() {

  Serial.begin(57600);
  xbee.begin(57600);
  Serial.println("Starting up....");
}
void loop() {
  Serial.print("<");
   Serial.print("Hello");
   Serial.print(",");
   Serial.print("123");
   Serial.print(",");
   Serial.print("123");
   Serial.print(",");
   Serial.print("123");
   Serial.print(",");
   Serial.print("123");
   Serial.println(">");

  xbee.print("<");
  xbee.print("Hello");
  xbee.print(",");
  xbee.print("123");
  xbee.print(",");
  xbee.print("123");
  xbee.print(",");
  xbee.print("123");
  xbee.print(",");
  xbee.print("123");
  xbee.println(">");
  delay(50);
}

rx

#include <SoftwareSerial.h>
SoftwareSerial xbee(11, 10); // TX, RX
const byte numChars = 32;
char receivedChars[numChars];
char tempChars[numChars];
char messageFromTX[numChars] = {0};
boolean newData = false;
int ServoA = 0;
int ServoB = 0;
int ServoC = 0;
int ServoD = 0;
//============
void setup() {
  Serial.begin(57600);
  xbee.begin(57600);

  Serial.println("Starting up....");
}
//============

void loop() {
  recvWithStartEndMarkers();
  delay(20);
  if (newData == true) {
    strcpy(tempChars, receivedChars);
    // this temporary copy is necessary to protect the original data
    //   because strtok() replaces the commas with \0
    parseData();
    //showParsedData();
    delay(15);
    //showParsedData()
    newData = false;
  }
  //checkconnect();
}



//============

void recvWithStartEndMarkers() {
  static boolean recvInProgress = false;
  static byte ndx = 0;
  char startMarker = '<';
  char endMarker = '>';
  char rc;

  while (xbee.available() > 0 && newData == false) {
    rc = xbee.read();
    Serial.print(rc);
    if (recvInProgress == true) {
      if (rc != endMarker) {
        receivedChars[ndx] = rc;
        ndx++;
        if (ndx >= numChars) {
          ndx = numChars - 1;
        }
      }
      else {
        receivedChars[ndx] = '\0'; // terminate the string
        recvInProgress = false;
        ndx = 0;
        newData = true;
      }
    }

    else if (rc == startMarker) {
      recvInProgress = true;
    }
  }
}

//============

void parseData() {

  // split the data into its parts
  char * strtokIndx; // this is used by strtok() as an index

  strtokIndx = strtok(tempChars, ",");     // get the first part - the string
  strcpy(messageFromTX, strtokIndx); // copy it to messageFromPC

  strtokIndx = strtok(NULL, ","); // this continues where the previous call left off
  ServoA = atoi(strtokIndx);     // convert this part to an integer

  strtokIndx = strtok(NULL, ",");
  ServoB = atoi(strtokIndx);

  strtokIndx = strtok(NULL, ",");
  ServoC = atoi(strtokIndx);

  strtokIndx = strtok(NULL, ">");
  ServoD = atoi(strtokIndx);

}

//============

void showParsedData() {
  Serial.print(messageFromTX);
  Serial.print(", ");
  Serial.print(ServoA);
  Serial.print(", ");
  Serial.print(ServoB);
  Serial.print(", ");
  Serial.print(ServoC);
  Serial.print(", ");
  Serial.println(ServoD);
}

how ever i did try this simple tx code with my original rx code i get the same reluts as before. im thinking somehing in my original rx code is interfering with the data received??