Show Posts
Pages: 1 [2] 3 4 ... 9
16  Using Arduino / Networking, Protocols, and Devices / Re: Ard <--> Pi serial data transfer(unsolved/mothballed) on: September 15, 2013, 06:28:06 pm
great and now i have some progress

getting this on the pi side now (should be got < Getting data! Got > now buff null and memcpy) and then print the struct members to the cons
Code:
got <
 Getting data!
 got <
 Getting data!
 got <
 Getting data!
 got <
 Getting data!
 got <
 Getting data!
 got <
 Getting data!
 got <
 Getting data!
 got <
 Getting data!
 got <
still not completing tho. here is the 2 codes as they stand.
Arduino
Code:
struct MyStruct_t {
    uint32_t yaw;
    uint32_t pitch;
    uint32_t roll;
}MyStruct;
void setup(){
 Serial.begin(57600);
 Serial3.begin(57600);
}
double sendBuff[sizeof(MyStruct)];
void loop() {
    MyStruct.yaw = 87.96;
    MyStruct.pitch = -114.58;
    MyStruct.roll = 100.50;

    memcpy(sendBuff, &MyStruct, sizeof(MyStruct));
    sBuff();
    localSerial();
}

void sBuff(){
   Serial3.write("<");
   Serial3.write((uint8_t *)&sendBuff,sizeof(sendBuff));
   Serial3.write(">");
}
void localSerial(){
    Serial.print("<");
    Serial.write((uint8_t *)&sendBuff,sizeof(sendBuff));
    Serial.print(">");
    Serial.println("");
}


RPI
Code:
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <wiringSerial.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>

void serialRead();
void gStart();
void gEnd();

struct MyStruct_t {
    uint32_t yaw;
    uint32_t pitch;
    uint32_t roll;
}MyStruct;

int fd;
int i, x, sDA, cChar;
int recBuff[13];

int main ()
{
  if ((fd = serialOpen ("/dev/ttyAMA0", 57600)) < 0)
  {
   fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
    return 1 ;
  }

 for (;;)
        {

         serialRead();
 }
}

void serialRead(){
    cChar = serialGetchar(fd);
    sDA = serialDataAvail(fd);
        if (sDA > 0 ) {
        x=0;
        if (cChar == '<'){
        printf("got <\n ");
        gStart();
        }
      }
    }
void gStart(){
        cChar = serialGetchar(fd);
         if (cChar != '>'){
         printf("Getting data!\n ");
         recBuff[x] = cChar;
         x++;}
        else{
        gEnd();
        }
}
void gEnd(){
        cChar = serialGetchar(fd);
  if(cChar =='>'){
        printf("Got > now buff null and memcpy\n");
    recBuff[x] = '\0';
    memcpy(&MyStruct, recBuff, sizeof(MyStruct));
    printf("Yaw :%d\n", MyStruct.yaw);
    printf("Pitch: %d\n", MyStruct.pitch);
    printf("Roll: %d\n", MyStruct.roll);
    }
     serialFlush(fd);
     return;
   }

so i guess since it is getting the < but not getting to > prob somtthing to do with the get char function yes?
BTW the RPI code uses the serial lib from WiringPi.com if that helps any
17  Using Arduino / Networking, Protocols, and Devices / Re: Ard <--> Pi serial data transfer(unsolved/mothballed) on: September 15, 2013, 05:34:19 am
would using like uint8_t 16_ 32_t on both fix that? my limited understanding these are of an exact size on ardino and linux yes?
i would have never imagined sending structs across serial being so bad. would I2C be better? because at this point i am also ready to put 2 NRF24L01's 2" apart on my bot to send the data back and forth LOL!!!
waste of equipment but for $2.35 i am asking my self why not. i would how ever look at it each time and go why?!? and be some what shameful at such a cheap workaround. so yes i guess at this point i am pleeding.

1. is it possible to send Structs to the Pi over serial or at least I2C.
2. Exactly how would "you" send it and receive it (code please).
3. i promise to study it and learn each element of it.
i just cant keep doing this. my brain is frying from reading forum posts,wikis,how-to docs and frankly find this overall not a good experience.
if any or all of what i am asking bothers you i understand thanks for the trying you have done.
if that's the case i will just go back to the 2560 and stay there till i get better, adding the PI and cam was a leap i guess LOL!.
18  Using Arduino / Networking, Protocols, and Devices / Re:Ard <--> Pi serial data transfer(unsolved/mothballed) on: September 14, 2013, 11:41:38 am
LOL welp i give. been at this for over a week, ill just have to put the bot to the side. kinda knew mixing ard with pi was not going to be as easy as i had read about. well i guess it could be for usb -> ard IDE on the pi parsing a few lines off the serial but that's not what i wanted out of it. does do a nice job on linux and running cams so maybe ill find something for it. thanks for the help Paul and if you do run across something along the lines of C with struct trans over serial for the pi/ard link it here. ill check back in ever now and then.
19  Using Arduino / Networking, Protocols, and Devices / Re: Why does PiData never = !, Ard <--> Pi serial data transfer on: September 13, 2013, 02:20:32 pm
changed some code on the linux(RPI) side.

Code:
cChar = read(fd, &recBuff,sizeof(recBuff));
now i should be reading the stream from the serial and be able to see the binary bits.
still can not seem to parse the start and stop tho.
20  Using Arduino / Networking, Protocols, and Devices / Re: Why does PiData never = !, Ard <--> Pi serial data transfer on: September 12, 2013, 04:46:40 pm
cant believe i missed that long day lol.
ard sending
Code:
  Serial3.print('<');
    Serial3.write((byte *)&sendBuff,sizeof(sendBuff));
    Serial3.print('>');

pi recieveing ( chopped up the triggers but still not triggering)
Code:
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <wiringSerial.h>
#include <stdlib.h>

void serialRead();
void gStart();
void gEnd();

struct MyStruct_t {
    float yaw;
    float pitch;
    float roll;
}MyStruct;

int fd;
int i, x, sDA, cChar;
char recbuff[100];

int main ()
{
  if ((fd = serialOpen ("/dev/ttyAMA0", 57600)) < 0)
  {
   fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
    return 1 ;
  }

 for (;;)
        {

         serialRead();
 }//for
}//main

void serialRead(){//*
    cChar = serialGetchar(fd);
    sDA = serialDataAvail(fd); // is Serial avail?
    if (sDA > 0 ) {//*
      x=0;
        if ( cChar == '<'){//*      // is it the start char?
        printf("got <\n");
        gStart();
        }// if cchar ==<
      }// sDA >0
    }//serialRead
void gStart(){//*
        cChar = serialGetchar(fd);
         if (cChar != '>'){//*
         recbuff[x] = cChar;
         x++;}// if cChar!= >
        else{//*
        gEnd();
        }//else
}//gStart
void gEnd(){
        cChar = serialGetchar(fd);
  if(cChar =='>'){//*
    recbuff[x] = '\0';
    memcpy(&MyStruct, recbuff, sizeof(MyStruct));
    printf("Yaw :%lf\n", MyStruct.yaw);
    printf("Pitch: %lf\n", MyStruct.pitch);
    printf("Roll: %lf\n", MyStruct.roll);
    } // if cchar == >
     serialFlush(fd);
     return;
   }//gEnd

thinking im going to have to use something other than serialGetchar because that's just going to grab gibberish from a binary stream? (yes my brain is officially fried by this point)
21  Using Arduino / Networking, Protocols, and Devices / Re: Why does PiData never = !, Ard <--> Pi serial data transfer on: September 12, 2013, 11:33:01 am
the struct was filled with
Code:
void serialSend(){

        serialPutchar(fd, '$'); // start char
        MyStruct.FloatValue01 = 33.999; // value for stuct
        MyStruct.IntValue01 = -37000;  //" "
        MyStruct.lIntValue01= 2000000000;// " "
        MyStruct.CharValue01[0] = ChVal;// " "
        serialPuts(fd,(char *)&MyStruct); // send struct
        serialPutchar(fd, '!'); // end char
        return;
}
those on the pi side the the struct was suppose to be transmitted ( think it was but who knows at this point) so if the struct was sent like it was when i was using the Nrf24l01's befor it should have unpacked and populated it on the arduino side.

been looking at a god awful lot of examples on arduino and pi and c++ forums and i seen some memcpy stuff (also some struct packing, have not made to much sense of that yet)
but i have come up with this so far. tell me if i am heading in the right direction anyhow.
Arduino side (send only for now)
Code:
struct MyStruct_t {
    float yaw;
    float pitch;
    float roll;
}MyStruct;
void setup(){
 Serial.begin(57600);
}
char sendBuff[sizeof(MyStruct)];
void loop() {
    MyStruct.yaw = 87.96;
    MyStruct.pitch = -114.58;
    MyStruct.roll = 100.50;

    //Sending Side
        memcpy(sendBuff, &MyStruct, sizeof(MyStruct));
    S3();//serial 3
    LS();// local serial
}

void S3(){
   Serial3.print("<");
    for(int x =0;x < sizeof(sendBuff);x++){
    Serial3.print(sendBuff[x]);
    }
    Serial3.print(">");
    Serial3.println("");
}
void LS(){
    Serial.print("<");
    for(int x =0;x < sizeof(sendBuff);x++){
    Serial.print(sendBuff[x]);
    }
    Serial.print(">");
    Serial.println("");
}

Pi side ( rec for now)
Code:
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <wiringSerial.h>
#include <stdlib.h>

void serialRead();

struct MyStruct_t {
    float yaw;
    float pitch;
    float roll;
}MyStruct;

int fd;
int i, x, sDA, cChar;
char recbuff[100];

int main ()
{
  if ((fd = serialOpen ("/dev/ttyAMA0", 57600)) < 0)
  {
   fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
    return 1 ;
  }

 for (;;)
        {

         serialRead();
 }//for
}//main

void serialRead(){

    sDA = serialDataAvail(fd); // is Serial avail?
    if (sDA > 0 )
    {
      x=0;
      for (i=0;i<sDA;i++)  // for as long as i is less than sDA get char
      {
        cChar = serialGetchar(fd); // get the char
        if ( cChar == '<')      // is it the start char?
        printf("got <\n");
        {
     for(;;)
     {
       cChar = serialGetchar(fd); // get char
       if (cChar == '>'){   // is it the end char?
        printf(" Got >\n");
         recbuff[x] = '\0'; // null term the buffer
         break;  // exit loop
       }
       else
        {
        //otherwise current buffer pos (x) = curent incoming char
        recbuff[x] = cChar;
         x++;  // add 1 to x
       }
     }
    memcpy(&MyStruct, recbuff, sizeof(MyStruct));
    printf("Yaw :%lf\n", MyStruct.yaw);
    printf("Pitch: %lf\n", MyStruct.pitch);
    printf("Roll: %lf\n", MyStruct.roll);
     }
     serialFlush(fd);
     break;
   }
      }
}

much earlier copy of the PI code would trigger -.- but now it does not and i cant recall what i had changed ( was having probs populating the stuct so i went messing around lol)
1. am i filling and sending the struct correctly on the Arduino side?
2. what is falling on the Pi side to trigger the start?

example of Arduino output throuhg local.
Code:
<…ë¯Bö(åÂÉB>
<…ë¯Bö(åÂÉB>
<…ë¯Bö(åÂÉB>
<…ë¯Bö(åÂÉB>
<…ë¯Bö(åÂÉB>
<…ë¯Bö(åÂÉB>
<…ë¯Bö(åÂÉB>
<…ë¯Bö(åÂÉB>


i am guessing it's good yes? ( i know it's a guess but i do not think i could know till i try and extract it on pi side);
but it does have the start and stop parts so i would think it would trigger fine.
22  Using Arduino / Networking, Protocols, and Devices / Re: Why does PiData never = !, Ard <--> Pi serial data transfer on: September 11, 2013, 01:13:01 pm
sorry for the slow response day to day life is only giving me with a small amount of time for my project each day. anyhow i am sorry i am so stumped on this that my Q to A ratio is not up to par for the community. as for you question about the pointers unless i am not getting where your coming from they are pointed to static values being assigned on the Pi side for now in the for loop in main.
Code:
serialPutchar(fd, '$');
        MyStruct.FloatValue01 = 33.999;
        MyStruct.IntValue01 = -37000;
        MyStruct.lIntValue01= 2000000000;
        MyStruct.CharValue01[0] = ChVal;
        serialPuts(fd,(char *)&MyStruct);
        serialPutchar(fd, '!');

as for am i sending the array of pointers successfully well that is the $64,000 question i guess.
So maybe ill start from scratch. so let me ask you this. if you were trying to send a strut of data from an Arduino to a Linux based system and from the Linux system to the Arduino how would you go about it.you have the choice of I2C,SPI,Serial. thanks in advance.
23  Using Arduino / Networking, Protocols, and Devices / Re: Why does PiData never = !, Ard <--> Pi serial data transfer on: September 09, 2013, 09:42:04 pm
6 and 12 is the byte size the returns form the serial.readBytes and on the Pi.. 6 on ard and 12 on pi. i guess i thought that is what the struct size was = to.
as far as sending it's just bogus data you can see in the first post where i stuff them to be sent from the Pi.

i know this is late for asking but there is no Arduino <-> Pi serial com lib or something that sends structured data back and forth?
24  Using Arduino / Networking, Protocols, and Devices / Re: Why does PiData never = !, Ard <--> Pi serial data transfer on: September 09, 2013, 01:19:40 pm
welp now that i got some rest i got the sizeof(MyStruct) on both systems and it's size is 12 on Pi and 6 on Arduino.
So endianness is same at littleE Pi has 2x the size struct that the Arduino has.

Serial.readBytesUntil('!', (char *)&Mystruct,sizeof(MyStruct)); returned this.
Code:
SoS Found
0
SoS Found
0
SoS Found
0
SoS Found
1
SoS Found
0
SoS Found
0
SoS Found
0
SoS Found
0
int bytesRead1 = Serial.readBytes('!', (char *)&Mystruct,sizeof(MyStruct)); returned this.
Code:
Found !, Now printing MyStuct
6
SoS Found
6
Found !, Now printing MyStuct
6
SoS Found
6
Found !, Now printing MyStuct
6
SoS Found
6
Found !, Now printing MyStuct
so it seems Pi is sending the 12 but the Arduino is only reading 6 in because Arduino is storing my int's at 2 byte val's? and pi is 12 because it's int's are 4? or am i missing the point? 
so how do i down size the Pi data or get Arduino to use more memory for each Int? ( is this going to be the same with others like float long unsigned long there all going to be 2x the size as the Arduino?)
25  Using Arduino / Networking, Protocols, and Devices / Re: Why does PiData never = !, Ard <--> Pi serial data transfer on: September 09, 2013, 07:47:26 am
did a little digging before i need to get some sleep and found that both are little endian but it seems the structs might be diff hard to tell tho. got any test code i can whip up and check on the pi ( linux) and ard?
yeah it could be issues with the data trans and other things. heck it could be 2 or 3 of them at once. i suspect the struct size could be derived with sizeof(mystuct) and some printing yes? if so could ya post the example im to tired to try and look for it smiley. anyhow thanks as usual PaulS you always seem to know what to look out for. maby some day ill grasp programming smiley.

nite nite all.
26  Using Arduino / Networking, Protocols, and Devices / Re: Why does PiData never = !, Ard <--> Pi serial data transfer on: September 08, 2013, 06:05:35 pm
Ok changed to this now.(still cant believe i missed that lol).
Code:
void readSerial(){
  while (PiData != '!'){
    PiData = Serial3.read();
    if (Serial3.available() > 0){
      Serial3.readBytes((char *)&MyStruct,sizeof(MyStruct));
    }
    if (PiData == '!'){
      Serial.println("Found !, Now printing MyStuct");
      prnStruct();
    }

  }
}

So now i get a bunch of spew from the terminal like this.
Code:
øøøøøøøøøøøøíøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøÿæÿOW™-ÎdtÓÏçO!NÁåáu
‘wí¾ñ‡ó¤ÕIÆ}ikÞ×À2úéOg^׿GÑ6õý½Çy…ïÔdÞv/øO½c
                                                 YÌ‘4!ÿ{Z)Æzö}ÕêTî!¯Î˜[¹r;Ÿ¾î
wþsºIÌJµ¯¼ï$î?¾Þý÷sÚÌÅP+¥sµ ÿг|Û:«î}Ú³Õi?ú[¥œåøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøîøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøíøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøîøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø
øøøøøøøøøøøøøøøøøøøøøîøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø

so i rem out the array print part and got some odd data also.
Code:
Found !, Now printing MyStuct
ovf : 16903 : -37000 :
SoS Found
Found !, Now printing MyStuct
ovf : 16903 : -37000 :
SoS Found
Found !, Now printing MyStuct
ovf : 16903 : -37000 :
SoS Found
Found !, Now printing MyStuct
ovf : 2046 : -9471934 :
SoS Found
Found !, Now printing MyStuct
0.00 : -1500 : 2017593342 :
SoS Found
Found !, Now printing MyStuct
ovf : 16903 : -37000 :
SoS Found
Found !, Now printing MyStuct
ovf : 16903 : -37000 :
SoS Found
Found !, Now printing MyStuct
ovf : 16903 : -37000 :
SoS Found
Found !, Now printing MyStuct
ovf : 16903 : -37000 :

if you notice in the Pi code the values should be.
Code:
serialPutchar(fd, '$');
        MyStruct.FloatValue01 = 33.999;
        MyStruct.IntValue01 = -37000;
        MyStruct.lIntValue01= 2000000000;
        MyStruct.CharValue01[0] = ChVal;
        serialPuts(fd,(char *)&MyStruct);
        serialPutchar(fd, '!');
how/why are they getting changed?
27  Using Arduino / Networking, Protocols, and Devices / Re: Why does PiData never = !, Ard <--> Pi serial data transfer on: September 08, 2013, 04:42:17 pm
Errrm, good question seems as if once i parse $ out in main loop i never update Pidata huh?. Thanks for the answer as always PaulS.
28  Using Arduino / Networking, Protocols, and Devices / Ard <--> Pi serial data transfer(unsolved) on: September 07, 2013, 07:54:39 pm
Hello all, Why will arduino find '$' but not find '!' in my incoming data to trigger the print struct function?
TIA.
Arduino code.
Code:
void setup(){
  Serial.begin(57600);
  Serial3.begin(57600);
}  
struct MyStruct_t{
    float FloatValue01;
      int IntValue01;
 long int lIntValue01;
    char* CharValue01[15];
 }
MyStruct;

int PiData;

void loop()
{
  if (Serial3.available() > 0){
    PiData = Serial3.read();
    if (PiData == '$'){
      Serial.println("SoS Found");      
      readSerial();
    }
  }
}

void readSerial(){

  while (PiData != '!'){
    if (Serial3.available() > 0){
      Serial3.readBytes((char *)&MyStruct,sizeof(MyStruct));
    }
  }
      if (PiData == '!'){
      Serial.println("Found !, Now printing MyStuct");
      prnStruct();
    }
 
  }

void prnStruct(){

  Serial.print(MyStruct.FloatValue01);
  Serial.print(" : ");      
  Serial.print(MyStruct.IntValue01);
  Serial.print(" : ");      
  Serial.print(MyStruct.lIntValue01);
  Serial.print(" : ");            
  for (int i=0;i < sizeof(MyStruct.CharValue01);i++){
    Serial.print(MyStruct.CharValue01[i]);
  }
  Serial.println("");      
}


RPI (Raspberry Pi) code.
Code:
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <wiringSerial.h>
#include <stdlib.h>

void serialSend();
char *ChVal = "Hello World";

        struct MyStruct_t{
          float FloatValue01;
            int IntValue01;
       long int lIntValue01;
          char* CharValue01[15];
        }MyStruct;

int fd;

int main ()
{
  if ((fd = serialOpen ("/dev/ttyAMA0", 57600)) < 0)
  {
   fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
    return 1 ;
  }

 for (;;)
  {
          serialSend();
        }
 }//main

void serialSend(){

        serialPutchar(fd, '$');
        MyStruct.FloatValue01 = 33.999;
        MyStruct.IntValue01 = -37000;
        MyStruct.lIntValue01= 2000000000;
        MyStruct.CharValue01[0] = ChVal;
        serialPuts(fd,(char *)&MyStruct);
        serialPutchar(fd, '!');
        return;
}




it finds $ just fine and triggers the while loop bit never seems to find !.
29  Using Arduino / Programming Questions / Re: sending structs, need clarification on some things. on: February 10, 2013, 07:07:13 pm
From the post I made here http://arduino.cc/forum/index.php/topic,146500.msg1102005.html#msg1102005

There is a function called: isAvailable()

It possibly returns the number of bytes available, or maybe just a true/false, anyway check it out.

Edit, these two functions below tell me that the data is 'payload' size, if the data you put in it is smaller it will be padded upto 'payload' size:
I do not quite understand what your trying to get me to do with the payload size. i define payload size at the size of StructBuff so no matter what size StructBuff is payload is always the size of it.
 How ever it seems there might be an "overflow" issue with it given what Tack said.
 Unless it auto breaks up the payload and sends them in pieces if that is the case i dont know how the struct on the RX will like that.

this is all new territory for me
michinyon wrote:
Quote
Your RX code is also wrong.

When you have radio.available() true,   you do not necessarily have a full struct of bytes available.

If your struct is 50 bytes (  whatever  )  and your radio serial port has received 20 bytes,   then radio.available() will
be true  and you will attempt to read 50 bytes  and there is only 20 bytes received so far  and your data will
therefore be wrong in some way.

You need to not attempt to read()  the data until it is all there.   Or else read the data which you have
and then wait for the rest to arrive.
and i cheked it comes back true if there is payload. but as Tack pointed out.
Quote
The max payload size will be 32 bytes IIRC. Once you fix your string issue you need to make sure a single payload doesn't exceed that or it will be truncated.

When using the RF24Network library it uses 12 bytes for the header so that leaves only 20 bytes for the rest of the payload, something that took a while to realize.
i am going to need to figure out how to break down my block of data to smaller ones so it does not get truncated before i even continue trying to send any more data the 3 floats from my IMU are already to much data at 24 bytes.
30  Using Arduino / Programming Questions / Re: sending structs, need clarification on some things. on: February 08, 2013, 09:58:12 am
When you have radio.available() true,   you do not necessarily have a full struct of bytes available.

I think you're mistaken about how the RF24 library works. This is not a streaming interface; the radio sends and receives complete packets and returns the whole packet via a single read operation.

right get that part but how do i tell if the packet is complete so i can read it. or is simply calling radio.read() doing that?
Pages: 1 [2] 3 4 ... 9