Skip to content

Commit

Permalink
Prepare release v.0.1.0 (#229)
Browse files Browse the repository at this point in the history
* - 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>
  • Loading branch information
3 people authored Jan 21, 2025
1 parent bf97c1d commit 2a83952
Show file tree
Hide file tree
Showing 30 changed files with 1,159 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
files: |
config/satellite1.factory.yaml
esphome-version: 2024.11.2
esphome-version: 2024.12.2
release-summary: develop-branch
release-url:
release-version:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
with:
files: |
config/satellite1.factory.yaml
esphome-version: 2024.11.2
esphome-version: 2024.12.2
release-version: ${{ needs.prepare.outputs.next_tag }}

push-tag:
Expand Down
9 changes: 0 additions & 9 deletions config/common/buttons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ event:


binary_sensor:
- platform: gpio
id: line_out_sensor
pin:
pcm5122:
pin: 4
inverted: false
name: "line-out jack"
icon: "mdi:audio-input-stereo-minijack"

- platform: gpio
id: btn_up
pin:
Expand Down
9 changes: 9 additions & 0 deletions config/common/components.external.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
substitutions:
ext_comp_repo_ref: develop

external_components:
- source:
type: git
url: https://github.com/FutureProofHomes/Satellite1-ESPHome
ref: ${ext_comp_repo_ref}
components: [ i2s_audio, satellite1, memory_flasher, tas2780, pcm5122, fusb302b ]
9 changes: 9 additions & 0 deletions config/common/core_board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,19 @@ esp32:
CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY: "n"
CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1: "y"

CONFIG_LWIP_TCP_MSS: "1460"
CONFIG_LWIP_TCP_WND_DEFAULT: "35040"
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP: "y"

CONFIG_LWIP_TCPIP_RECVMBOX_SIZE: "32"
CONFIG_LWIP_TCP_RECVMBOX_SIZE: "26"
CONFIG_LWIP_UDP_RECVMBOX_SIZE: "6"

CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM: "16"
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM: "512"

CONFIG_ESP32_WIFI_RX_BA_WIN: "32" # = min(2*STATIC_RX_BUFFER_NUM, DYNAMIC_RX_BUFFER_NUM)

# BT
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST: "y"
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY: "y"
Expand Down
15 changes: 8 additions & 7 deletions config/common/debug.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

external_components:
- source:
type: local
path: ../esphome/components
components: [ version ]

debug:
update_interval: 5s

# # 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
# mqtt:
# broker: homeassistant.local
# port: 1883
# username: <mqtt_username_here>
# password: <mqtt_password_here>
# # topic_prefix: <set_this_if_you_are_logging_multiple_satellite1_devices>

text_sensor:
- platform: debug
device:
Expand Down
71 changes: 71 additions & 0 deletions config/common/developer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This is a developer configuration that enables the UDP stream component and adds switches to toggle between the ASR and Comm microphones.
# You can read more about how to use this configuration here: https://github.com/FutureProofHomes/Satellite1-ESPHome/tree/develop/tests/mic_streaming

external_components:
- source:
type: git
url: https://github.com/FutureProofHomes/Satellite1-ESPHome
ref: develop
components: [ udp_stream ]


# Separate UDP Stream configurations for each microphone
udp_stream:
id: udp_streamer
microphone: asr_mic # Default microphone to prevent validation errors


# Switches to toggle between ASR and Comm microphones
switch:
- platform: template
name: "UDP Stream ASR Mic"
entity_category: "diagnostic"
id: use_asr_mic
icon: mdi:microphone
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
on_turn_on:
- logger.log: "Switching to ASR Mic for UDP stream"
- lambda: |-
if (id(udp_streamer).is_running()) {
id(udp_streamer).request_stop(); // Stop current stream
delay(500); // Wait for stream to stop
}
id(udp_streamer).set_microphone(id(asr_mic)); // Set ASR mic
id(udp_streamer).request_start(true); // Start stream with ASR mic
- switch.turn_off: use_comm_mic # Turn off the other switch

on_turn_off:
- logger.log: "Turning off ASR Mic UDP stream"
- lambda: |-
if (id(udp_streamer).is_running()) {
id(udp_streamer).request_stop(); // Stop the stream when ASR mic is turned off
}
- platform: template
name: "UDP Stream Comm Mic"
entity_category: "diagnostic"
id: use_comm_mic
icon: mdi:microphone
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
on_turn_on:
- logger.log: "Switching to Comm Mic for UDP stream"
- micro_wake_word.stop:
- delay: 500ms
- lambda: |-
if (id(udp_streamer).is_running()) {
id(udp_streamer).request_stop(); // Stop current stream
delay(500); // Wait for stream to stop
}
id(udp_streamer).set_microphone(id(comm_mic)); // Set Comm mic
id(udp_streamer).request_start(true); // Start stream with Comm mic
- switch.turn_off: use_asr_mic # Turn off the other switch

on_turn_off:
- logger.log: "Turning off Comm Mic UDP stream"
- lambda: |-
if (id(udp_streamer).is_running()) {
id(udp_streamer).request_stop(); // Stop the stream when Comm mic is turned off
}
- delay: 500ms
- micro_wake_word.start:
14 changes: 14 additions & 0 deletions config/common/led_ring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ globals:
type: int
restore_value: no
initial_value: '0'
# Global variable tracking if the jack has been plugged touched.
- id: jack_plugged_recently
type: bool
restore_value: no
initial_value: 'false'
# Global variable tracking if the jack has been unplugged touched.
- id: jack_unplugged_recently
type: bool
restore_value: no
initial_value: 'false'

light:
# Hardware LED ring. Not used because remapping needed
Expand Down Expand Up @@ -520,6 +530,10 @@ script:
id(control_leds_volume_buttons_touched).execute();
} else if (id(btn_action).state) {
id(control_leds_action_button_touched).execute();
} else if (id(jack_plugged_recently)) {
id(control_leds_jack_plugged_recently).execute();
} else if (id(jack_unplugged_recently)) {
id(control_leds_jack_unplugged_recently).execute();
} else if (id(warning)) {
id(control_leds_warning).execute();
} else if (id(timer_ringing).state) {
Expand Down
82 changes: 79 additions & 3 deletions config/common/media_player.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,81 @@

audio_dac:
- platform: pcm5122
id: line_out_dac
address: 0x4D
- platform: tas2780
id: speaker_dac
address: 0x3F
- platform: satellite1
id: dac_proxy
speaker_dac: speaker_dac
line_out_dac: line_out_dac

on_speaker_activated:
# if speaker was used previously but is not available try line-out
- lambda: |
if( id(line_out_sensor).state && id(pd_fusb302b).contract_voltage < 9 ){
id(dac_proxy).activate_line_out();
}
on_line_out_activated:
# if line_out was used previously but is not available try speaker
- lambda: |
if( !id(line_out_sensor).state && id(pd_fusb302b).contract_voltage >= 9 ){
id(dac_proxy).activate_speaker();
}
on_state_change:
- media_player.volume_set:
volume: !lambda return id(dac_proxy).volume();
- lambda: |
if( id(dac_proxy).is_muted() ){
id(nabu_media_player)->make_call()
.set_command(MEDIA_PLAYER_COMMAND_MUTE)
.perform();
}
binary_sensor:
- platform: gpio
id: line_out_sensor
pin:
pcm5122:
pin: 4
inverted: false
name: "line-out jack"
icon: "mdi:audio-input-stereo-minijack"
filters:
- delayed_on: 200ms
- delayed_off: 200ms

on_press:
- dac_proxy.activate_line_out:
- lambda: id(jack_plugged_recently) = true;
- script.execute: control_leds
- delay: 200ms
- script.execute:
id: play_sound
priority: false
sound_file: !lambda return id(jack_connected_sound);
- delay: 800ms
- lambda: id(jack_plugged_recently) = false;
- script.execute: control_leds


on_release:
- dac_proxy.activate_speaker:
- lambda: id(jack_unplugged_recently) = true;
- script.execute: control_leds
- delay: 200ms
- script.execute:
id: play_sound
priority: false
sound_file: !lambda return id(jack_disconnected_sound);
- delay: 800ms
- lambda: id(jack_unplugged_recently) = false;
- script.execute: control_leds


fusb302b:
id: pd_fusb302b
Expand Down Expand Up @@ -44,9 +116,10 @@ media_player:
sample_rate: 48000
internal: false
speaker:
audio_dac: dac_proxy
volume_increment: 0.05
volume_min: 0.4
volume_max: 0.85
volume_min: 0.1
volume_max: 1.
on_mute:
- script.execute: control_leds
on_unmute:
Expand Down Expand Up @@ -92,7 +165,10 @@ media_player:
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/timer_finished.flac
- id: wake_word_triggered_sound
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/wake_word_triggered.flac

- id: jack_connected_sound
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/jack_connected.flac
- id: jack_disconnected_sound
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/jack_disconnected.flac


script:
Expand Down
Loading

0 comments on commit 2a83952

Please sign in to comment.