I would like to send strings from USB (serial) to my esp32 microcontroller (Arduino) that are larger than the apparently default 64 bytes limit of the actual Arduino or the apparently 256 byte limit for the esp32 [1].
I found the command [2] recognized by PlatformIO:
Serial.setRxBufferSize(1024);
but as soon as I enter this line of code (with any number from 10 to 1000) the following code doesn't run anymore:
void serialEvent()
{
Serial.setRxBufferSize(64); // increasing buffer size ?
while (Serial.available())
{
char inChar = (char)Serial.read();
inputString += inChar;
if (inChar == '$') // end marker of the string
{
inputStringPC = inputString;
stringCompletePC = true;
Serial.print(inputStringPC);
inChar = '0';
inputString = '0';
}
}
}
Hope anyone knows whats wrong.
Thanks!