ESP32 How to set Power Level Bluetooth Classic BR/EDR

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
LeighM
Valued Contributor
Posts: 398
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 70 times
Been thanked: 211 times

Re: ESP32 How to set Power Level Bluetooth Classic BR/EDR

Post by LeighM »

Hi Stefan,

The C code should look like this ...

Code: Select all

esp_power_level_t esp_min, esp_max;
esp_bredr_tx_power_get(&esp_min, &esp_max);
FCV_MIN = (unsigned char) esp_min;
FCV_MAX = (unsigned char) esp_max;
Hope that helps,
Leigh

stefan.erni
Valued Contributor
Posts: 756
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 How to set Power Level Bluetooth Classic BR/EDR

Post by stefan.erni »

Hi Leigh

If I insert the first line: I can complie, download and the program is runing
If I insert the second line: I can complie, download and the program is crashing immediately even if I wait few seconds before the command

regards

Stefan
power_2022-05-04_8-54-45.jpg
power_2022-05-04_8-54-45.jpg (23.84 KiB) Viewed 1685 times

LeighM
Valued Contributor
Posts: 398
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 70 times
Been thanked: 211 times

Re: ESP32 How to set Power Level Bluetooth Classic BR/EDR

Post by LeighM »

Hi Stefan,

I'm getting a crash (abort) in function FC_CAL_RMT_TX_ (ESP_CAL_RMT.c line 115)
when called from LED_WS2811::Refresh, called from Init_All()

This is probably because you are calling the LED_WS2811::Refresh before the call to LED_WS2811::Initialise

Unless your crash log is different?

Leigh

stefan.erni
Valued Contributor
Posts: 756
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 How to set Power Level Bluetooth Classic BR/EDR

Post by stefan.erni »

Hi Leigh

You're right. The crash comes from the LED_WS2811.
Before I post the program, I created a macro and put all the init there. But in this macro the init from the LED_WS2811 doesn't work. I took the init back to main. Everything is fine again. Also both C command are working fine now.
I made some test and
Default powersetting is:
ESP_PWR_LVL_N0 = 4, !< Corresponding to 0dbm
ESP_PWR_LVL_P3 = 5, !< Corresponding to +3dbm

I have now set to the minimum
ESP_PWR_LVL_N12 = 0, !< Corresponding to -12dbm
ESP_PWR_LVL_N9 = 1, !< Corresponding to -9dbm

Code: Select all

esp_bredr_tx_power_set(ESP_PWR_LVL_N12,ESP_PWR_LVL_N9);
I tested the power setting and sent it to the computer via USB and it seems to work.
I will now measure how long my device is working longer on the batteries

regards

Stefan
power_2022-05-05_9-16-34.jpg
power_2022-05-05_9-16-34.jpg (44.43 KiB) Viewed 1670 times

Post Reply