Sonos - The Beginning

Posted on
Fri Feb 24, 2012 8:19 pm
nlagaros offline
Posts: 816
Joined: Dec 20, 2010

Re: Sonos - The Beginning

I'm having a tough time replicating the thread issue, but will keep trying. Mat - which process thread count was increasing? Is it the Python process that is running the plugin or pycpoint.py?

Thanks.

Posted on
Sun Feb 26, 2012 9:16 am
mat offline
Posts: 316
Joined: Nov 25, 2010
Location: Suffolk - UK

Re: Sonos - The Beginning

Not sure how to tell.

In activity monitor with the plugin disabled, python processes hold a fairly stable thread number. Two processes are root users and two are "logged in" users.

With the plugin active, one of the root user processes starts rising. This is a different "pid" ref to the ref given in indigos log when the pluging starts. When the plugin is stopped, the thread count stops increasing. If the plugin is restarted, the count rises again.

Port numbers are also rising when I click inspect, as is real, virtual and virtual private memory.

If I quit the process in activity monitor, the plugin stops working, with the "attempt again in 10 seconds" error - does this mean the plugin is causing an error in sonospy?

Tried to stop sonospy and got a no such process error. Restarted sonospy and plugin - thread count rising again.

Hope that helps!??! It's lost me now!

Posted on
Sat Mar 03, 2012 10:09 am
nlagaros offline
Posts: 816
Joined: Dec 20, 2010

Re: Sonos - The Beginning

mat - I'm still working on the threading/memory issues. I haven't given up on this yet. Also working on selecting playlists and radio stations. Hopefully I'll have a release before the weekend is over.

Posted on
Sun Mar 04, 2012 8:50 am
mat offline
Posts: 316
Joined: Nov 25, 2010
Location: Suffolk - UK

Re: Sonos - The Beginning

No probs. sorry I can't assist more, but that's beyond me.

Anything else I can do, just shout!

Posted on
Sun Mar 04, 2012 2:23 pm
nlagaros offline
Posts: 816
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Think I hit a snag with the Radio - created a procedure to query for the entire list to maintain a local database of stations and it seems I am now cut off. Will wait a while and see if I get access back.

Posted on
Sun Mar 04, 2012 4:28 pm
wideglidejrp offline
User avatar
Posts: 199
Joined: Jan 15, 2012
Location: Ridgefield, CT

Re: Sonos - The Beginning

This is a great endeavor and I for one applaud you for taking it on. Best of luck! This may be a dumb question but what does one do with a Python extension? How does that get incorporated into Indigo? Also, could you give me an idea of what your goals are for what you are doing? What functionality are you planning for? I can not help code, but may have some ideas on functions.

John Patrick
http://patrickweb.com

Posted on
Sun Mar 04, 2012 5:24 pm
nlagaros offline
Posts: 816
Joined: Dec 20, 2010

Re: Sonos - The Beginning

My plugin calls the SonsoPy extensions - basically I use them for all the real communications with the ZonePayers. So you would just drop that package in your computer and launch the sonospy_web script. The plugin configuration asks for the name or ip address of the computer it is installed on. There is no other configuration required.

My goals with the plugin are to have basic control of each ZonePlayer (play, pause, mute, ff, few, etc), switch between sources, and select playlists or radio stations. It also polls each ZonePlayer continuously for status updates. I'm only three weeks in to this and still have a lot of work to do. There is a semi-functional beta available for download. If you nay have one ZonePlayer like I do, I'm not sure you will see the memory and threading errors that others are experiencing.

Posted on
Wed Mar 07, 2012 1:15 am
mat offline
Posts: 316
Joined: Nov 25, 2010
Location: Suffolk - UK

Re: Sonos - The Beginning

How about just favourite radio stations?

Posted on
Sun Mar 11, 2012 1:58 pm
nlagaros offline
Posts: 816
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Unfortunately I don't seem to have any access to favorites - that was my original objective with Radio. I've worked out a scheme where I can save the entire radio station tree by location to a file and can refer to it for actions. I figure it does not update that often, so should be useful. Other good/bad news is that I'm now seeing my Mac crap out due to this plugin so clearly see that it is hogging resources - just have not figured out what the deal is yet.

Getting there... very slowly...

Posted on
Sun Mar 11, 2012 3:07 pm
mat offline
Posts: 316
Joined: Nov 25, 2010
Location: Suffolk - UK

Re: Sonos - The Beginning

Shout if I can do anything

Posted on
Sun Mar 11, 2012 3:49 pm
wideglidejrp offline
User avatar
Posts: 199
Joined: Jan 15, 2012
Location: Ridgefield, CT

Re: Sonos - The Beginning

Does anyone have a basic applescript that will turn the Sonos on or off? I want to start with the basics and make sure that works before adding more functionality.

John Patrick
http://patrickweb.com

Posted on
Sun Mar 11, 2012 6:17 pm
nlagaros offline
Posts: 816
Joined: Dec 20, 2010

Re: Sonos - The Beginning

From AppleScript, I would want to call out to curl to engage the SonosPy extensions - seems like the easiest way. Mat has done a good bit of work on this. I do ask that you try out the plugin I've been working on. It may quickly get you to where you want to be.

Posted on
Sun Mar 11, 2012 6:20 pm
nlagaros offline
Posts: 816
Joined: Dec 20, 2010

Re: Sonos - The Beginning

I've got an update posted. The following changes are in this version:

  • Added plugin option to enable/disable polling of ZonePlayers
  • Added menu option and action to import RadioTime stations to file for use in actions
  • Added action to tune to Internet radio station by location
  • Half implemented action to engage a Sonos Playlist (does not yet properly start queue)

It's been a couple of weeks so better to publish what I have - there are some incremental improvements to the load issue, although certainly not rectified. And I have an exception issue when the radio station database becomes out of sync. Think a scheduled action to update once per day would make that a non-issue, but I still need to code around it.

Posted on
Mon Mar 12, 2012 2:26 pm
terrydew offline
Posts: 257
Joined: Jun 10, 2011

Re: Sonos - The Beginning

Loaded the new version and got the following errors with polling turned on

Sonos Error Error getting ZonePlayer data: Portable
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 71, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 429, in getPlaylists
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 132, in sendMessage
File "/Library/Application Support/Perceptive Automation/Indigo 5/IndigoPluginHost.app/Contents/PlugIns/plugin_base.py", line 85, in errorLog
<class 'Boost.Python.ArgumentError'>: Python argument types in
ServerInfo.log()
did not match C++ signature:
log(CCString message, CCString type='', bool isError=False)

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

Turned polling off and got the following errors


Sonos Error Error getting ZonePlayer data: Office%20%28ZP%29
Sonos Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 57, in actionPlay
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 166, in actionGeneric
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 132, in sendMessage
File "/Library/Application Support/Perceptive Automation/Indigo 5/IndigoPluginHost.app/Contents/PlugIns/plugin_base.py", line 85, in errorLog
<class 'Boost.Python.ArgumentError'>: Python argument types in
ServerInfo.log()
did not match C++ signature:
log(CCString message, CCString type='', bool isError=False)

Posted on
Mon Mar 12, 2012 3:40 pm
nlagaros offline
Posts: 816
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Can you try the same thing with debug mode turned on. It should be telling of the issue - probably some string formatting issue. Thanks.

Page 7 of 24 1 ... 4, 5, 6, 7, 8, 9, 10 ... 24

Who is online

Users browsing this forum: No registered users and 0 guests