Page 2 of 2

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

Posted: Tue May 03, 2022 5:56 pm
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

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

Posted: Wed May 04, 2022 8:02 am
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 1717 times

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

Posted: Wed May 04, 2022 6:35 pm
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

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

Posted: Thu May 05, 2022 8:42 am
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 1702 times