I'm using ESP32 and bluetooth to communicate with my Android phone. The program on the phone is created using MIT App Inventor.
When I'm sending long strings (containing JSON) fom ESP32 to the phone, all goes well, regardless how long the string is. When I'm sending long strings from the phone to ESP32, the Bluetooth Serial reception locks up after receiving 512 bytes.
Whenever the ESP_SPP_DATA_IND_EVT event occurs, I'm reading the entire input buffer using
Code: Select all
while (SerialBT.available()) { // do this until all chars have been consumed
c = SerialBT.read();
if(btIncomingIndex < (SIZE_BT_INCOMING - 2)) { // if char buffer not full (leave room for terminating '\0')
btIncomingChars[btIncomingIndex++] = c; // store the char and increment index
... more code ...
}
Is this a bug or do I need to take extra steps to receive very long messages?
PS: I'm using the SPP profile on BT Classic