Micropython + ESP8266 + Sonos

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
slzatz
Posts: 92
Joined: Mon Feb 09, 2015 1:09 am

Micropython + ESP8266 + Sonos

Post by slzatz » Wed Apr 06, 2016 2:04 am

Just thought I'd post an example of using micropython on the esp8266 to display the song playing on my Sonos system. The main point for me is that this would have been tedious and time consuming in C and was comparatively quick and easy using micropython. For the curious, information on the song playing on Sonos system is posted to a web server and then accessed via a socket from the esp8266. Increasing the heap to 24 * 1024 has enabled a full font set; however, I am still running out of memory when I also program the buttons to do things like change the volume although I am sure that is a solvable problem. I had created something similar with a raspberry pi but it needed to be plugged in and was unwieldy compared to the esp8266 with lipo battery. I listen to sources like Pandora and am always interested in what is playing and having a very small portable dedicated display is great and was entirely made possible by micropython and the port to the esp8266.

The link is to a brief video of the display in action -- I am just flipping through some songs quickly so you can see the display change (ignore the sound of the dryer in the background).

https://youtu.be/S4IRAIIhizU

torwag
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

Re: Micropython + ESP8266 + Sonos

Post by torwag » Wed Apr 06, 2016 9:32 am

Hi,
very nice example.
Thus, I need to create something for Teufels Raumfeld System now ;), just to make sure we do get an equal weight here.
I am curious why you used an additional web service. Not familiar with the Sonos System, but for Raumfeld you can directly connect to the Box and receive those info. Actually, this is the way apps on the smartphone do it.

slzatz
Posts: 92
Joined: Mon Feb 09, 2015 1:09 am

Re: Micropython + ESP8266 + Sonos

Post by slzatz » Wed Apr 06, 2016 10:43 am

I am curious why you used an additional web service.
Good question. You can definitely run a web server directly on the esp8266 and skip the separate web server -- I have my music and a bunch of other sonos-related code in the Amazon cloud and it was simpler to have the esp act as an http client and grab the song information. The advantage of doing it that way (although I doubt most people would care) is that I can tell what's playing when I am not home or pause the music if I forgot to when I left.

Berrybassett
Posts: 1
Joined: Sun Jul 07, 2019 7:42 am

Re: Micropython + ESP8266 + Sonos

Post by Berrybassett » Sun Jul 07, 2019 7:44 am

Where can I obtain your code? I’m going to steal your idea and have it display volume instead.

Post Reply