Project showcase
Sonos Hub

Sonos Hub © GPL3+

Scan, Monitor and Control your Sonos devices by Arduino. Sonos UPnP hub with Arduino MKR1010 / WiFiNINA,

  • 1,541 views
  • 2 comments
  • 2 respects

Components and supplies

About this project

SonosUPnP

Create Wifi-based Hub that Scans, Monitors and Controls your Sonos-devices on your homenetwork.

Basically, why would you? - your Smartphone can do the job, and many other smart devices can !!

However this is a software-base for further projects in mind like building your own Demotics-Wall mounted Sonos-Controller, convert an old jukebox into a Sonos-player or re-build your old damaged Philips Tube-radio into a retro-looking Sonos player including volume control and fancy rgb colors. Whit this Hub as base, you can add the hardware-controls later :)

Sonos Library

The base is a Sonos library from 2015, that is extended with extra functions to build the Sonos-Hub. This Library is a fork From original Sonos library : https://github.com/tmittet/sonos, and I build the the WIFININA port for Mkr1010., : https://github.com/javos65/sonos

I added Sonos uPnP scan to find your Sonos devices on your network Added a patched function parsing for TrackMetaData parsing (very loose!) New SonosUPnP-class functions are:

  • getZone(IPAddress,.buffer)
  • getSerial(IPAddress, buffer)
  • getSource(IPAddress, buffer)
  • getMedium(IPAddress, buffer) - including Spotify
  • getSonosInfo(IPAddress) : using a new Structure : SonosInfo

Track MetaData :

  • getFullTrackInfo(IPAddress) : using a new Structure : FullTrackInfo
  • getTrackCreator(IPAddress, buffer)
  • getTrackTitle(IPAddress, buffer)
  • getTrackAlbum(IPAddress, buffer)

Scan uPnP by UDP broadcast

  • CheckUPnP(IPAddress *Plist)

This last is a scan-function for finding your uPnP Sonos on your network, and results in a list of Ip-adresses of all uPnP devices

Sonos Info

Interesting reading of the available services on port 1400:

Sonos TypeScript by SvRooij : link

Additional the library used the HTTP GET status/zp call on port 1400 to receive an XML feedback.

Dependencies

This application is using the following Arduino Libraries:

WIFININA - wifi library for mkr1010 / uBlox Nina W10

MicroXPath library, for parsing the XML, build by T.Mittet

EasyWifi library, for setting up Wifi and credential storage

Examples

The Github library has two examples now, one shows the Sonos hub with scan and info features, by means of a WebServer that you can access

The other is a Prank-Demo. Fill in the.ino code your 'bad-music' artist name, and the hub will skip this artist every time its in your Spotify playlist :) VERY USEFULL

ToDo

  • Improve the EasyWifi Library

Code

Sonos ESP32
Sonos extended Library
MicroXpath
Tiny XML parser
EasyWiFi
easy wifi setup for Mkr1010

Comments

Similar projects you might like

How to Build a DIY Arduino-Based Smart Home Hub with 1Sheeld

Project tutorial by amrmostaafaa

  • 39,014 views
  • 1 comment
  • 51 respects

Control Your SONOS with Arduino and NODE-RED

Project tutorial by hatschibratschimobile

  • 2,449 views
  • 0 comments
  • 2 respects

Wifi Controlled Car with Central Hub

Project showcase by Cooper and Vaughn

  • 4,450 views
  • 0 comments
  • 12 respects

SmartQ Notification with Azure IOT Hub and Virtual Shields

Project showcase by vincent wong

  • 2,566 views
  • 0 comments
  • 6 respects

Securely Connecting an Arduino NB 1500 to Azure IoT Hub

Project tutorial by Arduino_Genuino

  • 23,407 views
  • 26 comments
  • 27 respects

Bluetooth Remote Control for Lego Technic Hub

Project showcase by haraldholzner

  • 4,182 views
  • 6 comments
  • 4 respects
Add projectSign up / Login