ESP is losing WiFi connections when enable Bluetoot

When start the bluetooth on the ESP is losing WiFi connections.

I will connect my xiaomi_lywsdcgq sensors over Bluetooth.

Everything works fine and i have good connections over Wi-FI until i add this row

esp32_ble_tracker:

After update i lose WiFi connections.

esphome:
  name: ble-server-bnb
  friendly_name: ble-server-bnb

# Hardware configuration
esp32:
  board: esp32dev
  framework:
    type: esp-idf


# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "6f???"

ota:
  - platform: esphome
    password: "6c???"

wifi:

  ssid: "TP?????"
  password: "Le????"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Ble-Server-Bnb Fallback Hotspot"
    password: "1????"

captive_portal:

switch:
  - platform: gpio
    name: "Lamp garage"
    pin: GPIO5

# Enable BLE 
esp32_ble_tracker:
1 Like

Just a heads up, you are sharing your wifi name and password.

edit: nevermind, saw you edited it out now.

thanks , i just realised my mistake

Did you upload that through usb serial? It’s likely required first time.

WiFi and Bluetooth share the radio on ESP32. If your WiFi network won’t tolerate that, you may need to consider ethernet.

I still recommend the Olimex ESP32-POE-ISO-EA together with the Olimex BOX-ESP32-POE-ISO-EA-F.

If you are having trouble getting them because of the tariffs, you can get them from Digikey in the US but the lead time is longer:
https://www.digikey.com/en/products/detail/olimex-ltd/ESP32-POE-ISO-EA-IND/21662101
https://www.digikey.com/en/products/detail/olimex-ltd/BOX-ESP32-POE-ISO-EA-F/26226957

These are proven stable and are also compatible with the ESPHome ready-made projects.

1 Like

Thanks for the hint. First i did over OTA , so i did think that was the problem, But after upload over USB the same problem remains.

Does it work if you switch to arduino framework?

Are you sure you’re just losing WiFi versus the device crashing?

I’d try removing Captive Portal as the BT component consumes a lot of RAM. I exclude that on all my devices that use BT Proxy (thought it was in the docs, but maybe I just found out via trial and error).

The docs specifically say to avoid the Arduino framework.

For debugging purposes.

I have devices running a shitload of stuff with ble_tracker including web_server with busy http api. Never experienced lost wifi.
Better to avoid though…

It seems when i change the code not using API encryption the ESP works fine
by removing bellow parts

# Enable Home Assistant API 
api: 
  encryption: 
  key: "hpsAlzZ9opxLjb9I7xGxwEKVc2gLuauN0DzgoVu79xg="