Sonos plugin

My zoneplayer’s IP changed, and I was getting ‘lua startup failed’. I reserved the zp IP to 192.168.0.181 and made sure it plays properly (it does). I updated the sonos device to reflect the new IP, and I still get the ‘lua startup failed’ error. I’ve restarted vera several times.

Any ideas?

I just added the display of the radio logo for tunein service.

[quote=“Intrepid, post:601, topic:169644”]My zoneplayer’s IP changed, and I was getting ‘lua startup failed’. I reserved the zp IP to 192.168.0.181 and made sure it plays properly (it does). I updated the sonos device to reflect the new IP, and I still get the ‘lua startup failed’ error. I’ve restarted vera several times.

Any ideas?[/quote]

Did you change plguin version during this time ?

What error(s) do you get in the logs ?

Upload the plugin files again and restart. Use the Zip archive.

[quote=“lolodomo, post:603, topic:169644”][quote=“Intrepid, post:601, topic:169644”]My zoneplayer’s IP changed, and I was getting ‘lua startup failed’. I reserved the zp IP to 192.168.0.181 and made sure it plays properly (it does). I updated the sonos device to reflect the new IP, and I still get the ‘lua startup failed’ error. I’ve restarted vera several times.

Any ideas?[/quote]

Did you change plguin version during this time ?

What error(s) do you get in the logs ?

Upload the plugin files again and restart. Use the Zip archive.[/quote]

did not change the plugin files. i’m on an old version.

seems like i ran into this before. i’d like to understand why this is happening before i change anything else.

what’s the best way to view the error logs?

edit:

01 11/24/12 7:57:17.990 luup_log:87: Sonos: debug UPnP_request: status=no status statusMsg=No route to host result=[] <0x2c345680>
01 11/24/12 7:57:17.990 LuaInterface::CallFunction_Startup-1 device 87 function sonosStartup failed [string “…”]:32: bad argument #1 to ‘match’ (string expected, got table) <0x2c345680>
01 11/24/12 7:57:17.991 LuImplementation::StartLua running startup code for 87 I_Sonos1.xml failed <0x2c345680>

[quote=“Intrepid, post:604, topic:169644”][quote=“lolodomo, post:603, topic:169644”][quote=“Intrepid, post:601, topic:169644”]My zoneplayer’s IP changed, and I was getting ‘lua startup failed’. I reserved the zp IP to 192.168.0.181 and made sure it plays properly (it does). I updated the sonos device to reflect the new IP, and I still get the ‘lua startup failed’ error. I’ve restarted vera several times.

Any ideas?[/quote]

Did you change plguin version during this time ?

What error(s) do you get in the logs ?

Upload the plugin files again and restart. Use the Zip archive.[/quote]

did not change the plugin files. i’m on an old version.

seems like i ran into this before. i’d like to understand why this is happening before i change anything else.

what’s the best way to view the error logs?

edit:

01 11/24/12 7:57:17.990 luup_log:87: Sonos: debug UPnP_request: status=no status statusMsg=No route to host result=[] <0x2c345680>
01 11/24/12 7:57:17.990 LuaInterface::CallFunction_Startup-1 device 87 function sonosStartup failed [string “…”]:32: bad argument #1 to ‘match’ (string expected, got table) <0x2c345680>
01 11/24/12 7:57:17.991 LuImplementation::StartLua running startup code for 87 I_Sonos1.xml failed <0x2c345680>[/quote]

That could be a consequence of the IP change.
What SVN revision do you use ?

With the recent versions (guessed generation), I think I already tried to set a wrong IP address and the startup process was ok.
In the current version, I see no call to function match in function sonosStartup.

what is SVN?

I updated with the version in the trunk/wiki, and still see…

01 11/24/12 8:12:15.398 luup_log:87: Sonos: debug UPnP_request: status=no status statusMsg=No route to host result=[] LEAK this:4096 start:1228800 to 0x1071000 <0x2b567680>
01 11/24/12 8:12:15.398 LuaInterface::CallFunction_Startup-1 device 87 function sonosStartup failed [string “…”]:32: bad argument #1 to ‘match’ (string expected, got table) <0x2b567680>
01 11/24/12 8:12:15.399 LuImplementation::StartLua running startup code for 87 I_Sonos1.xml failed <0x2b567680>

I see in an old version that there was no initial test to check if the comm was ok when refreshing data information.

@guessed: in the current version, there is not a check of the status variable after each UPnP call. Would it be more secure to do it ?

[quote=“Intrepid, post:606, topic:169644”]what is SVN?

I updated with the version in the trunk/wiki, and still see…

01 11/24/12 8:12:15.398 luup_log:87: Sonos: debug UPnP_request: status=no status statusMsg=No route to host result=[] LEAK this:4096 start:1228800 to 0x1071000 <0x2b567680>
01 11/24/12 8:12:15.398 LuaInterface::CallFunction_Startup-1 device 87 function sonosStartup failed [string “…”]:32: bad argument #1 to ‘match’ (string expected, got table) <0x2b567680>
01 11/24/12 8:12:15.399 LuImplementation::StartLua running startup code for 87 I_Sonos1.xml failed <0x2b567680>[/quote]

To clarify: you now use the last version in trunk and your IP address is set correctly ?

yes

Please try with the last version in trunl: Zip archive link at the bottom of this page trunk – Sonos Wireless HiFi Music Systems

I just made a test with a wrong IP address and eveyrhing is ok/

The link in the wiki page points to an obsolete version (revision 18) while we are now to revision 65.

ok, what do i do with the files in the ‘services’ folder? upload them as normal?

Forget the services subdirectory and forget the D_Sonos1_UI4.json file if you are running UI5.

I have updated the wiki page.

whoah, quite a change to the UI! I’m getting ‘cannot contact player’ though.

also, amazon has sonos players with a $100 amazon credit this weekend if anyone needs another.

Ok, that means you probably entered a wrong IP address.

Please try this URL in a web browser: http://IP:1400/status/topology replacing IP by your IP
I suppose that this page fails ?

ok, power cycled the zone player device and it is working!! thanks.

I think I have nailed down the problem.

When entering a text it get sent to Vera UTF-8 encoded.
But lua interpret it as ISO 8859-1 which cases it say stratge stuff.

When i enter “ä” it says “ä” which is 8859-1 interpretation of UTF-8 encoded = %C3%A4.

Hope you follow…

So if we can send convert the UTF-8 encoded text to iso 8859-1 we should be home safe :wink:

This should be a general problem though… other plugin should also have this problem I guess.

I don’t think the problem is on the Vera side. If it was, how do you explain that I have the same behaviour when I invoke the UPnP calls through Device Spy ?
But your analysys relative to mismatch between UTF-8 and ISO-8859-1 seems to be the point.

What I checked (read my previous message) is that Google is compatible with UTF-8 and ISO-8859-1 encoded URL.

I just committed few changes relative to the display of media information. One of the change is that we have now the radio name and the track title for exemple for AUPEO! service, or the radio name and the stream for TuneIn. And now only fields with provided value are now displayed in the UI.

@guessed: regarding the call to MusicServices.ListAvailableServices, that is very strange, activating the logs, I can see that the UPnP request is done with a correct return value. But finally the function does not return.
The only thing that I noticed is that the result is a very big string and I see that it is truncated when I log it. Could be a trunc by the log/debug function because the matching is working ?
Is it a problem with my parameters ? Here is how I call the function:

status, tmp = MusicServices.ListAvailableServices({AvailableServiceDescriptorList="", AvailableServiceTypeList="", AvailableServiceListVersion=""})

Looking at the code, it is not clear for me how the output parameters are set with the result of the UPnP request. Is it done indirectly by the call to setmetatable ?

I see in lua library that the UPnP request is done with a forced UTF-8 encoding. Are we sure that the Sonos is not expecting a ISO-8859-1 encoding ? That may explain the problem we have with the Say callback and accents. I will experiment other encoding…

Hek, I thing you are on the right direction. Now I see that the plugin uses a UTF-8 encoding for the UPnP request. Maybe Device Spy uses UTF-8 too.
I will try to force a ISO-8859-1 encoding in the plugin to see if it helps.