We have moved at community.getvera.com

Author Topic: Morphing the Sonos plugin into a Squeezebox plugin  (Read 12398 times)

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #15 on: April 11, 2012, 12:09:00 pm »
@trouty00,

Please find attached my modifications.
Set the MAC addresses in I_Sonos1.xml to the MAC address of your player (IP address might work, too).

@guessed,

Yes, the 'UPnP Lib' is clean.

Quote
If I remember correctly, the Squeezebox has some extra query-string based parameters that might cause some problems and/or need for augmentation of the Lib.

No need to augment the lib, but we don't need the lib anymore: we know how to fix UPnP devices wrongly imported by MiOS.

Quote
... but I'm a little confused.  Your posting the other day implied you'd found the nirvana solution to UPnP in Vera.  If you've cracked that nut, why are you still going down this route?

Yes, I've cracked the MiOS-UPnP nut - and only GENA separates me from MiOS-UPnP nirvana.  :)

No, I won't invest any more time in writing and modifying Luup device drivers for devices that are UPnP compliant.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #16 on: April 11, 2012, 12:20:09 pm »
Quote
All I really want to achieve (for now) is that a plugin is polling the media server to find out the player status so i can turn on an amp when a particular player is playing.

That's an very easy one:

Install LMS 7.7.2 or later version,
enable UPnP support in LMS,
fix UPnP support in LMS if necessary (see first message in this thread),
import your LMS player(s) as UPnP devices via MiOS,
fix the player device(s) imported via MiOS using my instructions,
use luup.call_action for urn:upnp-org:serviceId:AVTransport / GetTransportInfo,
the return argument you're intested in is CurrentTransportState.

Edit:
Untested, but should work if the native UPnP support in LMS is sufficiently mature.
« Last Edit: April 11, 2012, 12:24:58 pm by Ap15e »

Offline trouty00

  • Full Member
  • ***
  • Posts: 207
  • Karma: +2/-1
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #17 on: April 11, 2012, 01:22:34 pm »
@Ap15e,
           
ok so i found your fix thread over at http://forum.micasaverde.com/index.php/topic,10165.0.html but Im stuck at the point to download the SCPD manually, not sure how I go about doing this.

I have found the correct file and first had to unencrypt, I guess once i have the correct SCDP file I can then make the changes required and then i just need to figure out a way to re-encrypt otherwise I'm guessing vera will be confused!

I really appreciate your help with all of this but it shouldn't have to be this complicated!

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #18 on: April 11, 2012, 07:19:10 pm »
In situ download: use wget

... or use a web browser of your choice and upload the file to Vera.

Offline trouty00

  • Full Member
  • ***
  • Posts: 207
  • Karma: +2/-1
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #19 on: April 12, 2012, 03:09:46 am »
I did try to pul the file down using a web browser but got page not found, I'm thing now that the code you provided probably needs to be tweaked and the bit before av transport needs to match the uid of the upnp device which I added. I have found the un in the device JSON file so Will try when I get home tonight. Feel a little stupid but all a learning excercise!

<SCPDURL>
  http://192.168.X.Y:31416/"change to udn of upnp device created"/AVTransport/scpd.xml
</SCPDURL>

Upnp is definitely working as I can utilise it from the iPad and see it within windows media player.

Offline trouty00

  • Full Member
  • ***
  • Posts: 207
  • Karma: +2/-1
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #20 on: April 12, 2012, 04:14:19 pm »
ok still struggling here, put in the correct UID both from a browser and wget in linux and just doesnt find the file, is the 31416 port squeezebox native or a whitebear port?

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #21 on: April 12, 2012, 05:58:24 pm »
Port 31416 is WMS-UPnP and not LMS-UPnP native.

You must 'MiOS-import' the UPnP device(s) provided by LMS-UPnP native first,
then find the corresponding D_FUP*.xml file(s) and fix it/them.

The fixing algorithm is outlined in detail at: http://forum.micasaverde.com/index.php/topic,10220.msg70052.html#msg70052.

Offline trouty00

  • Full Member
  • ***
  • Posts: 207
  • Karma: +2/-1
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #22 on: April 13, 2012, 10:28:25 am »
Hi Ap15e,
           so I have a little more feedback. Here are steps I have taken

0. Delete all previous D_FUP ** files.
1. enabled UPNP, prove it works by using it from ipad media connect app and can play song to the players
2. MIOS>Devices>Add Device>UPNP Device> ADD "Lounge" Did not reload shows up and have my FUD file with space "D_FUP_uuid CDC684BE-D499-B1D2-C015-33E791C6B8C1.xml.lzo" when looking via WINSCP.
3. run your script making the following substitution
Code: [Select]
local device_definition_file  = 'D_FUP_uuid CDC684BE-D499-B1D2-C015-33E791C6B8C1.xml'

--
-- END user-adjustable variables

4.Sent Successful
5.WinSCP now shows 3 additional files - D_FUP_uuid_CDC684BE-D499-B1D2-C015-33E791C6B8C1_1.xml, ***_2.xml and ***_3.xml all only 7 bytes each and I cant seem to open them but all three files are referenced in the new D_FUP_uuid CDC684BE-D499-B1D2-C015-33E791C6B8C1.xml file
6. try to go to advanced scene and add 'Lounge' i get invalid JSON
7. RELOAD.
8.Once I reload all of the 3 files are no longer there.
9. I can now add the device without the JSON error but there is no functionality available.

Sorry to have to keep hassling you but I'm struggling!

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #23 on: April 13, 2012, 11:33:36 am »
Quote
3. run your script making the following substitution

My script is tailored for WMS and I don't claim that the script works for other UPnP devices/abstractions. I thought I made it clear that my script has to be generalized (by using a full fledged XML parser or some other algorithm) to be of general use.
« Last Edit: April 13, 2012, 11:37:06 am by Ap15e »

Offline trouty00

  • Full Member
  • ***
  • Posts: 207
  • Karma: +2/-1
Re: Morphing the Sonos plugin into a Squeezebox plugin
« Reply #24 on: April 13, 2012, 12:00:00 pm »
argh, I guess I missed that bit! in that case I guess I'm sh*t out  of luck until MCV pull their finger out. Roll on Fibaro Home Center sorting out there squeezebox plugin.