M5Stack Atom Speaker Kit

I’m having problems getting any sound out of that device.
My ESPHome config for that device is this:

substitutions:
  name: media-kit-13-a17340
  friendly_name: "M5Stack Atom Speaker Kit"

esphome:
  name: ${name}
  name_add_mac_suffix: false
  project:
    name: m5stack.atom-speaker-kit
    version: "1.0"

esp32:
  board: m5stack-atom
  framework:
    type: arduino

dashboard_import:
  package_import_url: github://esphome/media-players/m5stack-atom-speaker-kit.yaml@main


wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  - ssid: !secret wifi2_ssid
    password: !secret wifi_password
  manual_ip:
    static_ip: IP
    gateway: gateway IP
    subnet: 255.255.255.0
    dns1: dns IP

logger:
api:
ota:
  password: "password123"

captive_portal:

improv_serial:

media_player:
  - platform: i2s_audio
    id: media_out
    name: ${friendly_name}
    dac_type: external
    i2s_lrclk_pin: GPIO21
    i2s_dout_pin: GPIO25
    i2s_bclk_pin: GPIO22
    mode: mono

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO39
      inverted: true
    name: ${friendly_name} Button
    on_click:
      - media_player.toggle: media_out

light:
  - platform: fastled_clockless
    name: ${friendly_name}
    pin: GPIO27
    chipset: SK6812
    num_leds: 1
    rgb_order: grb

this config is pretty much exactly as listed in the repository: https://github.com/esphome/media-players/
the only modifications are wifi settings, static ip and ota password.
I can see the device in ESPhome and in HA, but when I try and play anything there is just silence.
I tried playing mp3 song, jellyfin music (via jellyfin integration), even PicoTTS is silent.
I know that my Pico TTS is working fine because I can “play” text in a web browser but when I change the output to m5Stack Atom Speaker Kit nothing happens ( it does not play as there is no visible progress ).

ESPHome log for that device:

[20:23:12][C][api:138]: API Server:
[20:23:12][C][api:139]:   Address: IP.IP.IP.IP:6053
[20:23:12][C][api:143]:   Using noise encryption: NO
[20:23:12][C][improv_serial:032]: Improv Serial:
[20:23:12][C][audio:135]: Audio:
[20:24:35][D][media_player:059]: 'M5Stack Atom Speaker Kit' - Setting
[20:24:35][D][media_player:066]:   Media URL: https://my.homeassistant.address/api/tts_proxy/0d9d06728960ef753fbcce4c765171c3d97953fd_en-gb_-_picotts.wav
INFO IP.IP.IP.IP: Error while reading incoming messages: Error while reading data: [Errno 104] Connection reset by peer
INFO Disconnected from ESPHome API for IP.IP.IP.IP
WARNING Disconnected from API
INFO IP.IP.IP.IP: Ping Failed: Error while reading data: [Errno 104] Connection reset by peer
WARNING Can't connect to ESPHome API for IP.IP.IP.IP: Error connecting to ('IP.IP.IP.IP', 6053): [Errno 111] Connect call failed ('IP.IP.IP.IP', 6053)
INFO Trying to reconnect to IP.IP.IP.IP in the background
INFO Successfully connected to IP.IP.IP.IP
[20:24:46][D][api:102]: Accepted ::FFFF:C0A8:147
[20:24:47][D][api.connection:861]: Home Assistant 2022.7.1 (::FFFF:C0A8:147): Connected successfully

where IP.IP.IP.IP is the address of the device in question

I am bit lost here - what am I missing?
Any help as usual is greatly appreciated.
Andre

1 Like

I am not 100% but try this. Not sure on your knowledge so I try to explain everything.

replace this

esphome:
  name: ${name}
  name_add_mac_suffix: false
  project:
    name: m5stack.atom-speaker-kit
    version: "1.0"

esp32:
  board: m5stack-atom
  framework:
    type: arduino

with this

esphome:
  name: ${name}
  name_add_mac_suffix: false
  project:
    name: m5stack.atom-speaker-kit
    version: "1.0"
  platform: ESP32
  board: m5stack-core-esp32

I think your using a Atom Lite? Your code may work so you could skip this change above.

For your IP - Try this

remove this

  manual_ip:
    static_ip: IP
    gateway: gateway IP
    subnet: 255.255.255.0
    dns1: dns IP

and you have to put in your static ip replacing the ? like 192.168.1.30 and your gateway like 192.168.1.1 but I don’t know your IP and gateway. “dns1” you could add it in but ??? its a ESP32 if your just have to use one, you have to add one like “1.1.1.1” or “8.8.8.8” or find the one you like and it would look like this “dns1: 1.1.1.1”. I put a “#” before it, just remove it.

## Optional manual - Static IP
  manual_ip:
    static_ip: ?.?.?.?
    gateway: ?.?.?.?
    subnet: 255.255.255.0
#    dsn1: 1.1.1.1

if you not sure just put in this

## Optional manual - Static IP
#  manual_ip:
#    static_ip: ?.?.?.?
#    gateway: ?.?.?.?
#    subnet: 255.255.255.0
#    dsn1: 1.1.1.1

when you get the hang of it you can just remove the “#” and put your correct information in. I normally use the router to control static ip address but each to their own (up to you). If you don’t add one in it is ok, your router will allocate you one but it will change in the back ground from time to time and that’s ok to.

I would also sugest putting a password for your “api” but you don’t have to.

Replace this

logger:
api:
ota:
  password: "password123"

with this

logger:
# Enable Home Assistant API
api:
  password: !secret esphome_secret
# Over The Air Password (Stops someone on your network accessing files)
ota:
  password: "password123"

you will then have to add the password to your secrets.yaml file

add this to your secrets.yaml file. Same place you put your other password in for your wifi "
!secret wifi_password"

# ESP Home
esphome_secret: your_password_here_make_one_up

the first time you add the device you will need to enter this password and then your good to go

I use the same password for the API & OTA. so this

ota:
  password: "password123"

looks like this

ota:
  password: !secret esphome_secret

but it is up to you. “password123” is easy to hack.

once done install

hope this helps

1 Like

Hi Blacky,
consolidating the esphome: and esp32: sections did the trick - that tiny little box is now alive
(all I need to do now is to figure out why is the rgb led light randomly changes colour when I on/off the button in HA but I can live with that for the time being)

Sorry for intrusion but how did you power the device ? I have powered mine with an usual USB cable I use to charge my phone and power some other ESP but with that device it started to become extremely hot and I had to unplug it before it burnt by itself or die for ever :frowning:

Hi Vincen,
I used the usb cable that was provided with the device to put the code on it and now for over 24h it is running connected to a mobile phone usb cable - when touched it is just very slightly warm.

Thanks for confirmation so looks like mine is defective ! I just tried again with USB cable supplied and after one minute it started to become very hot :frowning: It also emits all the time a fuzzy noise :confused: will contact manufacturer…

omg, I just got mine in the mail too. I flashed it using the ESPHome Media Players webpage and it’s doing the same thing. I noticed it was very hot and I sniff it and it smells like burnt electronics. :frowning: It also buzzes when plugged in and powered up… I think some of these might be defective.

1 Like

@SpikeyGG just to rule out that it is something in software could you try to flash like a “dummy” esphome (without media player platform)

Was that even without firmware flashed? That would indeed indicate a DOA.

I’m not sure I understand what you mean. The device is flashable, it comes up, connects to the network just fine. I can see all the debug log detail and according to that, everything is working. I can even connect to it with my Home Assistant and send it things to play! However, even though Home Assistant says that it’s playing, nothing comes out of the speaker. The play duration seems to align to the length of the media file as well so I think it thinks it is playing even though nothing is coming out.

It can be possible if for example wrong gpio’s are used that a device shows anomalies.

My idea was just to flash like a esphome (yaml without the media player platform and that pins not used) to rule out that something from the firmware causing the heat. Another possibility would also just to erase the flash and then to check if it still is overheating (with no firmware) because than it’s 100% a hardware fault.

You should be able to flash a “dummy” (to “adopt”) directly from https://web.esphome.io/ without configuring any yaml.

1 Like

Ah! Gotcha, I didn’t know you could do the “adoptable” flash. That’s pretty neat! I just did it to the device that got hot and smelled. To your point, after the flash it stopped making the buzz noise and it’s very quiet now. I can see the adoptable SSID in my wireless networks list. It is warm but it seems to not be getting as hot as it did when I had it flashed with the ESPHome flash directly from the ESPHome Media Players page. I’ll leave it plugged in for a while and see how hot it gets but this is a good sign.

1 Like

Okay, I flashed it manually with a slightly hacked version of what @alfwro13 posted and it booted up, connected and now it’s working but OMG is it quiet. I’m guessing the amp is fried on this unit or something because at 100% volume it’s quieter than a whispering voice which makes it basically worthless for a speaker that’s supposed to get your attention.

1 Like

So the noise was then from the DAC/AMP that is only “active” when configured in esphome.

Good change, but I would expect they have a faulty batch/unit were the DAC/AMP hardware is to blame.

You mentioned you have another one without problem? Same batch?

I bought three of these. The first one that got real hot is quieter than the other two but after flashing all three of them with the custom ESPHome yaml, they are all VERY quiet. It’s like the amp is disabled or something. I can control the volume in Home Assistant and it does get quieter but the 100% volume is basically a very quiet whisper. Is there YAML I need to include to enable/turn-on the amp?

I’m using this:

media_player:
  - platform: i2s_audio
    id: media_out
    name: ${friendly_name}
    dac_type: external
    i2s_lrclk_pin: GPIO33
    i2s_dout_pin: GPIO22
    i2s_bclk_pin: GPIO19
    mode: mono

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO39
      inverted: true
    name: ${friendly_name} Button
    on_click:
      - media_player.toggle: media_out

light:
  - platform: fastled_clockless
    name: ${friendly_name}
    pin: GPIO27
    chipset: SK6812
    num_leds: 1
    rgb_order: grb

it seems that the I²S Audio Media Player — ESPHome docs show that this means external DAC is employed. Is this also the AMP? Maybe it’s just not loud at all but it seems pretty worthless if this is expected output level.

That could be it. Did you see the “let’s get loud” stream? @jesserockz mentioned that these device are not really suitable to play any kind of music

Yeah, I did. In fact, I bought these after watching that stream and figured they’d be good for voice announcements. But now that I’ve heard them I think they’re not useful on their own.

You must have amplified speakers to drive if you plan to use it for anything.

2 Likes

The “M5Stack Atom Speaker Kit” I have is good enough for TTS announcements - unless your household is very noisy.

1 Like

Has either of you tried this:

Maybe @Romkabouter (hope you don’t mind tagging you :slight_smile: ) could help out here, as he seems to have a deeper knowledge about these or at least some experience with these devices.

Well, I tried it because I’ve programmed it :smiley:

4 Likes

I’ve been playing with my device and text to speech (PicoTTS and MaryTTS) and I have to say I am deeply disappointed so far. The output is often missing parts of words, if you keep playing the same thing it will eventually play it correctly. I know that there is no issues with my TTS setup because when I select my Web Browser as the output the playback is fine.
Strange is that when I play mp3 tracks it seems to play them fine so perhaps I have to ditch the idea of using TTS and just pre-record stuff but that creates whole bunch of unnecessary work.

Did anyone managed to get decent playback from those devices?