openhaystack icon indicating copy to clipboard operation
openhaystack copied to clipboard

Microbit being seen a lot more than ESP32

Open mearsy opened this issue 3 years ago • 3 comments

Odd question. I have both a microbit v1 and and ESP32-WROOM both with the firmware from the current build. They are sitting side by side in the same location in my car on the drive. In the past hour the microbit has been seen 10 times. The ESP32 only twice. Obviously for tracking this is less than ideal. I am wondering why this might be the case?

mearsy avatar Feb 16 '22 19:02 mearsy

Having played with many different microcontrollers I suspect the difference in signal strength and quality between them as the most probable factor.

Itheras avatar Feb 17 '22 01:02 Itheras

Having played with many different microcontrollers I suspect the difference in signal strength and quality between them as the most probable factor.

I suspect it is down to the default TX power on the ESP32-Wroom. Im desperately struggling to find the right code to modify the firmware. It looks like the default TX for the Microbit is quite powerful

mearsy avatar Feb 17 '22 04:02 mearsy

The default tx power is 3dBm and the max should be 9 dBm. I increased the power of TX with this patch


diff --git a/Firmware/ESP32/main/openhaystack_main.c b/Firmware/ESP32/main/openhaystack_main.c
index 7459e50..d5b0d3a 100644
--- a/Firmware/ESP32/main/openhaystack_main.c
+++ b/Firmware/ESP32/main/openhaystack_main.c
@@ -131,6 +131,8 @@ void app_main(void)
     esp_bluedroid_init();
     esp_bluedroid_enable();
 
+    esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P9);
+
     // Load the public key from the key partition
     static uint8_t public_key[28];
     if (load_key(public_key, sizeof(public_key)) != ESP_OK) {

With the app BLEScanner on android RX improve about 7/8 dBm

ghost avatar Mar 05 '22 19:03 ghost