ESP32 Serial Bluetooth baud rate configuration

Thread Starter

Elazar

Joined Oct 29, 2019
49
Hi Experts,

I am using the ESP32 with the Arduino IDE platform.
with the original SPP Bluetooth library
#include "BluetoothSerial.h"

Is there any way (or library that supports) to configure the Bluetooth baud rate?

As of now, the baud rate is to fast, and I need to configure it to 9600,

Thank You!
 

Ya’akov

Joined Jan 27, 2019
9,069
I am using the ESP32 with the Arduino IDE platform.
with the original SPP Bluetooth library
#include "BluetoothSerial.h"

Is there any way (or library that supports) to configure the Bluetooth baud rate?

As of now, the baud rate is to fast, and I need to configure it to 9600,

According to the example:

Code:
void setup() {
  Serial.begin(115200);
  SerialBT.begin("ESP32test"); //Bluetooth device name
  Serial.println("The device started, now you can pair it with bluetooth!");
}
 

Thread Starter

Elazar

Joined Oct 29, 2019
49
Serial.begin(115200);
is only for the UART?
Is there a way to configure the Bluetooth SPP serial rate?
 

Thread Starter

Elazar

Joined Oct 29, 2019
49
Yes, I tried it, and it is only for the UART
you can also see on the object
the Bluetooth object is SerialBT
and the UART object is Serial
 

Thread Starter

Elazar

Joined Oct 29, 2019
49
Yes,
I don't see any function to configure the baud rate,
However, are there any other libraries that support Bluetooth baud rate configuration?
 

Ya’akov

Joined Jan 27, 2019
9,069
Yes,
I don't see any function to configure the baud rate,
However, are there any other libraries that support Bluetooth baud rate configuration?
I was about to post the same thing. But let's back up a minute, why do you need to change the device bitrate?
 

Ya’akov

Joined Jan 27, 2019
9,069
I was about to post the same thing. But let's back up a minute, why do you need to change the device bitrate?
To be clear, are you having trouble with the 115200 on the receiving side? It's packet oriented, so you just handle it as you can... Could you explain what isn't working?
 

Ya’akov

Joined Jan 27, 2019
9,069
The receiving side only works with baud rate at 9600
I might be able to help, maybe not, but could you describe your architecture? I can't tell what is talking to what so "receiving side" is confusing. Even if I can't help, it might help someone else help you.
 

Thread Starter

Elazar

Joined Oct 29, 2019
49
I developed a project with the ESP32 and it needs to connect and communicate with a phone app (master) that only supports a 9600 baud rate
 

Ya’akov

Joined Jan 27, 2019
9,069
I developed a project with the ESP32 and it needs to connect and communicate with a phone app (master) that only supports a 9600 baud rate
I may be wrong, because I never had this problem, but doesn't the UART speed only matter to the device side? Since the Bluetooth is packet oriented, it isn't going to care about the UART speeds, whatever they are. That is, if your ESP32 is running at 115.2K, the phone will know nothing about that, it will just handle the traffic locally at the speed it can handle.

I think you might need to implement handshaking, but I don't think the BT connection cares about the UART speed.

Can you use the logging to see what's going on? Could the problem be buffer overruns on the slow side?
 

Thread Starter

Elazar

Joined Oct 29, 2019
49
The Bluetooth haves nothing to do with the UART,
I just need a way to configure the Bluetooth transmitting speed,

for example, in the HC-05 there is a simple AT function to configure the transmission baud rate.
 

Ya’akov

Joined Jan 27, 2019
9,069
The Bluetooth haves nothing to do with the UART,
I just need a way to configure the Bluetooth transmitting speed,

for example, in the HC-05 there is a simple AT function to configure the transmission baud rate.
I am not being clear.

The BT serial on the phone is 9.6K to the UART on the phone, the BT serial on the ESP32 is 115.2K to the UART on the ESP32, the BT radio link doesn't seem to have such a limit, it transmits at it's full speed and buffers on each side.

The HC-05 AT command is for the UART, from what I can see...

(I may be missing something here, so I will leave this to someone with experience beyond mine. I've never had to worry about anything but UART speed, so maybe I didn't encounter this...)
 

Thread Starter

Elazar

Joined Oct 29, 2019
49
Yaacov,
I am not using the esp32 as a Bluetooth module.
I use the esp32 as the projects controller... and also use the Bluetooth peripheral with the Arduino
#include "BluetoothSerial.h" library

UART is a separate serial communication peripheral, that needs to be separately configured...
 

Ya’akov

Joined Jan 27, 2019
9,069
Yaacov,
I am not using the esp32 as a Bluetooth module.
I use the esp32 as the projects controller... and also use the Bluetooth peripheral with the Arduino
#include "BluetoothSerial.h" library

UART is a separate serial communication peripheral, that needs to be separately configured...
Yaacov,
I am not using the esp32 as a Bluetooth module.
I use the esp32 as the projects controller... and also use the Bluetooth peripheral with the Arduino
#include "BluetoothSerial.h" library

UART is a separate serial communication peripheral, that needs to be separately configured...
We may or may not be talking about the same thing. Sorry I couldn't help, I'll let others try. Hope you work it out soon.
 

Thread Starter

Elazar

Joined Oct 29, 2019
49
I am not being clear.

The BT serial on the phone is 9.6K to the UART on the phone, the BT serial on the ESP32 is 115.2K to the UART on the ESP32, the BT radio link doesn't seem to have such a limit, it transmits at it's full speed and buffers on each side.

The HC-05 AT command is for the UART, from what I can see...

(I may be missing something here, so I will leave this to someone with experience beyond mine. I've never had to worry about anything but UART speed, so maybe I didn't encounter this...)

Oh, now I understand,

So basically you say that it is probably a problem with the phone app's side,

Yaacov thanks a lot for your help!
 
Top