Esphome and esp32 lyrat 4.3 possible?

Hi,

I have a esp32 LyraT 4.3 dev board here. Is it possible to use it with esphome as a media_player? Maybe someone could share their config?

I have been unable to get it to work so far.

1 Like

It is a little annoying when people refer to some new device without even a link.

That doesn’t sound very friendly :slightly_frowning_face:

https://espressif-docs.readthedocs-hosted.com/projects/esp-adf/en/latest/design-guide/dev-boards/board-esp32-lyrat-v4.3.html

I didn’t put a link here as people without any hands-on experience with the device won’t be able to help much…

Have you seen this? ESPHome 2022.6.0 - 15th June 2022 — ESPHome. It refers to i2s audio, although whether it is compatible, I dunno.

Anyway, thanks for the pointer. It is an interesting looking series of devices.

EDIT: Lol, I guess you are the Michel from espthings.io, and as you just posted about that changelog, I guess you have seen it.

Oh and I wasn’t trying to be unfriendly. I just like to look at interesting devices, and your post just came along while I was passing. Yours wasn’t the only one, just the one I fell across.

Guilty as charged :wink:

Sofar I have been unable to get the new media_player component to work on this particular DEV board.

A little more detail:

substitutions:
  devicename: esp32-lyrat
  long_devicename: esp32 lyraT DEV board

esp32:
  board: esp-wrover-kit
    
esphome:
  name: $devicename
  comment: $long_devicename

wifi:
  ssid: !secret esphome_wifi_ssid
  password: !secret esphome_wifi_password
  ap:
    ssid: "$devicename Fallback Hotspot"
    password: !secret esphome_ap_password

captive_portal:

web_server:
  port: 80
  version: 2

logger:
  level: VERBOSE

api:
  password: !secret esphome_api_password

ota:
  password: !secret esphome_ota_password
  
media_player:
  - platform: i2s_audio
    name: ESPHome I2S Media Player
    dac_type: external
    i2s_lrclk_pin: GPIO15
    i2s_dout_pin: GPIO26
    i2s_bclk_pin: GPIO5
    mode: mono

switch:
  - platform: gpio
    pin: GPIO21
    name: "Enable output"    
[07:23:10][I][app:102]: ESPHome version 2022.6.0 compiled on Jun 18 2022, 07:22:30
[07:23:10][C][wifi:491]: WiFi:
[07:23:10][C][wifi:353]:   Local MAC: 7C:87:CE:CC:ED:20
[07:23:10][C][wifi:354]:   SSID: [redacted]
[07:23:10][C][wifi:355]:   IP Address: 192.168.100.112
[07:23:10][C][wifi:357]:   BSSID: [redacted]
[07:23:10][C][wifi:358]:   Hostname: 'esp32-lyrat'
[07:23:10][C][wifi:360]:   Signal strength: -63 dB ▂▄▆█
[07:23:10][V][wifi:362]:   Priority: 0.0
[07:23:10][C][wifi:364]:   Channel: 1
[07:23:10][C][wifi:365]:   Subnet: 255.255.255.0
[07:23:10][C][wifi:366]:   Gateway: 192.168.100.1
[07:23:10][C][wifi:367]:   DNS1: 192.168.100.1
[07:23:10][C][wifi:368]:   DNS2: 0.0.0.0
[07:23:10][C][logger:275]: Logger:
[07:23:10][C][logger:276]:   Level: VERBOSE
[07:23:10][C][logger:277]:   Log Baud Rate: 115200
[07:23:10][C][logger:278]:   Hardware UART: UART0
[07:23:10][C][switch.gpio:050]: GPIO Switch 'Enable output'
[07:23:10][C][switch.gpio:051]:   Pin: GPIO21
[07:23:10][C][switch.gpio:073]:   Restore Mode: Restore (Defaults to OFF)
[07:23:10][C][captive_portal:088]: Captive Portal:
[07:23:10][C][web_server:125]: Web Server:
[07:23:10][C][web_server:126]:   Address: esp32-lyrat.local:80
[07:23:10][C][mdns:084]: mDNS:
[07:23:10][C][mdns:085]:   Hostname: esp32-lyrat
[07:23:10][V][mdns:086]:   Services:
[07:23:10][V][mdns:088]:   - _esphomelib, _tcp, 6053
[07:23:10][V][mdns:090]:     TXT: version = 2022.6.0
[07:23:10][V][mdns:090]:     TXT: mac = 7c87cecced20
[07:23:10][V][mdns:090]:     TXT: platform = ESP32
[07:23:10][V][mdns:090]:     TXT: board = esp-wrover-kit
[07:23:10][C][ota:085]: Over-The-Air Updates:
[07:23:10][C][ota:086]:   Address: esp32-lyrat.local:3232
[07:23:10][C][ota:089]:   Using Password.
[07:23:10][C][api:138]: API Server:
[07:23:10][C][api:139]:   Address: esp32-lyrat.local:6053
[07:23:10][C][api:143]:   Using noise encryption: NO
[07:23:10][C][audio:131]: Audio:
[07:23:46][D][switch:013]: 'Enable output' Turning ON.
[07:23:46][D][switch:037]: 'Enable output': Sending state ON
[07:23:46][V][json:031]: Attempting to allocate 512 bytes for JSON serialization
[07:23:46][V][json:051]: Size after shrink 72 bytes
[07:23:49][D][media_player:059]: 'ESPHome I2S Media Player' - Setting
[07:23:49][D][media_player:063]:   Command: PLAY
[07:23:54][D][media_player:059]: 'ESPHome I2S Media Player' - Setting
[07:23:54][D][media_player:066]:   Media URL: https://xxxxxxxxxxxxxxxxxxxx:8123/media/local/0004%20-%20Enter.mp3?authSig=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI2ZmVhMDQ1NWMyZmQ0ODViYmQ4MDE0MDBhYmQxNDc0NyIsInBhdGgiOiIvbWVkaWEvbG9jYWwvMDAwNCAtIEVudGVyLm1wMyIsImlhdCI6MTY1NTUyOTgzNCwiZXhwIjoxNjU1NjE2MjM0fQ.6aXzt4ORSkyzb7ZxeEZClPaYL3tpzk4mI8SmeJEw6Ds

When playing there is no audio.

1 Like

I have got my ESP32-Lyrat working with the following configuration. I believe the missing element was the ES8388 component - and LRCLK on my board is GPIO25 rather than 15.

YAML
esphome:

  name: lyrat-2

esp32:

  board: esp-wrover-kit

  framework:

    type: arduino

esp32_touch:

  setup_mode: True

  iir_filter: 10ms

# Enable logging

logger:

  level: VERBOSE

# Enable Home Assistant API

api:

  encryption:

    key: XXX

ota:

  password: XXX

wifi:

  ssid: !secret wifi_ssid

  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails

  ap:

    ssid: XXX

    password: XXX

captive_portal:

i2c:

  sda: GPIO18

  scl: GPIO23

external_components:

  - source: github://pr#3552

    components: [es8388]

    refresh: 0s

es8388:

media_player:

  - platform: i2s_audio

    name: ESPHome I2S Media Player

    dac_type: external

    i2s_lrclk_pin: GPIO25

    i2s_dout_pin: GPIO26

    i2s_bclk_pin: GPIO5

    mode: stereo

switch:

  - platform: gpio

    pin: GPIO21

    name: "AMP Switch"

    id: amp_switch

    restore_mode: ALWAYS_ON

binary_sensor:

  - platform: esp32_touch

    pin: GPIO33

    threshold: 1000

    name: "Lyrat 2 - Play"

  - platform: esp32_touch

    pin: GPIO32

    threshold: 1000

    name: "Lyrat 2 - Set"

  - platform: esp32_touch

    pin: GPIO27

    threshold: 1000

    name: "Lyrat 2 - Vol Up"

  - platform: esp32_touch

    pin: GPIO13

    threshold: 600

    name: "Lyrat 2 - Vol Down"

  - platform: gpio

    pin:

      number: GPIO19

      inverted: true

      mode:

        input: true

    name: "Lyrat 2 - Headphone Status"

  - platform: gpio

    pin:

      number: GPIO12

      inverted: false

      mode:

        input: true

    name: "Lyrat 2 - Aux Input"

Did anyone have any luck using ESPHome with this board, since the audio support update?

Got it and would like to use it for voice assistant. Managed to configure it as ESPHome with working microphone. Assist works but I have to manually press Rec button. Any hints how to enable Wake word on this device?

Did anyone got the REC and MODE buttons configured on the LyraT 4.3?

It uses the SENSOR_VP and SENSOR_VN pin, but I don’t have any idea on how to create a configuration that uses these pins

Hey @surfek would you mind sharing your yaml/config for this?

If would be helpful

sensor:
  - platform: adc
    id: sensor_vp 
    pin: 36
    name: "SENSOR_VP"
    update_interval: 1s
  - platform: adc
    id: sensor_vn
    pin: 39
    name: "SENSOR_VN"
    update_interval: 1s

On press:
[V][adc:148]: ‘SENSOR_VN’: Got voltage=0.0750V
[V][sensor:043]: ‘SENSOR_VN’: Received new state 0.075000
[D][sensor:094]: ‘SENSOR_VN’: Sending state 0.07500 V with 2 decimals of accuracy

On release:
[V][adc:148]: ‘SENSOR_VN’: Got voltage=1.0390V
[V][sensor:043]: ‘SENSOR_VN’: Received new state 1.039000
[D][sensor:094]: ‘SENSOR_VN’: Sending state 1.03900 V with 2 decimals of accuracy

Result is the same for SENSOR_VP

Regards,
Jeff