Web installer for snapcast
Hey folks.
I'm a developer of a few audio boards that work with snapclient, including Louder-esp32 and Esparagus set of boards. I'm currently testing them together with the Home Assistant. It really works great, sync is beyond belief.
I went a little further and made a web-flasher that will have pre-built configurations for all my boards that support snapclient (since the build process is not for faint-hearted).
The fundamental problem that I have is that WiFi credentials are baked into binary and there is no way I can provide a web-flasher to anyone else to use since it will never work in their wifi network. Ideally, I'd like to have improv-wifi integrated, for web-installer would handle wifi credentials right after firmware flashing. Documentation is very poor though, the only signal that it is possible is that ESPHome made it work somehow.
I wonder if you guys think about this issue and perhaps have a direction you'd like to go to solve it.
My work-in-progress branch is here
@anabolyc without looking to much at your provided links I'd suggest using WiFi Provisioning maybe? This is already implemented through WiFi but could be extended to use the serial console as an input too. So after flashing the FW you could set the credentials from your web installer through the serial connection too?
Also beware of the very soon coming upgrade of master to IDF v5
@CarlosDerSeher .. Could you build the WiFi provisioning with the latest branch as I remember the building failed due wrong partition config. Could you please build it and verify that it works?
I tried that some time ago and if I remember correctly I wasn't able to build it.
I like those webinstaller because you can setup WiFi also directly in the browser. So would be Cool if this can be integrated into the current code.
For board from @anabolyc and the boards from espressif it would reduce the amount of time drastically. Just install it with your browser and set it up.
I didn't try recently but thanks for the pointer
@CarlosDerSeher .. See here: https://github.com/CarlosDerSeher/snapclient/issues/74 @anabolyc .. Easiest way is to build the firmware with the wifi-provisioning to make it easy to change wifi.
@DerPicknicker please open an seperate issue with the relevant Information from here.
@CarlosDerSeher I will do it. Only for Bootloader or for both?
bootloader.
What happens if wifi connection is not possible - will the wifi provisioning start again? This would be a good way to changing the wifi without re-flashing the board.
This should be a feature request possibly?
See this https://github.com/jnthas/Improv-WiFi-Library this would allow to add the Wifi-Credentials directly in the browser. I see here some benefit. You're not relying on the APP from Espressif.
Is there a C library for this too?
@anabolyc What do you think about providing the credentials through the serial interface? Wouldn't that be more convenient to the user? Also have a look here #75
@anabolyc What do you think about providing the credentials through the serial interface? Wouldn't that be more convenient to the user? Also have a look here #75
@CarlosDerSeher I need to look into WiFi Provisioning, not sure how it integrates into esp-web-tools. The beauty of the improv-wifi is that it is just another step in flashing firmware with esp-web-tools, with wifi-scanning and everything in a single UI. If Wifi provisioning works the same, I'd prefer it, since it comes from the Espressif.
See this https://github.com/jnthas/Improv-WiFi-Library this would allow to add the Wifi-Credentials directly in the browser. I see here some benefit. You're not relying on the APP from Espressif.
Is there a C library for this too?
I think that's all she wrote, however, folks at ESPhome managed to wrap it up into espidf C component
esp_prov could be of interest for this. a python util implementing the protocol.
Continuing discussion from here
I see the config for the LyraT board (it si the same for the mini version?). I guess I'll remove wifi credentials in favor of wifi provisioning, also PSRAM should be enabled I guess.
@CarlosDerSeher Any other boards/configs you'd like to include?
I didn't test all of them but all those ADF boards (in sample stuffing branch) compile so maybe those?! I'll check my custom design using adau1961 dac, this too maybe
Hi @anabolyc ,
I added in the menuconfig the option to invert the logic-Levels. I think for the Louder it would be good if we have those options:
- Stereo-Mode
- Bridge-Mode (playing left channel)
- Bridge-Mode-Invert (playing right channel)
I added only one SDKCONFIG but this is an easy way to create an completely wireless stereo setup with more power output.
Hey folks. I've added common Espressif boards and AI-Thinker as well. The result is in the branch still, please have a look before I create a pull request: https://sonocotta.github.io/esparagus-snapclient/ If you can, please test with your boards to confirm the build.
- Stereo-Mode
- Bridge-Mode (playing left channel)
- Bridge-Mode-Invert (playing right channel)
I would leave that to more experienced developers to do manually. All the possible configurations would overload the installer too much
Great!!! that's awesome.
How is the general process looking? @CarlosDerSeher will merge the sync with sample stuff and the WiFi improv.
What is needed to get fresh binary's for those boards?
Edit: please try the softvolume if not already enabled for the HiFi version. That should allow controlling the volume even without hardware control.
Edit: please try the softvolume if not already enabled for the HiFi version. That should allow controlling the volume even without hardware control.
Where I can enable that?
Where I can enable that?
Should be inside the DSP section .. If I remember correctly.
I added short usage instructions
@anabolyc did you found the option?
@anabolyc did you found the option?
Yes, enabled and flashed. It works fine, but did I miss it before? seems to be working exactly the same way.
So volume control works fine?
@CarlosDerSeher could you give us here some details?
Which DAC we are talking about?
PCM5100A from this device: see here
So volume control works fine?
@CarlosDerSeher could you give us here some details?
Yes, I can change the volume from Music Assistant. Also, equilizer works
So this hasn't hardware volume control and soft volume isn't working as expected? Did I get this right?
@anabolyc said that softvolume was working already without the option enabled in DSP settings that's why I asked if you @CarlosDerSeher could give us some more deteails...
@anabolyc while this works fine now I am even more thinking about getting one for my remaining speakers ;-)
Edit: @anabolyc .. So on which branch are you build the binary's on the master? Or on the sample syncing stuffing? Because Improv WiFi is not available as far as I know inside master or sync with sample stuffing.
Shouldn't work without soft volume enabled. At least not when using snapserver volume control. Maybe Music Assistant applies software volme control too? You should see this in the logs though.
When I change tho volume in MA, i see this on logs
I (9249) PLAYER: initial sync age: 9us, chunk duration: 24000us
I (12803) SC: Buffer length: 1000
I (12803) SC: Latency: 0
I (12803) SC: Mute: 0
I (12803) SC: Setting volume: 44
I (12807) dspProc: Set volume to 0.440000
I (16076) SC: Buffer length: 1000
I (16077) SC: Latency: 0
I (16077) SC: Mute: 0
I (16077) SC: Setting volume: 52
I (16081) dspProc: Set volume to 0.520000
I (16435) SC: Buffer length: 1000
I (16435) SC: Latency: 0
I (16435) SC: Mute: 0
I (16435) SC: Setting volume: 54
I (16439) dspProc: Set volume to 0.540000
Maybe it wasn't working before, now I'm not so sure :)
Try disabling it again and you'll know for sure :)