Lately, I have been working on some software (Windows using Visual Studio in C# / .NET) to turn my laptop into a "brain" for the "Bittle with BiBoard" robot. To keep things simple, I want to use the well established bidirectional serial streaming communication of the Bluetooth Classic Serial Port Profile (SPP). By simple, I mean in contrast to the more complicated client-server option that is the Bluetooth Low Energy (BLE) with Generic Attribute (GATT) Profile. The ESP32 in the BiBoard supports both options and, I believe, the OpenCatEsp32 source code supports both as well (but see below).
Why is this simpler? Mainly because it is easier to code up a serial transceiver than to code up a GATT client. Also, it is a better fit to this use case because the SPP was designed for serial streaming whereas the GATT is meant for short message exchanges.
Here is the problem. I can only occasionally establish bidirectional Bluetooth communication between the Bittle with BiBoard and my Windows laptop using an SPP communication port. I do this by pairing the laptop with the Bittle and checking if I can send and receive over the Bluetooth SPP communication port that gets created. If I get a bidirectional communication, I move on to further coding work but if I only get unidirectional communication, I unpair, delete the com ports created and try pairing again. Eventually (1 out of 10 tries) I get a Bluetooth SPP bidirectional communication (but see below).
Before anyone asks, I am using the "Outgoing" port that specifically says "'ESP32SPP", meant for this SPP communication purpose, not the "Incoming" port that is also created. And also before anyone can ask this too, the "Incoming" port can only be initialized by the Bittle, not the laptop but this is not my use case, since I want the laptop to initiate and control the communication.
After getting a Bluetooth port that is bidirectional, I send Bittle commands and receive readbacks. However, after a short while (15 min) of back and fourth communication, the port becomes unidirectional. The laptop can send commands but not receive any readbacks.
So, has anyone tried such bidirectional Bluetooth Serial Port Profile (SPP) communication? If so, what kind of reliability have you experienced? More importantly, what might the source be of any unreliability in such communication? I have looked at the OpenCatEsp32 source code but have not found any obvious problems.
Is anyone interested in this capability and in combining efforts to search for the source (and fix) of this apparent (at least in my hands) unreliability?
BTW, I have searched the forum and the closest I found was this post by "Kevin KO" (and related comments): https://www.petoi.camp/forum/hardware/bluetooth-two-ways-communication-question. It sounds like my use case and that of the poster are similar, even though our software tools and Bittle robots (NyBoard with Bluetooth module vs BiBoard with built in Bluetooth) are different.