Send / Recv data from multiple sensors wireless

I am just looking for a point in the correct direction. Obviously I am pretty new and would appreciate any help.
Sending from one mini to another using cheap 433mhz wireless and VirtualWire library. Sending and receiving single

I am looking for best practice, should I concatenate all of my variables and send it at once, perform multiple sends, I am not sure what to do here or where to look. Where I am confused is reading from the buffer on the receive side. if first two positions are temp and third is float status, how do I assign those position in buffer to variables on the recv side. Or is it better to T69\nF0\n where I can read T as temp until newline then read next char F for float and read until new line, etc. Except I have no idea how to do either.

It's up to you how much you want to send at a time. VirtualWire does limit you to 27 bytes (max packet size of 30 includes count (1 byte) and FCS (2 bytes checksum).

Here's a sample from one of my projects. GetTemperature() gets two temperatures, stores them in two global ints; IR sensor reading, and Ambient temp.
sprintf() formats the two ints and a packet number into a string (char array).
I delay 5 seconds and send again. I use delay() because there are no other tasks for this code to perform.

void loop() {
  GetTemperature();
  sprintf(buf,"P%d S %d A %d :\n" ,packetnum, CS_ObjTemp, CS_AmbTemp);
  send(buf);         //your message
  packetnum++;
  delay(5000);
}

And here's the full receiver code. I send the data in to a VB.Net program, but you could just parse the data, extracting the various fields, converting to int, and doing whatever you like with them. But first, get the two sketches working. One for the Tx, one for the Rx, and use the Serial Monitor on the Rx to see that it gets there. Then worry about extracting and converting.

#include <VirtualWire.h>

void setup(){
  Serial.begin(19200);
  Serial.println("Ready");
  vw_setup(1000); //bps
}
void loop(){
  receive();
}

void receive() {
  byte bufr[30];
  char buf[30];
  byte bufrLength = VW_MAX_MESSAGE_LEN;

  vw_rx_start();

  if (vw_get_message(bufr, &bufrLength)){
    for (int i=8;i<30;i++) {
      buf[i] = '\0';
    }
    memcpy(buf,bufr,bufrLength);

    Serial.print (buf);
  }
}

Thank you for the reply. I do have the data sending tx and rx, the extracting and converting is where I am lost. When I Serial.println buf to the serial monitor I get = 691. 69 is the temperature and 1 is the float switch status (1 = on). On the rx side I need to be able to then make int temp = buf[0] and buf[1] and int floatStatus = buf[3], or something to that effect so that I can do what I need on the rx side (output to LCD, turn on LED, trigger alarm condition, etc) all of which I already have working. Just the extraction part is cooking my brain.

Thanks again.

VectorSix:
Thank you for the reply. I do have the data sending tx and rx, the extracting and converting is where I am lost. When I Serial.println buf to the serial monitor I get = 691. 69 is the temperature and 1 is the float switch status (1 = on). On the rx side I need to be able to then make int temp = buf[0] and buf[1] and int floatStatus = buf[3], or something to that effect so that I can do what I need on the rx side (output to LCD, turn on LED, trigger alarm condition, etc) all of which I already have working. Just the extraction part is cooking my brain.

Well, it's very difficult to extract information from a string of numbers that are not either fixed length or delimited in some way.

The reason I send a string that looks like "P 21 S -30 A 10 :\n" is so that it becomes easier to extract the data. On the receiving side, I can use something like strtok(), using " " (space) as a delimiter, to get delimited strings, then access each token (string) to extract the int from the appropriate string. The \n will serve as a delimiter that tells me the entire packet has been received, and I can go ahead with the extraction.. so in turn, I do as follows

get token "P"
get token "21"
convert 21 to an int, store in packetNum.
get token "S"
get token "-30"
convert to an int and store in skyTemp

and so on....

Google strtok() and atoi() to see how to extract and convert.

So far, so good, thank you. On my rx side, if I Serial.print(buf) I get: 0,846,66 :

Now I am trying to figure strtok() and atoi() in order to break the string into workable variables....

Well, it looks like I got it finally. I did have a lot of trouble with it, understanding it mostly. But, the string that is being sent now: 1,843,75 I was able to do as you described using strtok() and atoi(). The output is correct, I am not sure if the syntax is exactly correct but it works. Thank you very much for the help. If anyone else sees anything glaring, let me know please. Thanks again.

On the rx:

#include <VirtualWire.h>

// LED's
int ledPin = 13;

// Sensors 

char *floatStatus, *lightStatus, *temp;
int floatStatus1, lightStatus1, temp1;

// RF Transmission container
char Sensor1CharMsg[30]; 

void setup() {
  Serial.begin(9600);

  // sets the digital pin as output
  pinMode(ledPin, OUTPUT);      

  // VirtualWire 
  // Initialise the IO and ISR
  // Required for DR3100
  vw_set_ptt_inverted(true); 
  // Bits per sec
  vw_setup(2000);     

  // Start the receiver PLL running
  vw_rx_start();       

} // END void setup

void loop(){
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;

  // Non-blocking
  if (vw_get_message(buf, &buflen)) 
  {
    int i;
    // Turn on a light to show received good message 
    digitalWrite(13, true); 

    // Message with a good checksum received, dump it. 
    for (i = 0; i < buflen; i++)
    {            
      // Fill Sensor1CharMsg Char array with corresponding 
      // chars from buffer.   
      Sensor1CharMsg[i] = char(buf[i]);

    }

    Sensor1CharMsg[buflen] = '\0';  //Null terminate char array

    floatStatus = strtok(Sensor1CharMsg,",");
    lightStatus = strtok(NULL,",");
    temp = strtok(NULL,",");

    floatStatus1 = atoi(floatStatus);
    lightStatus1 = atoi(lightStatus);
    temp1 = atoi(temp);

    Serial.println (floatStatus1);
    Serial.println (lightStatus1);
    Serial.println (temp1);   

    digitalWrite(13, false); // Turn LED off 
  }
}
    // Message with a good checksum received, dump it. 
    for (i = 0; i < buflen; i++)
    {            
      // Fill Sensor1CharMsg Char array with corresponding 
      // chars from buffer.   
      Sensor1CharMsg[i] = char(buf[i]);

    }

Completely unnecessary.

    Sensor1CharMsg[buflen] = '\0';  //Null terminate char array

NULL terminate buf, instead.

    floatStatus = strtok(Sensor1CharMsg,",");

And use buf, here, instead. A cast might be necessary, but that's simple:

    floatStatus = strtok((char *)buf, ",");

Yes, I see now. Thank you Paul. It works great. Back to the books...now to to figure out why when my serial LCD is connected my wireless range drops to about 6". If I disconnect it I can go upstairs to the other side of the house with a good signal. Some sort of interference/conflict I suppose. But, that is another issue altogether.