jpmeijers / RN2483-Arduino-Library

Arduino C++ code to communicate with a Microchip RN2483 module
Apache License 2.0
86 stars 60 forks source link

getRX - size of incoming data #52

Open haddock443 opened 6 years ago

haddock443 commented 6 years ago

Hey,

i have a problem while using this library. If i send a message to the arduino, i can only send a payload under 16 characters. As soon as I send anything above 15 characters, my String is empty. I just want to store a message like this: text = myLora.getRX(); and then work with it. Am i doing something wrong? I know this is not much information from my side, but i dont know where to start.

One thing that i noticed is: When i restart the arduino, i can receive a longer message once. After that i can only receive 15 characters.

Code:

switch(myLora.txCnf("!")) { case TX_SUCCESS: { Serial.println("TX successful and acknowledged"); break; } case TX_WITH_RX: { String received = myLora.getRx(); received = myLora.base16decode(received); debugSerial.println("debug" + received); delay(100); //here i just cut the string and store the parts in global variables int commaIndex = received.indexOf('$'); int secondCommaIndex = received.indexOf('$', commaIndex + 1); int thirdCommaIndex = received.indexOf('$', secondCommaIndex +1); var1 = received.substring(0, commaIndex); var2 = received.substring(commaIndex+1, secondCommaIndex); var3 = received.substring(secondCommaIndex + 1, thirdCommaIndex); var3 = received.substring(thirdCommaIndex + 1); //To the end of the string

    break;
  }
  default:
  {
    Serial.println("Unknown response from TX function");
  }
}
DenniZr commented 6 years ago

did you check if your memory is full? https://github.com/maniacbug/MemoryFree