Page 7 of 37

Re: Sonos - The Beginning

PostPosted: Fri Feb 24, 2012 8:19 pm
by nlagaros
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.

Re: Sonos - The Beginning

PostPosted: Sun Feb 26, 2012 9:16 am
by mat
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!

Re: Sonos - The Beginning

PostPosted: Sat Mar 03, 2012 10:09 am
by nlagaros
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.

Re: Sonos - The Beginning

PostPosted: Sun Mar 04, 2012 8:50 am
by mat
No probs. sorry I can't assist more, but that's beyond me.

Anything else I can do, just shout!

Re: Sonos - The Beginning

PostPosted: Sun Mar 04, 2012 2:23 pm
by nlagaros
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.

Re: Sonos - The Beginning

PostPosted: Sun Mar 04, 2012 4:28 pm
by wideglidejrp
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.

Re: Sonos - The Beginning

PostPosted: Sun Mar 04, 2012 5:24 pm
by nlagaros
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.

Re: Sonos - The Beginning

PostPosted: Wed Mar 07, 2012 1:15 am
by mat
How about just favourite radio stations?

Re: Sonos - The Beginning

PostPosted: Sun Mar 11, 2012 1:58 pm
by nlagaros
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...

Re: Sonos - The Beginning

PostPosted: Sun Mar 11, 2012 3:07 pm
by mat
Shout if I can do anything

Re: Sonos - The Beginning

PostPosted: Sun Mar 11, 2012 3:49 pm
by wideglidejrp
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.

Re: Sonos - The Beginning

PostPosted: Sun Mar 11, 2012 6:17 pm
by nlagaros
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.

Re: Sonos - The Beginning

PostPosted: Sun Mar 11, 2012 6:20 pm
by nlagaros
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.

Re: Sonos - The Beginning

PostPosted: Mon Mar 12, 2012 2:26 pm
by terrydew
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)

Re: Sonos - The Beginning

PostPosted: Mon Mar 12, 2012 3:40 pm
by nlagaros
Can you try the same thing with debug mode turned on. It should be telling of the issue - probably some string formatting issue. Thanks.