7 ms·
Hacking Sonos
- klochner 13y agoAPI docs or it didn't happen. Looks like a cool project, I just find it hard to believe he used wireshark to figure out the API on his own, given that he acknowledges: I took a few bits from @n1mda's project: https://github.com/n1mda/sonos-objc Sorry to be cynical, my BS meter just went through the roof.
- thejosh 13y agohttps://github.com/rahims/SoCo https://github.com/rahims/SoCo ?
- cushychicken 13y agoThis has migrated into its own project (I don't think Rahim is officially affiliated any more): https://github.com/SoCo/SoCo https://github.com/SoCo/SoCo Also, the author used his own Sonos library written in ObjectiveC rather than Python: https://github.com/nathanborror/SonosKit https://github.com/nathanborror/SonosKit
- rahim 13y agoYup, that's correct, though the old library in my repo still works and is used by some folks, maintenance of SoCo is handled by a group of very talented and friendly developers under https://github.com/SoCo/SoCo https://github.com/SoCo/SoCo It looks like the author used SoCo for the Raspberry Pi project mentioned at the bottom of the article.
- nthnb 13y agoSoCo was a big inspiration :)
- cushychicken 13y agoHey Rahim - you did great work on that project. I've used it a few times with an RPi to control my household. Works like a charm!
- enigmo 13y agoIt's not really that novel. When I wrote a Sonos client (2007) there were a few out there already. Getting things working did involve a lot of time in Netmon (nee: Wireshark), and reading UPnP specs. https://github.com/NathanHowell/Sonority https://github.com/NathanHowell/Sonority https://github.com/NathanHowell/upd2 https://github.com/NathanHowell/upd2 <-- update image extractor A few of us went a bit further, found some telnet backdoors and cracked the root password.
- nthnb 13y agoOnce you figure out all the different service types you can visit http://<SPEAKER_IP>:1400/xml/<SERVICE_NAME>1.xml http://<SPEAKER_IP>:1400/xml/<SERVICE_NAME>1.xml to get a better idea of the types of things you can do. This was a helpful post after I started poking around: http://blog.travelmarx.com/2010/06/exploring-sonos-via-upnp.html http://blog.travelmarx.com/2010/06/exploring-sonos-via-upnp....
- n1mda 13y agoHey, I'm n1mda. Cool to see this project on HN! I made sonos-objc on my spare time, and it's not too hard to reverse the API with Wireshark. Perhaps I could continue developing a Sonos API for SonosKit (I have a few improvements on a local repo)
- theswan 13y agoVery cool! I bought a Play:3 a few months back and was also dissatisfied with the given OS X/iOS apps - I'm currently working on enabling AirPlay support for Sonos devices. (http://stephen.github.io/airsonos/ http://stephen.github.io/airsonos/) Would love feedback from any Sonos users!
- berberous 13y ago"strange error flushing buffer ... " Maybe because I'm running the Sonos beta? Would be awesome if it worked though! I would want it as a menubar app though.
- por 13y agoSame error here. Running node v0.10.26 and Sonos version 4.3.
- theswan 13y ago@por and @berberous - Does audio play at all even when the error happens, or completely doesn't work? I've noticed that sometimes it occurs but the streaming still works fine. "strange error flushing buffer" is emitted from one of the dependencies, the lame encoder - I'm currently looking into the issue.. Would love to diagnose this further, via github or stephen at stephenwan.net.
- owenwil 13y agoHoly crap, this is exactly what I've been looking for! Amazing! I hope you plan to continue with this project for some time - I've always wondered why Sonos doesn't do this themselves!
- theswan 13y agoThank you! Would love further feedback (stephen at stephenwan.net) if you find yourself having any problems using it. The code is very-much early stage, so there are some issues to squash.
- 13y ago
- chrissnell 13y agoThis is awesome. Submissions like this harken back to the early days of Slashdot and things like the CueCat and Linksys router reverse engineering. I'd love to see more of these hardware+software hacks show up on HN.
- provost 13y agoIndubitably! These kinds of submissions are the only reason why I return to HN daily and wade through the endless submissions that break the off-topic guidelines [1], and yet get upvoted anyways. [1] http://ycombinator.com/newsguidelines.html http://ycombinator.com/newsguidelines.html
- dang 13y agoOur long term plan is to make for less wading and more pleasant strolling. If you (or anyone) notice an excellent-for-HN post that has fallen through the cracks, please let us know at hn@ycombinator.com. We're thinking of starting a search-and-rescue program for the tragically overlooked.
- caseyf7 13y agoYes! I would love to see someone hack the Nest so it could be used with a private server.
- icebraining 13y agoHack A Day is a good resource on that: http://hackaday.com/?s=reverse+engineer http://hackaday.com/?s=reverse+engineer
- elyrly 13y agoCreative idea to compile an API literally out of thin air. This might be my future replacement.
- berberous 13y agoThis is awesome and looks great. Do you plan to release the menubar app soon?
- nthnb 13y agoI'm still working on it — I'll hopefully have something out soon.
- awhitty 13y agoThis article is the reason I think you're the most badass designer out there. Wireshark + wireframes + Raspberry Pi and thoughtful redesigns? Who else blends all four into such a cool project? You're a real inspiration, so keep it up!
- jwr 13y agoI am so glad this is happening — for the hack value itself, but also because a genuinely useful application might result. I love Sonos, their devices are way ahead of the competition. But their app just plain sucks. What is the most important function of a remote control app? Adjusting volume — and yet the useful range for the volume control occupies less than a percent of the entire touchscreen. It is very difficult to adjust the volume. And Sonos gives you no way to set the useful range, so you often end up blasting your ears with monstrously loud music, because you didn't tap the control just right. This has been reported to Sonos numerous times and yet we still have to suffer with the crippled volume control. Here is hoping that there will be an alternative.
- andrewjshults 13y agoIf you haven't signed up for their beta program, I'd recommend it. At least on the android side the app is much nicer than the one in the app store.
- seear 13y agoThe hardware volume controls on tablet/phone work well for me when using the app.
- jwr 13y agoYes, they work much better — but not when you want to adjust the volume of one particular player in a group. Also, in some cases, the useful range of volume is 5-15% (a zoneplayer connected to an external amp), which is when the jumps using the hardware buttons are just too large. I just don't get it: volume control is the #1 task for any remote control. If it were up to me, I'd dedicate 25% of screen space to it and tweak it endlessly to get it just right.
- splitbrain 13y agoA bit unrelated, but can anyone enlighten me what he means by "geofence" to detect his phone leaving the apartment?
- whatusername 13y agoHere's the Android details: https://developer.android.com/training/location/geofencing.html https://developer.android.com/training/location/geofencing.h... Essentially - hook into the Phone's location services and perform actions based on either entering or leaving a certain location/radius.
- lutusp 13y agoThrough reading the context, it means a scheme in which a phone uses its GPS to detect exceeding a specified radius from the house and setting off an alarm. All you need to do is set a position (the house) and an alarm radius (greater than the normal error bounds for GPS) and you will always know if the phone is where it's supposed to be.
- fit2rule 13y agoGeo Fencing is where you use the GPS coordinates of a 'virtual area' to determine whether you are 'inside the fence' or outside of it. Think of it as virtual lines in the sand, and whenever your phone determines you've crossed a line, it does something ..
- japers 13y agoCoincidentally, I just released a Sonos CLI NPM package over easter [1] that builds on some work done by others [2]. It is targeted primarily at circumventing the Spotify search functionality in the Sonos app, that more often than not times out and fails to give results. I just started using it at the office for quick playback control, and it takes away a lot of the frustration I have with the app. [1] https://www.npmjs.org/package/sonos_cli https://www.npmjs.org/package/sonos_cli [2] https://www.npmjs.org/package/sonos https://www.npmjs.org/package/sonos
- gadders 13y agoI wish someone would hack Sonos to make its network communication more reliable. Every time you turn it off you have to press the two buttons on top to make it find the bridge again. Several times.
- cpayne624 13y agoSounds like something specific to your enviro. Haven't experienced that
- omnibrain 13y agoMake sure that your Sonos devices and the devices you use to control them always get the same IP via static leases.
- gadders 13y agoUsing DHCP currently. I'll have a look at that when I get a chance.
- omnibrain 13y agoJust configure your DHCP server to always hand them the same adress (static lease). Do you use the built in dhcp of your wifi router? Most of them offer an option to enter a mac address for which you want to assign always the same IP. Sonos really does not like if components get different IPs after you had them powerless for some time while other components stayed active. I had the same issues you describe until I configured static leases for my sonos components and the smartphones we use to control them.
- gadders 13y agoThanks for the advice. Yes, I am using the DHCP of my router. I'll have a go at this. Thanks for the advice.
- rsync 13y agoUse wired connections or you will lose. I've been using their equipment since 2005 and they have never reliably interconnected over the wireless. Just spare yourself the trouble and wire them physically - they will be flawless.
- patrickk 13y agoAmazing. Perhaps combine with Jasper[1] (RPi voice control, like Siri) for even more cool functionality and an extra way of interacting with it. [1]http://www.raspberrypi.org/meet-jasper-open-source-voice-computing/ http://www.raspberrypi.org/meet-jasper-open-source-voice-com...
- zrgiu_ 13y agoPlease, please, bundle the Mac OSX volume controls in an app and put it somewhere for download. I'd totally pay for that! https://d262ilb51hltx0.cloudfront.net/max/800/1*AzZdjG36qm90y476o4zTHg.png https://d262ilb51hltx0.cloudfront.net/max/800/1*AzZdjG36qm90...
- pedrocr 13y agoI was hoping someone was hacking the sonos itself and replacing the software. The hardware looks awesome but the fact that it can't connect to an existing wireless network and that you can't stream live audio to it makes it very limited. I bought one and ended up returning it when I realized I couldn't use it for something basic as sound for a movie on my laptop.
- jimmcslim 13y agoThere are rumours that Sonos are considering opening up their platform to 3rd-party developers. Given they have recently dropped the bridge requirement, and the abundance of AirPlay-compatible speakers (plus WiFi-direct based alternative to Sonos, Panasonic have released one) I think they are perhaps starting to feel the competitive heat. I for one can't wait until Instacast or Downcast can send audio to a Sonos without having to go via an Airport Express as an AirPlay bridge.
- drewying 13y agoVery cool! I created an app using some of nathanborrors work that let's you browse through all of the Sonos Music services (Like Rdio, Spotify, Pandora, iHearRadio, etc). Setup your account, browse through your collections and play them on your system. I should submit a pull request to see if I can get this integrated into this project! You can see the project here: https://github.com/drewying/Sonos-Music-Services-Browser https://github.com/drewying/Sonos-Music-Services-Browser I also have an app on the App Store that turns your Sonos System into a wireless PA system. The current version is a little buggy but an update is coming shortly that makes it much more stable. You can check it out here: https://itunes.apple.com/us/app/sonos-voice/id689673100?mt=8 https://itunes.apple.com/us/app/sonos-voice/id689673100?mt=8
- geuis 13y agoThe author didn't look very hard. Their API is documented (more or less) at http://musicpartners.sonos.com/ http://musicpartners.sonos.com/. It's more descriptive via language than laying out all end points. Registration is required. After initial UPnP search, you get a URL for a descriptive xml file. Sonos operates over the SOAP protocol. If you want your client to be notified of changes, you have to subscribe to each event type with a max of 3600 second timeout, then resubscribe. It's not necessary but the system supports unsubscribing too. One specific thing you have to hack is this. If you want to switch to a different music service, you have to include the user id used to sign into that service (Pandora, Rdio, etc). This data is returned in a base64 encoded, encrypted blob. There's no way to decrypt it unless you can figure out how to crack the key out of the device. Fortunately you only need the user id. There's another undocumented endpoint that returns some info that includes all the usernames, just no passwords. But it doesn't match the them to their services. You then have to send requests with all combinations of usernames and services and get the responses. Once these are returned, just store the relationships. I'm writing this from memory, sorry for the specific details. If anyone is interested, contact me through my email in my profile and I'll get the info from some code I wrote recently.
- digitalboss 13y agoFYI - Unofficial SoundCloud Sonos application using Heroku app endpoint http://www.hirahim.com/projects/sonos-soundcloud/ http://www.hirahim.com/projects/sonos-soundcloud/ Works great - cool to see the Sonos web interface for the zones.
- Myrmornis 13y agoIn case it's useful to anyone, if you want something that costs $25 instead of a few hundred, Airfoil by RogueAmoeba[1] is great. It's just software: you basically need to leave an iOS/Android device next to your amplifier, and you can stream to it from other devices. I use it for music; AFAIK there would be a lag between image and sound for a video source. [1] https://www.rogueamoeba.com/airfoil/speakers.php https://www.rogueamoeba.com/airfoil/speakers.php