Music assistant - esp32 running squeezelite sends music to bluetooth speaker

Hi All,

This is a quick writeup to do exactly what the title says. I wasn’t able to find a full explainer for the whole process, so i’ve had to piece together Github info, reddit info, & HA community info, and am providing it all here in hopes it helps someone interested in the same use case to get through the whole process.

I started this process looking for an open-source version of syncing up speakers in several rooms (like sonos). I’ve used both the ESP32 WROVER (not wroom) for bluetooth speakers and the ESP32 AIS with a headphone out jack (and bluetooth) for various speakers. I’m streaming my own mp3’s from a NAS through the house. (NAS setup, MA setup, etc. not included here, this is just for the esp32 hardware)

Instructions:
install the music assistant add-on to home assistant and purchase an esp32-a1s and/or an esp32wrover
connect usb to uart usb port
flash an esp32-a1s OR esp32 wrover with
squeezelite esp32 installer

follow “software configuration” at the bottom of this page
squeezelite software config

Setup WiFi
Boot the esp, look for a new wifi access point showing up and connect to it. Default build ssid and passwords are “squeezelite”/“squeezelite”.
Once connected, navigate to 192.168.4.1 (if connecting from laptop, it’ll open a new tab automatically)
Wait for the list of access points visible from the device to populate in the web page.
Choose an access point and enter any credential as needed
Once connection is established, note down the address the device received (also in bottom right corner); this is the address you will use to configure it going forward

my own instructions below

optional: set a dhcp reservation for the local IP
go to that address in new browser tab

Under Audio; Set the player name
(I2S Dac radio button should be selected for headphone jack)
(or select bluetooth for a bluetooth speaker)
add the server and NO port to the “audio” tab under “server”
192.168.1.200 is my home assistant / music assistant local IP
save and then apply
at the bottom, there’s a button to exit the recovery mode.

then (for the a1s only), on the “hardware” tab, select “ESP32 A1S V.2. variant 1” and hit save and then apply
the esp will restart. the wroom may need to be restarted more than once

in music assistant, enable “squeezelite slimproto players” in player providers- only need to do this once
the player will now appear in home assistant

for a bluetooth audio output, in audio, select bluetooth radio button, and then at the bottom, click on a device in “bluetooth audio device name” for a dropdown list of available bluetooth devices

for esp wroom i had trouble with the stream quality.
my solution for this aspect (which may be specific to my network)
in home assistant, go to player properties. advanced settings. scroll down to output codec to use for streaming audio to the player
select MP3

2 Likes

Hi, thank you for this writeup. I tried with with my ESP32-WROOM, and after flashing, it never starts up its own Wifi (squeezelite) because it sees no PSRAM. So I’m thinking this doesn’t work on all ESP32-WROOM boards?

Yes, you’re correct. it’s only the ESP32-WROVER boards that will run after flashing. (it explicitly says this on the flashing page, i just mixed them up). I’ll edit my post.

1 Like

Would it work for an ESP32-S3-WROOM-1 board or another with 8MB PSRAM? Only looking to stream to a BT speaker from HA via Squeezelite (radio, NAS-music, possibly Spotify, and announcements from HA), so the A1S is slightly overkill, and the Luxe, while lovely, is a bit out of my price range!

It seems possible. the “supported hardware” section of the github page for squeezelite-esp is copied here and linked below

Raw WROOM esp32-s3 module

The esp32-s3 based modules like this are also supported but requires esp-idf 4.4. It is not yet part of official releases, but it compiles & runs. The s3 does not have bluetooth audio. Note that CPU performances are greatly enhanced.

https://github.com/sle118/squeezelite-esp32?tab=readme-ov-file#supported-hardware

i’m a big fan of LMS and squeezelite players for years but now that we got sendspin they seem kinda obsolete and slowly started to change mine to sendspin firmware

and now we are not limited to wrover modules though they do work so all existing squeezelite’s CAN be used again :+1:

here is basic yaml for most of them: RealDeco’s gists · GitHub

Does it support Bluetooth speakers now? I was under the impression it doesn’t, and you need DAC and a (passive) speaker.

no it does not support bluetooth which i also see as the last resort for music streaming in the home. If BT is your favorite way then there is much better BT recievers than what we got with squeezelite, i mean it works but it’s not great :man_shrugging:t3:

But this whole thread is about playing to a Bluetooth speaker…

It does with this setup:

Thanks for introducing this sendspin setup/client here. I handn’t looked into it much because, as @Fanful had mentioned, my use case for about half of my squeezelites is specifically with bluetooth, where wired connections just weren’t a great option. (e.g. waterproof bluetooth speaker in shower, bluetooth speaker in shed about 100 feet away from router & pi running home assistant). general setup is wifi to the esp, and then the last couple feet to the bluetooth speaker that i can take off the charger and place where i want it (i have a few different Anker soundcore speakers that I like)

If the docker container supporting bluetooth for sendspin is a viable client, i may look into it. But I do have 5 squeezelite clients that have been working nicely since I posted this, and I do tend to deprioritize messing with things that I already have working :wink:

All about the options when you need them, keep to what works and is stable for you.

i do see the use for bluetooth outside the wifi range, like using as portable BT speaker in the park/at the beach (or in the shed), but a waterproof speaker in the bathroom could might as well be using sendspin protocol instead of bluetooth :man_shrugging:t3:

and if only using as BT speaker (no wifi) then you might as well use a normal BT speaker, the need for BT in sendspin only comes down to having dual usage, which could be nice of course for those that use same speaker both inside and outside the home…