Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirming C6 can be made to work #478

Open
karantza opened this issue Feb 17, 2025 · 1 comment
Open

Confirming C6 can be made to work #478

karantza opened this issue Feb 17, 2025 · 1 comment

Comments

@karantza
Copy link

Hi! Just wanted to confirm that I am able to get Bermuda working using my C6 boards (specifically, these DFRobot boards), since that was mentioned in the wiki as unverified. I had to use a newer version of esp-idf, even with the latest esphome, or I'd get compile errors. But with these versions it's good.

My data is pretty noisy with lots of gaps, but I read that's a common issue. I may need to play with the timings more. But it does technically work.

My relevant esphome config, mostly borrowed from the example C3 config (note, I might not need all those platformio overrides anymore, I haven't tested removing them recently):

esphome:
  name: $devicename
  friendly_name: $friendlyname
  platformio_options:
    board_build.f_cpu: 160000000L
    board_build.f_flash: 80000000L
    board_build.flash_size: 4MB
    build_flags: "-DBOARD_HAS_PSRAM"
    board_build.arduino.memory_type: qio_opi


esp32:
  board: esp32-c6-devkitm-1
  variant: esp32c6
  framework:
    type: esp-idf
    version: 5.3.1
    platform_version: 6.9.0
    sdkconfig_options:
      CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y
      CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y
      CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10"


logger:
  baud_rate: 0

safe_mode:

api:
  password: ""

  on_client_connected:
     - esp32_ble_tracker.start_scan:
        continuous: true
  on_client_disconnected:
    if:
      condition:
        not:
          api.connected:
      then:
        - esp32_ble_tracker.stop_scan:

ota:
  - platform: esphome
    password: ""

wifi:
  ssid: $wifissdi
  password: $wifipassword

# Added to get ADC working properly
external_components:
  - source: github://PhracturedBlue/c6_adc
    #refresh: 0s   # uncomment to force refresh of repo

esp32_ble_tracker:
  scan_parameters:
    continuous: false
    active: false 

    interval: 322ms
    window: 200ms # Shortened this time to try and improve reliability

bluetooth_proxy:
  active: false

Example of reading the distances from all the ESP32-C6s in my house:

Image
@GitJaxder
Copy link

I did something similar for my C6 that I purchased from aliExpress a while back.

I created a PR to merge in my C6 config...before I even looked at the issues tracker here. Got too excited about the fact my config complied and appears to be working...My bad haha.

https://github.com/agittins/bermuda-proxies/pull/1/files

Here's my code:

substitutions:
  wifi_ip: # Omitted because reasons
  wifi_ssid: !secret wifi_ssid # If you aren't using secrets, you're bad and you should feel bad. 💖
  wifi_password: !secret wifi_password # If you aren't using secrets, you're bad and you should feel bad. 💖
  name: ble-proxy-[Room] # Change [Room] to whatever you like.
  friendly_name: BLE Proxy [Room] # Change [Room] to whatever you like.
  comment: ESPHome proxy tuned for Bermuda
  name_add_mac_suffix: "True"  # Adds the last 4 characters of the MAC address to the name.
  baud_rate: "0"  # If you need serial debugging, override this to 115200 or similar.
  ble_interval: 320ms
  ble_window: 300ms
  proxy_active_scan: "True"  # Set to false to avoid requesting scan info for device names etc
  ota_pw: # Omitted because reasons
  api_key: # Omitted because reasons
  beacon_uuid: # Omitted because reasons
  beacon_major: "42069" # Nice
  beacon_minor: # Omitted because reasons

packages:
  Bermuda.include_minimal: github://agittins/bermuda-proxies/packages/bermuda-proxy-esp32-c3-minimal.yaml

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  comment: ${comment}
  name_add_mac_suffix: ${name_add_mac_suffix}

# ---------------------------------------------------------------------------------------- #
# ESP-32-c6 Specific stuffs as per:
# https://github.com/esphome/issues/issues/5938#issuecomment-2377374855
esp32:
  board: esp32-c6-devkitc-1
  flash_size: 4mb
  variant: esp32c6
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_ESPTOOLPY_FLASHSIZE_4MB: y
    version: 5.3.1
    platform_version: 6.9.0

#This is to make sure adc compiles or else it will throw an error
external_components:
  - source:
      # https://github.com/lboue/esphome/blob/adc_oneshot/esphome/components/adc
      type: git
      url: https://github.com/lboue/esphome
      ref: adc_oneshot
    components: [ adc ]
    refresh: 0s
# ---------------------------------------------------------------------------------------- #


logger:
  baud_rate: 0  # 0 Enables logging, but disables serial-port logging to free CPU and memory

# Enable Home Assistant API
api:
  encryption:
    key: ${api_key}
  # This ensures BLE scanning only happens after the wifi is up and 
  # the device is connected to HomeAssistant. This is particularly
  # important for ESP32-C3 devices, but is good for all.
  on_client_connected:
     - esp32_ble_tracker.start_scan:
        continuous: true
  # Disable BLE tracking when there are no active api connections
  on_client_disconnected:
    if:
      condition:
        not:
          api.connected:
      then:
        - esp32_ble_tracker.stop_scan:

# I like MQTT, so I added it here.
mqtt:
  broker: # Omitted because reasons
  username: mqtt-esphome
  password: !secret mqtt_password
  discovery: False
  discover_ip: True

ota:
  - platform: esphome
    password: ${ota_pw}

wifi:
  ssid: ${wifi_ssid}
  password: ${wifi_password}
  manual_ip:
    gateway: # Omitted because reasons
    subnet: 255.255.255.0
    static_ip: ${wifi_ip}
  fast_connect: True

captive_portal:

bluetooth_proxy:
  active: True

esp32_ble_beacon:
  type: iBeacon
  uuid: ${beacon_uuid}
  major: ${beacon_major}
  minor: ${beacon_minor}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants