Introduction:
I have this: Wemos C3 Mini - Lolin ESP32-C3 ( C3 mini — WEMOS documentation )
I wanted to use it as a Bluetooth proxy and to use also the onboard RGB Led so I wanted an arduino platform, not esp_idf.
Problem
I was having a strange behaviour: very loooong time t oconnect to WiFi (1 … 2 or even 3 minutes) or sometimes it was even not connecting (I was restarting it until it was connecting in some minutes).
I tried and tried, various variants and … nothing.
Thanks for sharing. My Seeed Xiao now works as my bluetooth proxy that enables my switchbot again (which failed since I installed USB3.0 SSD on HA).
However I have one observation. If i connect to my Seeed Xiao with ESPHome web through USB, it boots just fine. If I don’t do it and just plug in USB power, it doesn’t seem to boot and I can’t reach it wirelessly through esphome. That’s one weird thing. I’ll do more tests in the coming days.
Yeah I found that out too. However I still can’t get that resolved so I just disconnect the power and let my Seeed xiao collect dust now. I have another esp32 board serving as my bluetooth proxy now but ironically it stopped working suddenly two days ago, without me doing any software updates. Hence why I am back to this forum again.
I am still trying to turn on the RGB LED using NeoPixel, without success.
At the moment, the only way I have found to turn on the led is to ground pins 3,4 and 5. Which are Red, Green and Blue respectively.
So i’ve made this and it works:
Update: Tried with only 2 binary_sensors enabled and was briefly seeing more stable tracking… but now my watch is “on”, but the phone is “off” again…
Does anyone find the ble tracking feature to be unreliable or very slow (compared to regular sized ESP32-S)? I am sitting right next to the ESP32-C3 and both my phone and watch are showing presence as off (or they flip between on/off frequently despite not moving out of the room). Thinking these little devices may only be useful to me as additional BT Proxies. Code snipped below with an example binary_sensor (I have 6 configured in total):
I gave up on using the C3 for presence or BT Proxy and currently using the full size ESP32… eg. S3.
I do still use the C3 purely for checking the battery levels of my BT Beacons. For whatever reason, when I added steps to check on the battery levels with the S3, either the battery levels would not update reliably, or other issues turned up.
This is more or less what I have for the battery level tracking on the C3 in ESPHome (I have a Home Assistant Automation that runs the script every morning):
So far having one BLE proxy on ESP32-C3 SuperMini.
Tried on Arduion & IDF frameworks - both works fine.
To solve issue with WiFi/BLE simultenious working using following:
@Masterzz oh, mine is a mess compared to that. Here is what is on my C3 superminis that I copied from somewhere here or on the wiki:
substitutions:
name: esp32-bluetooth-proxy-1c9da0
friendly_name: Bluetooth Proxy Bathroom
packages:
esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic/esp32-generic-c3.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
esp32:
board: esp32-c3-devkitm-1 # Feel free to use a more specific board if that's what you have
framework:
type: esp-idf # This is important: the default "arduino" framework does not perform well.
sdkconfig_options:
# @grigi found in testing that these options resulted in better responsiveness.
# BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives.
CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y
# Also enable this on any derivative boards (S2, C3 etc) but not the original ESP32.
CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y
# Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds.
CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10"
logger:
baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory
ota:
platform: esphome
api:
encryption:
key: redacted
# Only enable BLE tracking when wifi is up and api is connected
# Gives single-core ESP32-C3 devices time to manage wifi and authenticate with api
on_client_connected:
- esp32_ble_tracker.start_scan:
continuous: true
# Disable BLE tracking when there are no api connections live
on_client_disconnected:
if:
condition:
not:
api.connected:
then:
- esp32_ble_tracker.stop_scan:
esp32_ble_tracker:
scan_parameters:
# Don't auto start BLE scanning, we control it in the `api` block's automation.
continuous: False
active: True # send scan-request packets to gather more info, like device name for some devices.
interval: 320ms # default 320ms - how long to spend on each advert channel
window: 300ms # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable.
# If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be
# required if your device is controlling other sensors or doing PWM for lights etc.
bluetooth_proxy:
active: true # allows outbound connections from HA to devices.
sensor:
- platform: uptime
# The uptime sensor is extremely helpful to know if your device is rebooting
# when it shouldn't be. This might indicate your interval-to-window timing is
# too tight, and the window needs to be reduced.
name: "Uptime Sensor"
update_interval: 60s