A simple ESP8266 button for starting or stopping a TuneIn radio stream on a Sonos system.
- An ESP8266 with an LED connected to any I/O pin and a reset button wired to it
- The standard ESP8266 libraries in the Arduino IDE, along with the ArduinoJson 6 library.
- A server running node-sonos-http-api
- Server can either be located on the same subnet as Sonos (easiest)
- If server is on a different subnet, you will need an IGMP proxy between the subnets for multicast forwarding
- ESP8266 can be on any subnet, as long as it has access to port 5005/TCP on the server
- A radio station on TuneIn that you particularly enjoy
Modify config.h
to suit your network, ESP8266, media preferences, etc.
Then, upload to the ESP8266
You should see the LED slowly blink (connecting to WiFi) and then hold still on first powerup. After a little bit, the LED should turn off and, if all is configured right, you should hear your radio station start up!
If that does not happen, or the LED begins to rapidly blink, check the serial output to see what's happening. Ensure that you can hit the Sonos API from the same network as the ESP8266, and that you can control Sonos from there.