如何将ESP32设置为最大BLE功率? [英] How do you set the ESP32 to maximum BLE Power?

查看:301
本文介绍了如何将ESP32设置为最大BLE功率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为最大距离增加ESP32 BLE的最大功率?似乎默认设置为索引5,仅为+ 3dbm.(ESP_PWR_LVL_P3 =索引5,对应于+ 3dbm)更多详细信息

How do you increase the ESP32 BLE to maximum power, for maximum distance? It appears the default is set to index 5, which is only +3dbm. (ESP_PWR_LVL_P3 = index 5, Corresponding to +3dbm) More Details

推荐答案

曾经有一个

There used to be a bug, it appears its fixed now. As indicated above, ESP_PWR_LVL_P9 = index 7, which indicates +9dbm.

在"BLEDevice :: init("ESP32");"之后,将其添加以获得最大输出:

After "BLEDevice::init("ESP32");", add this to get the maximum output:

esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P9); 
esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P9);
esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_SCAN ,ESP_PWR_LVL_P9);

通过此检查:

int pwrAdv  = esp_ble_tx_power_get(ESP_BLE_PWR_TYPE_ADV);
int pwrScan = esp_ble_tx_power_get(ESP_BLE_PWR_TYPE_SCAN);
int pwrDef  = esp_ble_tx_power_get(ESP_BLE_PWR_TYPE_DEFAULT);
Serial.println("Power Settings: (ADV,SCAN,DEFAULT)");         //all should show index7, aka +9dbm
Serial.println(pwrAdv);
Serial.println(pwrScan);
Serial.println(pwrDef);

还可以通过nRF Connect之类的Android手机应用程序确认Tx功率电平现在为9dBm.

Can also confirm via an Android phone app like nRF Connect, that the Tx Power Level is now 9dBm.

这篇关于如何将ESP32设置为最大BLE功率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆