Russound RNET to Sonos Bridge (Arduino MEGA) – Part 2

(This product is now available for purchase)

While it was possible to use an Arduino duemilanove (Atmel 328 chipset) for this project (See Part 1), I was really limited due to the 2K of RAM. It was fun trying to optimize code to get things to run in that amount of memory, however, it caused me to not be able to expand on functionality and features. I have upgraded the project to an Arduino MEGA (Atmel 1280 chipset). This platform gives me up to 8K of RAM — which should be more than enough memory (famous last words).

A lot of people have asked me to explain what exactly I’m doing with the Arduino. It’s pretty simple. First, I’m using a RS232 shield (not shown) to capture RS232 commands from the Russound Controller. When a key is pressed on the Russound keypads I read the RS232 data and either ignore or react to the events. Currently, I’m looking for +, -, Next, Previous, Play/Pause, Menu events. I plan on using the Menu button to offer deeper content browsing menus (need to sniff the RS232 or wait for Russound to publish protocol). The + & – buttons will allow to scroll playlists and the rest of the transport buttons are self explanatory.

// Example RNET Next Track Event:
F0 0 7D 7 0 0 7F 5 2 1 0 2 1 0 E 0 0 1 7 0 1 2A F7

Since the Sonos is a uPnP based system there is no IR or way to traditionally control it. Everything needs to be done via HTTP calls. I’m using an Ethernet Shield to translate the RS232 events to uPnP messages. The biggest challenge has been parsing the huge amounts of VERY VERBOSE SOAP-based notification messages. I parse the data real time, looking for strings that I want to store (things like playstate and metadata).

To make matters worse, Sonos is URL encoding XML data inside of an XML structure. So writing a simple XML parser is not possible. You have to look for things like &amp;lt; for a less-than bracket (<). There were times I wanted to scrap the whole project because of this due to the limited RAM and string utilities — it really makes things a lot harder to deal with.

// Example of nested URL encoded XML:
<Event xmlns="urn:schemas-upnp-org:metadata-1-
0/AVT/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-10/">
<InstanceID val="0"><TransportState val="PLAYING"/ 
...

When I get a notification message, I package it up into the RNET protocol and send it back into the Russound controller, which gets displayed on the keypads and automation systems that use that data (like Myro:Home which is connected to a HAI OmniPro II). Since uPnP uses a subscription model, I also need to keep subscription expiration timing so I can renew the subscription. It’s basically a client (outgoing to the Sonos to send subscription requests) and a server (to receive incoming notification events from Sonos). Then I have to deal with all the HTTP issues, like if it fails to renew or I have connection issues, I have to clean up and start the connection process all over again.

This project is now code complete and any new features will be made in a future revision. I plan on creating a custom PCB — any interest?

If you have any questions or comments feel free to post them in the comments section below!

Danny Mavromatis: Seattle, WA

View Comments (22)

  • This is awesome. I love my Russound and Sonus system!!! To be able to control the Sonus form the wall plate would be GREAT. When will you be willing to share this with people and is there any testing I can help you with?

  • Hi Scboy99,

    The product is ready for production and will be sending it out for production next week. I will post more details about availability once I get the production boards in-stock. I know you'll enjoy it as much as I have!

    Best,
    Danny

      • Final PCB design was sent to production today. Parts/components were ordered. Assembly and testing is next, then shipping. I will be launching the website in the next week which will have a preorder. I'll post and update showing the two shipping firmwares in action!

        As a bonus, the bridge offers RNET RJ45 jacks so you can daisy chain them with true RNET sources saving the RS232 port on the Russound for other devices.

        Once all the hardware is shipping there will be more focus for adding support for other devices and adding deeper content browsing support to keypads.

        Best,
        Danny

  • Wow!

    Don't know why Russound could not do this. I have been waiting so long for someone to come up with a way to control Pandora on a russond device. Great work. I will buy this device when it becomes available..

  • Great. I will post a new update showing iTunes control too! I will be sending designs to be manufactured next week.

  • This is well sweet. I'm runninga Russound C-Seies, a Sonos control from teh wall pad woukld be the icing! Let me know if you want a distro in the UK!!

    russellg

  • Any Sonos. I'm using a ZP90 (cheapest and smallest), but any version that has audio outputs (which can be feed into the Russound will work).

    Danny

  • Not yet... haven't had time, will post updates on project this weekend. There are quite a bit of them!! :)

    • Will I be able to control my iTunes as well as Sonos with my russound system and can I change zones on my russound system with the Sonos App?

1 2
Related Post
whatsapp