Skip to content

Commit 2a83952

Browse files
gnumpithat1guyroot
authored
Prepare release v.0.1.0 (#229)
* - BROKEN: Adding optional ld2450 component - This optional component adds LD241050 support to the Sat1 (however, it is currently causing the wake word not to respond). * Add entities for ld2410 to config. Add example code for sensor tuning. * Removed docs-related YAML. Renamed some sensors for uniformity. Small fixes. * mute pcm5122 on startup * volume and mute support for tas2780 * introduce satellite1 dac_proxy component * enable usage of satellite1 dac proxy * set pcm5122 digital volume control to range from -50db to 0dB * fix: don't set new pcm5122-gpio value on i2c read error * dma and ring-buffer size alignment with 16/48kHz * bump ESPHome to 2024.12.1 * bump ESPHome to 2024.12.2 * tas2780 use stereo downmix * Introducing developer.yaml (#220) - adding optional developer.yaml - gives access to tools to UDP stream microphone for quality testing - optionally emit logs to MQTT server - moves optional packages to satellite1.base * Attempting another LD2450 implementation There are now two non-working implementations in ld2450.yaml file. * - BROKEN: Adding optional ld2450 component - This optional component adds LD241050 support to the Sat1 (however, it is currently causing the wake word not to respond). * Attempting another LD2450 implementation There are now two non-working implementations in ld2450.yaml file. * adjusted volume ranges for tas2780 and pcm5122 * further adjust tas2780 volume settings * fusb302b: move irq handler to core 1 * Confirming LD2450 Code Working - PR#222 allowed to confirm this ls2450 code is working. - Added optional ld2450.yaml file to satellite1.base that the customer can comment out. * Immediately check for update when toggling beta switch (#218) - Immediately check for update when toggling beta switch * Suppress error LEDs when two devices wake simultaneously (#217) Previously when two Sat1s hear the wake word and race to respond one of them would show red LEDs. We are now suppressing the error LEDs on the device that came in second place. This matches Nabus user experience. * fusb302b don't retry the cc detection after it has failed (#221) * adjust wifi settings and audio pipeline timings (#225) * dashboard: Import satellite1.yaml by enabling import_full_config (#227) * dashboard imports satellite1.yaml as it is * satellite1.yaml references components and configs externally (develop branch) --------- Co-authored-by: that1guy <[email protected]> --------- Co-authored-by: that1guy <[email protected]> Co-authored-by: root <root@vscode>
1 parent bf97c1d commit 2a83952

30 files changed

+1159
-116
lines changed

.github/workflows/build_latest.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
files: |
1818
config/satellite1.factory.yaml
19-
esphome-version: 2024.11.2
19+
esphome-version: 2024.12.2
2020
release-summary: develop-branch
2121
release-url:
2222
release-version:

.github/workflows/build_release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
with:
9090
files: |
9191
config/satellite1.factory.yaml
92-
esphome-version: 2024.11.2
92+
esphome-version: 2024.12.2
9393
release-version: ${{ needs.prepare.outputs.next_tag }}
9494

9595
push-tag:

config/common/buttons.yaml

-9
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ event:
3232

3333

3434
binary_sensor:
35-
- platform: gpio
36-
id: line_out_sensor
37-
pin:
38-
pcm5122:
39-
pin: 4
40-
inverted: false
41-
name: "line-out jack"
42-
icon: "mdi:audio-input-stereo-minijack"
43-
4435
- platform: gpio
4536
id: btn_up
4637
pin:
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
substitutions:
2+
ext_comp_repo_ref: develop
3+
4+
external_components:
5+
- source:
6+
type: git
7+
url: https://github.com/FutureProofHomes/Satellite1-ESPHome
8+
ref: ${ext_comp_repo_ref}
9+
components: [ i2s_audio, satellite1, memory_flasher, tas2780, pcm5122, fusb302b ]

config/common/core_board.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,19 @@ esp32:
2222
CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY: "n"
2323
CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1: "y"
2424

25+
CONFIG_LWIP_TCP_MSS: "1460"
26+
CONFIG_LWIP_TCP_WND_DEFAULT: "35040"
2527
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP: "y"
28+
29+
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE: "32"
30+
CONFIG_LWIP_TCP_RECVMBOX_SIZE: "26"
31+
CONFIG_LWIP_UDP_RECVMBOX_SIZE: "6"
32+
2633
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM: "16"
2734
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM: "512"
2835

36+
CONFIG_ESP32_WIFI_RX_BA_WIN: "32" # = min(2*STATIC_RX_BUFFER_NUM, DYNAMIC_RX_BUFFER_NUM)
37+
2938
# BT
3039
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST: "y"
3140
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY: "y"

config/common/debug.yaml

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
2-
external_components:
3-
- source:
4-
type: local
5-
path: ../esphome/components
6-
components: [ version ]
7-
81
debug:
92
update_interval: 5s
103

4+
# # OPTIONAL Persist logs to a an MQTT broker so you can go back in time and inspect them. Read more here: https://esphome.io/components/mqtt.html
5+
# mqtt:
6+
# broker: homeassistant.local
7+
# port: 1883
8+
# username: <mqtt_username_here>
9+
# password: <mqtt_password_here>
10+
# # topic_prefix: <set_this_if_you_are_logging_multiple_satellite1_devices>
11+
1112
text_sensor:
1213
- platform: debug
1314
device:

config/common/developer.yaml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This is a developer configuration that enables the UDP stream component and adds switches to toggle between the ASR and Comm microphones.
2+
# You can read more about how to use this configuration here: https://github.com/FutureProofHomes/Satellite1-ESPHome/tree/develop/tests/mic_streaming
3+
4+
external_components:
5+
- source:
6+
type: git
7+
url: https://github.com/FutureProofHomes/Satellite1-ESPHome
8+
ref: develop
9+
components: [ udp_stream ]
10+
11+
12+
# Separate UDP Stream configurations for each microphone
13+
udp_stream:
14+
id: udp_streamer
15+
microphone: asr_mic # Default microphone to prevent validation errors
16+
17+
18+
# Switches to toggle between ASR and Comm microphones
19+
switch:
20+
- platform: template
21+
name: "UDP Stream ASR Mic"
22+
entity_category: "diagnostic"
23+
id: use_asr_mic
24+
icon: mdi:microphone
25+
restore_mode: RESTORE_DEFAULT_OFF
26+
optimistic: true
27+
on_turn_on:
28+
- logger.log: "Switching to ASR Mic for UDP stream"
29+
- lambda: |-
30+
if (id(udp_streamer).is_running()) {
31+
id(udp_streamer).request_stop(); // Stop current stream
32+
delay(500); // Wait for stream to stop
33+
}
34+
id(udp_streamer).set_microphone(id(asr_mic)); // Set ASR mic
35+
id(udp_streamer).request_start(true); // Start stream with ASR mic
36+
- switch.turn_off: use_comm_mic # Turn off the other switch
37+
38+
on_turn_off:
39+
- logger.log: "Turning off ASR Mic UDP stream"
40+
- lambda: |-
41+
if (id(udp_streamer).is_running()) {
42+
id(udp_streamer).request_stop(); // Stop the stream when ASR mic is turned off
43+
}
44+
- platform: template
45+
name: "UDP Stream Comm Mic"
46+
entity_category: "diagnostic"
47+
id: use_comm_mic
48+
icon: mdi:microphone
49+
restore_mode: RESTORE_DEFAULT_OFF
50+
optimistic: true
51+
on_turn_on:
52+
- logger.log: "Switching to Comm Mic for UDP stream"
53+
- micro_wake_word.stop:
54+
- delay: 500ms
55+
- lambda: |-
56+
if (id(udp_streamer).is_running()) {
57+
id(udp_streamer).request_stop(); // Stop current stream
58+
delay(500); // Wait for stream to stop
59+
}
60+
id(udp_streamer).set_microphone(id(comm_mic)); // Set Comm mic
61+
id(udp_streamer).request_start(true); // Start stream with Comm mic
62+
- switch.turn_off: use_asr_mic # Turn off the other switch
63+
64+
on_turn_off:
65+
- logger.log: "Turning off Comm Mic UDP stream"
66+
- lambda: |-
67+
if (id(udp_streamer).is_running()) {
68+
id(udp_streamer).request_stop(); // Stop the stream when Comm mic is turned off
69+
}
70+
- delay: 500ms
71+
- micro_wake_word.start:

config/common/led_ring.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ globals:
55
type: int
66
restore_value: no
77
initial_value: '0'
8+
# Global variable tracking if the jack has been plugged touched.
9+
- id: jack_plugged_recently
10+
type: bool
11+
restore_value: no
12+
initial_value: 'false'
13+
# Global variable tracking if the jack has been unplugged touched.
14+
- id: jack_unplugged_recently
15+
type: bool
16+
restore_value: no
17+
initial_value: 'false'
818

919
light:
1020
# Hardware LED ring. Not used because remapping needed
@@ -520,6 +530,10 @@ script:
520530
id(control_leds_volume_buttons_touched).execute();
521531
} else if (id(btn_action).state) {
522532
id(control_leds_action_button_touched).execute();
533+
} else if (id(jack_plugged_recently)) {
534+
id(control_leds_jack_plugged_recently).execute();
535+
} else if (id(jack_unplugged_recently)) {
536+
id(control_leds_jack_unplugged_recently).execute();
523537
} else if (id(warning)) {
524538
id(control_leds_warning).execute();
525539
} else if (id(timer_ringing).state) {

config/common/media_player.yaml

+79-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,81 @@
11

22
audio_dac:
33
- platform: pcm5122
4+
id: line_out_dac
45
address: 0x4D
56
- platform: tas2780
7+
id: speaker_dac
68
address: 0x3F
9+
- platform: satellite1
10+
id: dac_proxy
11+
speaker_dac: speaker_dac
12+
line_out_dac: line_out_dac
13+
14+
on_speaker_activated:
15+
# if speaker was used previously but is not available try line-out
16+
- lambda: |
17+
if( id(line_out_sensor).state && id(pd_fusb302b).contract_voltage < 9 ){
18+
id(dac_proxy).activate_line_out();
19+
}
20+
21+
on_line_out_activated:
22+
# if line_out was used previously but is not available try speaker
23+
- lambda: |
24+
if( !id(line_out_sensor).state && id(pd_fusb302b).contract_voltage >= 9 ){
25+
id(dac_proxy).activate_speaker();
26+
}
27+
28+
on_state_change:
29+
- media_player.volume_set:
30+
volume: !lambda return id(dac_proxy).volume();
31+
- lambda: |
32+
if( id(dac_proxy).is_muted() ){
33+
id(nabu_media_player)->make_call()
34+
.set_command(MEDIA_PLAYER_COMMAND_MUTE)
35+
.perform();
36+
}
37+
38+
39+
binary_sensor:
40+
- platform: gpio
41+
id: line_out_sensor
42+
pin:
43+
pcm5122:
44+
pin: 4
45+
inverted: false
46+
name: "line-out jack"
47+
icon: "mdi:audio-input-stereo-minijack"
48+
filters:
49+
- delayed_on: 200ms
50+
- delayed_off: 200ms
51+
52+
on_press:
53+
- dac_proxy.activate_line_out:
54+
- lambda: id(jack_plugged_recently) = true;
55+
- script.execute: control_leds
56+
- delay: 200ms
57+
- script.execute:
58+
id: play_sound
59+
priority: false
60+
sound_file: !lambda return id(jack_connected_sound);
61+
- delay: 800ms
62+
- lambda: id(jack_plugged_recently) = false;
63+
- script.execute: control_leds
64+
65+
66+
on_release:
67+
- dac_proxy.activate_speaker:
68+
- lambda: id(jack_unplugged_recently) = true;
69+
- script.execute: control_leds
70+
- delay: 200ms
71+
- script.execute:
72+
id: play_sound
73+
priority: false
74+
sound_file: !lambda return id(jack_disconnected_sound);
75+
- delay: 800ms
76+
- lambda: id(jack_unplugged_recently) = false;
77+
- script.execute: control_leds
78+
779

880
fusb302b:
981
id: pd_fusb302b
@@ -44,9 +116,10 @@ media_player:
44116
sample_rate: 48000
45117
internal: false
46118
speaker:
119+
audio_dac: dac_proxy
47120
volume_increment: 0.05
48-
volume_min: 0.4
49-
volume_max: 0.85
121+
volume_min: 0.1
122+
volume_max: 1.
50123
on_mute:
51124
- script.execute: control_leds
52125
on_unmute:
@@ -92,7 +165,10 @@ media_player:
92165
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/timer_finished.flac
93166
- id: wake_word_triggered_sound
94167
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/wake_word_triggered.flac
95-
168+
- id: jack_connected_sound
169+
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/jack_connected.flac
170+
- id: jack_disconnected_sound
171+
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/jack_disconnected.flac
96172

97173

98174
script:

0 commit comments

Comments
 (0)