-
Notifications
You must be signed in to change notification settings - Fork 27
Minor changes to support ESP32-S6 and esphome 2025.2.2 #39
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
base: main
Are you sure you want to change the base?
Conversation
I tested this PR on my board and compiled it just fine: esp32:
board: esp32-c6-devkitc-1
flash_size: 8MB
variant: esp32c6 Installation, however, is not so good:
|
Can you share your whole config and more of the boot loop log? There is usually some clue why that happens. Which S6 dev board are you using? |
Recreated in a cleaner approach:
Log with only error level: My Config: This is the yamlsubstitutions:
name: "esp32-c6-2-mic"
friendly_name: "ESP32_C6_2-mic"
esphome:
name: "esp32-c6-2-mic"
friendly_name: "ESP32_C6_2-mic"
esp32:
board: esp32-c6-devkitc-1
flash_size: 8MB
variant: esp32c6
framework:
type: esp-idf
sdkconfig_options:
CONFIG_ESPTOOLPY_FLASHSIZE_8MB: y
version: "5.3.1"
platform_version: 6.9.0
external_components:
- source: github://mafrosis/esphome-sound-level-meter@tmp
components: [i2s, sound_level_meter]
logger:
level: WARN
baud_rate: 115200
hardware_uart: USB_SERIAL_JTAG
logs:
sensor: WARN
component: WARN
esp-idf: ERROR
template.sensor: WARN
text_sensor: WARN
api:
encryption:
key: !secret api_key
ota:
- platform: esphome
password: !secret ota_password
wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
- ssid: !secret wifi_ssid_portable
password: !secret wifi_password_portable
# Board will host Wifi by itself
ap:
ssid: "${friendly_name}"
password: !secret fall_back_wifi_password
manual_ip:
static_ip: !secret ap_static_ip_portable
gateway: !secret ap_static_gateway
subnet: 255.255.255.0
dns1: !secret ap_static_dns
dns2: 8.8.8.8
# When no WifI
reboot_timeout: 900s
# Do not fast connect when portable
# fast_connect: true
# Do not use when portable
# captive_portal:
web_server:
port: 80
version: 3
sorting_groups:
- id: sorting_group_co2
name: "CO2 Values (SDC41)"
sorting_weight: -1
- id: sorting_group_statistics
name: "Statistics"
sorting_weight: 10
- id: sorting_group_calibration
name: "Calibration Values"
sorting_weight: 40
- id: sorting_group_diagnostic
name: "Diagnostic info"
sorting_weight: 60
- id: sorting_group_service
name: "Service"
sorting_weight: 90
i2s:
bck_pin: 23
ws_pin: 18
din_pin: 19
sample_rate: 48000 # default: 48000
bits_per_sample: 32 # default: 32
# right shift samples.
# for example if mic has 24 bit resolution, and i2s configured as 32 bits,
# then audio data will be aligned left (MSB) and LSB will be padded with
# zeros, so you might want to shift them right by 8 bits
bits_shift: 8 # default: 0
sound_level_meter:
# update_interval specifies over which interval to aggregate audio data
# you can specify default update_interval on top level, but you can also
# override it further by specifying it on sensor level
update_interval: 1s # default: 60s
# buffer_size is in samples (not bytes), so for float data type
# number of bytes will be buffer_size * 4
buffer_size: 1024 # default: 1024
# see your mic datasheet to find sensitivity and reference SPL.
# those are used to convert dB FS to db SPL
mic_sensitivity: -26dB # default: empty
mic_sensitivity_ref: 94dB # default: empty
# for flexibility sensors are organized hierarchically into groups.
# each group can have any number of filters, sensors and nested groups.
# for examples if there is a top level group A with filter A and nested
# group B with filter B, then for sensors inside group B filters A
# and then B will be applied:
# groups:
# # group A
# - filters:
# - filter A
# groups:
# # group B
# - filters:
# - filter B
# sensors:
# - sensor X
groups:
- sensors:
- type: eq
name: Leq_1s
# END The board |
You can see the stackdump happens on a call to The ESP32s6 has only a single core, so the default |
Thanks for your time! I forgot that part trying all different approaches,
Fixed in yaml here: # audio processing runs in a separate task, you can change its settings below
task_stack_size: 4096 # default: 4096
task_priority: 2 # default: 2
# https://github.com/stas-sl/esphome-sound-level-meter/pull/39#issue-2931371576
task_core: 0 # default: 1 But still no luck, the crash is now happening right after the Wi-Fi is connected. Trace
UPD: UPD2: Debug log
UPD3:
So, this is Wifi issue, I can't remember where I read about early ESPHome versions having issues with |
It would be safest to test this against some existing configs and platformio versions before merging to main, but the changes themselves seem pretty harmless. Mostly compiler noise due to more strict options during build - I'm not sure when that changed.
For reference I'm using one of these:
https://www.waveshare.com/esp32-c6-lcd-1.47.htm
Build config:
Note for future readers: you will need to set
task_core: 0
on thesound_level_meter
config, as the S6 has only a single CPU core.To test you have to make sure you're referencing the branch named in this PR. In this case it's from my fork: