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 LibraryThe 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 InfoInteresting 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.
DependenciesThis 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
ExamplesThe 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
Comments
Please log in or sign up to comment.