-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth looses data using library V3.0.4 #10314
Comments
can you please provide a minimal sketch to reproduce the issue. One that we can compile and verify |
ESP32Control.zip
} >default_rodata_seg |
MyoConnect.zip |
No, you miss the device that is serial connected to the ESP32. |
I don't know how to let you get our problem, because I miss a part of our device that is specific. |
You have to simply send data between the ESP32 and a PC using a bluetooth channel. The data should be read by the ESP32 from a serial input at 230400 bps. That is what my device does. |
The data loose is still coming, despite the bigger buffer I used |
I've investigated some more time in the problem. With BSP V3.0.4 I had the following problems:
|
there are no changes on our end between those versions, which suggests that maybe something in IDF changed. If so, maybe it's already fixed or will be soon fixed. Please try the new versions when they come out |
On your BluetoothSerial.cpp, I've seen a lot of changed code between V3.0.3 and V3.0.4. I don't know the changes with serial uart. |
are you sure you've seen changes in BluetoothSerial between 3.0.3 and 3.0.4? 3.0.3 was released on July 17th and last change is in June 19th |
Dear me-no-dev, Yes, I am absolutely sure that the code for BluetoothSerial has been changed between V3.0.3 and V3.0.4. That's why I initially came with the bufsize change. |
No, you have right. But I don't know why V3.0.3 BT will work correctly and V3.0.4 BT not. |
Probably something in ESP-IDF driver changed. That is why I suggested for you to try new versions when we release them and see if the issue has been resolved |
I've installed BSP 3.0.5 and tested that with my ESP32 project. |
I have quite the same problem with data receive from UART. With version 3.0.3 all is good, but in version 3.0.5 the data received is sometimes smaller than 0x80. For example, normal data is 0x93 but sometimes I receive 0x13 instead.
And this is the problem because my speed is 256 kbaud. If I take 128 kbaud, no problem.
|
Adding this case for testing NimBLE future library. @lucasssvaz PTAL. |
Is the issue still there with actual Arduino core 3.1.3 and 3.2.0-rc2? |
Hi, No, problem is not solved and I think to know where is the problem.
The problem is that
|
@SuGlider Could you PTAL in this uart issue ? |
Can you try with |
I tried. Work fine with |
So raw correction is to add this lines:
Before change the baudrate:
|
No, when changing the baudrate the command |
Ok, in that case, we need a warning for the |
Documentation is Open Source too. A PR is welcome |
Are we hijacking this issue? @GitHubLionel - does the UART reported problem relate to this BT Serial issue? |
@EricHarbers Is the orig. issue fixed? |
@Jason2866 Due to issue #10420 I can't currently test the problem properly. Maybe the problem is issue #10420 itself. |
As said in #10420 (comment), On a separated FreeRTOS Task, it can check the flag or the Semaphore or block an infinite loop that checks if there is data in the Queue. Then process this data and send it to the SerialBT receiving end. The current code is not recomented. void bluetooth_receiveSerial() {
size_t len;
while ((len = Serial.read(ReceiveBuffer, sizeof(ReceiveBuffer))) > 0) {
#ifdef MYOMEDPROTOCOL_ACTIVE
mp_receive.parse(ReceiveBuffer, len);
#endif
SerialBT.write(ReceiveBuffer, len);
}
} |
Closing since fixed. |
Board
ESP32
Device Description
The ESP32 chip is connected to a Bluetooth Serial device, eg a PC
Hardware Configuration
The ESP32 chip is connected to a serial device, using a UART
Version
v3.0.4
IDE Name
Arduino IDE
Operating System
Windows 10
Flash frequency
40 MHz
PSRAM enabled
yes
Upload speed
230400
Description
Today I installed the ESP32 library V3.0.4 for Arduino.
After I create a version of my project for the ESP32 project I use, my Bluetooth Serial communication looses data. The data will be transferred from a serial uart at 230400 Baud.
The problem started since the V3.0.4 version of the library. With previous versions I had no problems for Bluetooth.
I have seen that between the old version and the V3.0.4 version, the file BluetoothSerial.cpp has been changed significiantly.
With the V3.0.4 version, my bluetooth looses bytes at the speed of 230400 baud.
Sketch
Debug Message
Other Steps to Reproduce
I have solved the problem by increasing the TX_QUEUE_SIZE in the V3.0.4 lib file BluetoothSerial.cpp. See line 44:
The original TX_QUEUE_SIZE was: 32
I have increased the TX_QUEUE_SIZE to: 128
This change solved my problem.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: