Sonos - The Beginning

Posted on
Sun Feb 19, 2012 12:47 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Mainly use radio or napster to stream, music server on the network and line-in.

That's quick!

Mat

Late 2018 mini 10.14

Posted on
Sun Feb 19, 2012 1:11 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Stand by.. found a typo. Getting careless in my old age...

Posted on
Sun Feb 19, 2012 1:27 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Ok not sure if this is me or not:

Getting a few errors in the log and plugin not working.
Main error appears to be "global name 'replace' is not defined"
errors in line 46, 53 and 82

I disabled plugin. Copied new plugin over, stopped and restarted indigo server, enabled plugin.

Sonos Error plugin runConcurrentThread function returned or failed; will attempt again in 10 seconds
Sonos Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 46, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 53, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 82, in checkForMessages
<type 'exceptions.NameError'>: global name 'replace' is not defined

Sonos Error plugin runConcurrentThread function returned or failed; will attempt again in 10 seconds

Late 2018 mini 10.14

Posted on
Sun Feb 19, 2012 1:35 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

It's me - made a couple of errors in the string parser. Sorry about that. Working on it...

Posted on
Sun Feb 19, 2012 1:39 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

No problem at all. No need to say sorry, your working, I'm only testing :D

Late 2018 mini 10.14

Posted on
Sun Feb 19, 2012 2:08 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Ok - try the latest package. I was pulling my hair out over simple statements thinking I was nuts until I realized that the SonosPy extensions were not running. I had just moved my Mac that runs all of this - need to get that in a startup script.

I cleaned up the state clearing even more. I only have one Sonos device so it was harder to test a multiple device scenario, but what I was doing was clearing all ZonePlayer states every time a class change occurred instead of just the relevant device. Hopefully this works a little better.

Posted on
Sun Feb 19, 2012 2:43 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Great job, that's running.

Ok, next issue with the states is a little difficult to describe.

I have 3 zones. 1, 2 and 3 for simplicity.

Zone 1 is paused on radio.
Zone 2 has nothing queued to play.
Zone 3 is paused on a stream from napster.

On playing zone 3, zone 1 and zone 2 state change from STOPPED to PLAYING or PLAYING to STOPPED intermittently (say every 1 second - but not every second). The same is happening to all three ZP_STATES. Zone 3 occasionally shows STOPPED, before going back to PLAYING.

ZP_ART is still disappearing and coming back on refresh.

ZP_VOLUME appears to be reading the correct value most of the time, and then picks up a volume level from what appears to be another zone. Ie, it is 40 most of the time, then drops to 28 (zone 1 level) for one pass of the update before reverting to 40 - happens every few passes.

It still stops updating after a while. I presume this is the NOCHANGE error above.

I hope this is helping, and by no means moaning. It's nice to see this pluging started. Let me know if there is anything else re the above that would be helpful.

Regards

Mat

Late 2018 mini 10.14

Posted on
Sun Feb 19, 2012 2:53 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

You have a pm :D

Late 2018 mini 10.14

Posted on
Sun Feb 19, 2012 3:00 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

I'm afraid that I can't have concurrent threads addressing the SonosPy extensions. I'm going to rethink things a bit, but believe that I will have to have a single thread poll all Zone Players. Not a huge deal, but a high level logic change. I'll know after I have your debug output.

Thanks for working with me!

Posted on
Sun Feb 19, 2012 7:02 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Mat

Thanks for helping to troubleshoot the oddities of multiple zone players. I published yet another update that introduces a small (.25 sec) delay between each zone player query. Perhaps this will help things out.

Looking forward to your next report.

Posted on
Sun Feb 19, 2012 8:02 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

I have not been able to get the sonospy to install yet. Is there a clearer set (for a layman) of instructions as to steps to take and files to download.

Thanks
Terry

Posted on
Sun Feb 19, 2012 8:14 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Here is a link to download sonospy: https://github.com/henkelis/sonospy/zipball/master.

You can unpack it in any directory on your Mac and run this from the root directory of the package (you will need to do this from a terminal): ./sonospy_web

It should start silently. You can validate that it is working by successfully navigating to the following url: http://[serverip]:8000/sonospy/default

Hope this helps.

Posted on
Sun Feb 19, 2012 9:16 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

Thanks!!

I think I got it installed okay, but when I tried the url I got my security spy server which uses port 8000. Can I change the port sonospy is using? I can change security spy but I have a lot of calls embedded in control pages and mobile devices. It would be a real pain so if I could change sonospy it would be much better.

Terry

Posted on
Sun Feb 19, 2012 9:21 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

It may all still work. The plugin does not actually address the web server, but the backchannel on port 50101. Give it a shot - if it does not work, I will look through the sonospy configurations and let you know what needs to be changed.

Posted on
Mon Feb 20, 2012 2:23 am
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Pm'ed log, but not tested as running out of the door to work. Will test tonight.

Mat

Late 2018 mini 10.14

Who is online

Users browsing this forum: No registered users and 4 guests