You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Arduino BSP I have created a program that reads data from the serial port and sends it to the Bluetooth SPP serial port. At high speeds (260 KBit/s) the bluetooth module looses data. If you connect to the Bluetooth SPP port using eg a PC with a client app, it will not receive all sent bytes.
Describe the solution you'd like
After searching around in my software, I concluded that the Bluetooth module would loose the data bytes.
Then I started looking around in the BluetoothSerial.cpp driver and found the initialisation of the Bluetooth Serial process. When I change the task priority of the Bluetooth Process, the problem is solved.
The change I have made is in the function "_init_bt()".
I changed this code:
I found this because other processes in the ESP32 module will have the (configMAX_PRIORITIES-1) priority.
After changing the priority, I have had no data loose at all.
Describe alternatives you've considered
In my code, I have made the transfer from serial port to SPP as fast as possible.
At first I transferred the data byte by byte. Now I transfer the data in blocks, using the read and write functions.
I 've looked around on the internet, but I couldn't find any good solution to my problem. BluetoothSerial_changed.zip ESP32_Myomed.zip
Additional context
No response
I have checked existing list of Feature requests and the Contribution Guide
I confirm I have checked existing list of Feature requests and Contribution Guide.
The text was updated successfully, but these errors were encountered:
@EricHarbers -Thanks for the report about this issue and the solution you have found.
It makes a lot of sense to change it to the highest possible priority, given that it is a Wireless interface and it may need to be on the high priority in order to achieve performance and throughput.
Related area
BluetoothSerial.cpp driver (V2.0.14)
Hardware specification
ESP32 dev module
Is your feature request related to a problem?
On Arduino BSP I have created a program that reads data from the serial port and sends it to the Bluetooth SPP serial port. At high speeds (260 KBit/s) the bluetooth module looses data. If you connect to the Bluetooth SPP port using eg a PC with a client app, it will not receive all sent bytes.
Describe the solution you'd like
After searching around in my software, I concluded that the Bluetooth module would loose the data bytes.
Then I started looking around in the BluetoothSerial.cpp driver and found the initialisation of the Bluetooth Serial process. When I change the task priority of the Bluetooth Process, the problem is solved.
The change I have made is in the function "_init_bt()".
I changed this code:
The changed code:
I found this because other processes in the ESP32 module will have the (configMAX_PRIORITIES-1) priority.
After changing the priority, I have had no data loose at all.
Describe alternatives you've considered
In my code, I have made the transfer from serial port to SPP as fast as possible.
At first I transferred the data byte by byte. Now I transfer the data in blocks, using the read and write functions.
I 've looked around on the internet, but I couldn't find any good solution to my problem.
BluetoothSerial_changed.zip
ESP32_Myomed.zip
Additional context
No response
I have checked existing list of Feature requests and the Contribution Guide
The text was updated successfully, but these errors were encountered: