새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사


● esphome 으로 media_player: voice_assistant: 구성정보 로 PCM5102 & INMP441 연결정보 테스트

♨ 카랜더 일정 : 2024년10월26일
  • 링크

  • 첨부

  • 컨텐츠 정보

    본문

    ● esphome 으로  media_player: voice_assistant: 구성정보 로 PCM5102 &  INMP441 연결 테스트

    결론 : PCM5102 &  INMP441 연결 테스트 는 동작하지 않음 mic는  구성 불가능 합니다

    https://gist.github.com/EverythingSmartHome/055fbdde31a607ef9d695d5cac780e94

    https://forum.arduino.cc/t/chinese-esp32-s3-5v-pin-warning/1192758

    3232235521_1729916754.5461.png

    PCM5102 로 메디아플레어 구성 만 제대로 동작  합니다

    >> yaml 소스

    api:
      encryption:
        key: "JbEQaa0EAwKx8Iuo8l185+0WSrxlLRCD2ycvHlowbQ4="

    ota:
      - platform: esphome
        password: "632c169d26a13c712122705f5dc423e7"

    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
      power_save_mode: LIGHT  
      # power_save_mode: none
      manual_ip:
        static_ip: 192.168.0.54
        gateway: 192.168.0.1
        subnet: 255.255.255.0
        dns1: 8.8.8.8
        dns2: 8.8.4.4
      # Enable fallback hotspot (captive portal) in case wifi connection fails  192.168.0.54
      ap:
        ssid: "Esp32-S3-M1 Fallback Hotspot"
        password: "Pn5Z1pGZemwR"
     
    substitutions:
      name: "pcm5102-esp32-ip54"
      friendly_name: "pcm5102_media_player_ip54"
      device_descrnption: "esp32-s3-devkitc-1_media_player pcm5102 ip54"

    esphome:
      name: ${name}
      comment: ${device_descrnption}
      friendly_name: ${friendly_name}
      on_boot:
         - priority: -100
           then:
             - wait_until: api.connected
             - delay: 1s
             - if:
                 condition:
                   switch.is_on: use_wake_word
                 then:
                   - voice_assistant.start_continuous:

    esp32:
      board: esp32-s3-devkitc-1
      framework:
        type: arduino
      flash_size: 8MB
      partitions: "default_8MB.csv"      

    psram:
      mode: octal
      speed: 80MHz

    logger:
      level: DEBUG

    captive_portal:



    binary_sensor:
      - platform: status
        name: "Connection Status"



    text_sensor:
      - platform: version
        name: "ESPHome Version"
        id: ESPHome_Version_no

      - platform: wifi_info
        ip_address:
          name: "Address"
          id: ip
        ssid:
          name: "SSID "
        mac_address:
          name: "Mac "
      - platform: template
        name: "Uptime "
        update_interval: 60s
        lambda: |-
          auto s = millis() / 1000;
          return str_snprintf("%02d:%02d:%02d:%02d", 11, s / 86400, s / 3600 % 24, s / 60 % 60, s % 60);      

    sensor:
      - platform: uptime
        name: Uptime Sensor    

      - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
        name: "WiFi Signal dB"
        id: wifi_signal_db
        update_interval: 60s
        entity_category: "diagnostic"

      - platform: copy # Reports the WiFi signal strength in %
        source_id: wifi_signal_db
        name: "WiFi Signal Percent"
        filters:
          - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
        unit_of_measurement: "Signal %"
        entity_category: "diagnostic"
        device_class: ""

    # =================================================================
    #  inmp441 마이크 포기하세요
    # =================================================================

    # # Connection esp32: inmp441
    # # ws  >> gpio16
    # # sck >> gpio15
    # # sd  >> gpio14
    # # l/r >> gnd 13
    # # gnd >> gnd
    # # vdd >> vdd 3,3

    # i2s_audio:
    #   i2s_lrclk_pin: GPIO16 #ws
    #   i2s_bclk_pin: GPIO15 #sck

    # microphone:
    #   - platform: i2s_audio
    #     id: echo_microphone
    #     i2s_din_pin: GPIO14 #sd
    #     adc_type: external
    #     pdm: false
    #     on_data:
    #       - logger.log:
    #           format: "Received %d bytes"
    #           args: ['x.size()']
    # # GPIO13 as a switch
    # switch:
    #   - platform: gpio
    #     name: "GPIO13 l/r GND Switch"
    #     pin: GPIO13

    # =================================================================
    # media_player 기능만 됩니다
    # =================================================================


    i2s_audio:
      id: i2s_out
      i2s_lrclk_pin: GPIO9   # 출력 LRCLK 핀
      i2s_bclk_pin: GPIO8    # 출력 BCLK 핀
      # i2s_lrclk_pin: GPIO16   # 출력 LRCLK 핀
      # i2s_bclk_pin: GPIO15    # 출력 BCLK 핀

    microphone:
      - platform: i2s_audio
        id: mic
        adc_type: external
        i2s_din_pin: GPIO14
        pdm: false

    voice_assistant:
      microphone: mic
      use_wake_word: true  # 음성 호출 기능 활성화
      noise_suppression_level: 2
      auto_gain: 31dBFS
      volume_multiplier: 2.0
      id: assist

    media_player:
      - platform: i2s_audio
        name: "esphome_speaker5_stereo"
        id: media_player_5
        dac_type: external
        i2s_dout_pin: GPIO7
        mode: stereo
        on_pause:
          - media_player.stop: media_player_5
        on_play:
          - switch.turn_on: play_switch5
        on_idle:
          - switch.turn_off: play_switch5

    switch:
      - platform: template
        name: "Use Wake Word"
        id: use_wake_word
        optimistic: true
        restore_mode: RESTORE_DEFAULT_ON
        entity_category: config
        on_turn_on:
          - lambda: |-
              id(assist).set_use_wake_word(true);
          - if:
              condition:
                not:
                  voice_assistant.is_running
              then:
                - voice_assistant.start_continuous
        on_turn_off:
          - voice_assistant.stop
          - lambda: |-
              id(assist).set_use_wake_word(false);

    # -------------------------------------- 2024_1026_0129_36
    # switch:
      # 스위치 방법1 gpio
      - platform: gpio
        name: "MP3 Michael_Jackson-BillieJean"
        pin: GPIO40  # 스위치에 연결된 GPIO 핀 (필요에 따라 변경)
        id: play_switch1
        on_turn_on:
             - media_player.play_media:
                id: media_player_5
                media_url: "http://192.168.0.35:8123/local/media/Michael_Jackson-BillieJean.mp3"
        on_turn_off:
         
            - media_player.stop: media_player_5

     
      - platform: gpio
        name: "MP3 005.SpiceGirls-Wannabe"
        pin: GPIO41
        id: mp3_play_switch3
     
        on_turn_on:
          - media_player.play_media:
              id: media_player_5
              media_url: "http://192.168.0.35:8123/local/media/005.SpiceGirls-Wannabe.mp3"

        on_turn_off:  
          - media_player.stop: media_player_5

    # switch:
      - platform: gpio
        name: "media_player_status_GPIO2"
        pin: GPIO2
        id: play_switch5
        on_turn_on:
          - media_player.play: media_player_5
        on_turn_off:
          - media_player.stop: media_player_5

      - platform: restart
        name: "Restart Node"#

    # -------------------
    light:

    # Onboard LED configuration 동작하니 않음
      - platform: esp32_rmt_led_strip
        id: led_ww
        rgb_order: GRB
        pin: GPIO48
        num_leds: 1
        rmt_channel: 0
        chipset: ws2812
        name: "on board light48"          

    # end 2024_1026_1701_56  


    ☞ https://11q.kr 에 등록된 자료 입니다. ♠ 정보찾아 공유 드리며 출처는 링크 참조 바랍니다♠1.png

    [ 추가 정보 ... 더보기) ]
    뷰PDF 1,2



    office view

    관련자료

    댓글목록

    등록된 댓글이 없습니다.


    새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-11-22 14:30:54

    오늘의 홈 현황


    • 현재 접속자♨ 375 명
    • 오늘 가입자※ 1 명
    • 어제 가입자※ 3 명
    • 주간 가입자※ 9 명
    • 오늘 방문자 2,330 명
    • 어제 방문자 3,272 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,801,486 명
    • 전체 게시물※ 8,855 개
    • 전체 댓글수※ 25,230 개
    • 전체 회원수 11,325 명

    QR코드


    ☞ QR코드 스캔은 kakao앱 자체 QR코드

    알림 0








    최신글↑