added tweaks to filter

This commit is contained in:
Brent Perteet
2025-08-08 17:31:27 -05:00
parent fb9fd84bf1
commit c4ca91bf84
17 changed files with 210 additions and 2440 deletions

51
bt_test/bt_test.ino Normal file
View File

@@ -0,0 +1,51 @@
#include <BluetoothSerial.h>
#include "esp_bt.h"
#include "esp_bt_main.h"
#include "esp_bt_device.h"
BluetoothSerial SerialBT;
void setBluetoothTxPower(esp_power_level_t powerLevel) {
esp_err_t err = esp_bredr_tx_power_set(powerLevel, powerLevel);
if (err != ESP_OK) {
Serial.printf("Failed to set TX Power: %s\n", esp_err_to_name(err));
} else {
Serial.printf("TX Power set to level %d\n", powerLevel);
}
}
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("Initializing Bluetooth...");
if (!btStart()) {
Serial.println("Failed to start BT controller");
return;
}
// Disable and re-enable the classic BT stack to safely set TX power
esp_bluedroid_disable();
esp_bluedroid_deinit();
// Set Classic BT TX power (e.g., ESP_PWR_LVL_P9 = highest)
//setBluetoothTxPower(ESP_PWR_LVL_P9);
setBluetoothTxPower(ESP_PWR_LVL_N12);
esp_bluedroid_init();
esp_bluedroid_enable();
if (!SerialBT.begin("ESP32-TXPowerTest")) {
Serial.println("Bluetooth Serial failed to start");
return;
}
Serial.println("Bluetooth initialized and ready!");
}
void loop() {
SerialBT.println("Hello from ESP32 with boosted TX power!");
delay(1);
}