Calling Sonos users

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Calling Sonos users

Post by Osler »

The requirements for both server and swremote are pretty minimal. See the main page at http://www.cebotics.com for more detailed information.

What type of Cuwin are you going to use? CE or PC? The complexity of my themes mandates that I use the Cuwin CE device as the client in an RDP connection (memory and graphical limitations of CE). This means you will need to have a server for the SWRemote to run on that the Cuwin will RDP into.

For my HouseBot server box, I use a Via EPIA M10000 (mini-itx) in a small form factor case (512 MB RAM). For my SWRemote server I use a Shuttle SN95 with an AMD Athlon 64 3200+ (2G RAM) with modifications to allow for multiple concurrent RDP connections (currently at 4).

HouseBot continually writes to the HouseBot.mdb file. In addition, my script constantly updates .jpg images for the Now and Next Playing album located in C:\Program Files\HouseBot. This is currently hard-coded. As a result, a solid state drive may not be the best solution, though others have done it.

You should look at some of the new Intel Atom mini-itx boards that are available (inexpensively, I might add). Add a HD and some RAM and you're good to go (around $160-175 US build-cost without case):

http://www.logicsupply.com/categories/m ... intel_atom

Osler
o_sobolev
Member
Posts: 9
Joined: Mon Nov 10, 2008 8:08 am

Re: Calling Sonos users

Post by o_sobolev »

Osler, what do you think of the following configuration: would this be sufficient to meet requirements for your SWRemote theme?

eBox 4300 computer as a server (VIA Eden ULV 500MHz, 512MB DDR2)
http://www.embeddedpc.net/eBox4300/tabi ... fault.aspx
I want to run WinXP Embedded with HouseBot Server and SWRemote on it.

Cuwin3200 CE as touchscreen. It will RDP into eBox. Possibly, there will be a number of Cuwins (2-4), with multiple RDP connections with single eBox.

How do you think will eBox be sufficient for this? Your Shuttle SN95 is far more powerful, but I want to make installation fanless and as small as possible.
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Calling Sonos users

Post by Osler »

I think that will work. Honestly, I was running my Via box as the server and RDPing into 2-3 additional accounts before I switched the swremotes over to the Shuttle. XP vs. XPe shouldn't make a difference. I think roussell is running his server on XPe.

If you run more than one Cuwin you will need to manually change the MAC address on them as they are all shipped with the same MAC address. How to do this is detailed in the manual that came with the Cuwin.

Search my posts for a link to a simple batch program that will enable unlimited RDP sessions in XP via registry modifications and an old copy of termserv.dll. I don't know if this hack works with XPe, though.

Osler
Andrew
Member
Posts: 2
Joined: Wed Apr 08, 2009 5:44 pm

Re: Calling Sonos users

Post by Andrew »

Hi all. I'm not a HouseBot user but I've come here from the Sonos forums after discovering your amazing COM objects for Sonos control. First of all - thanks so much! I've got all sorts of ideas for extra functionality I'd like to implement in my system, the first being a kind of "snapshot" of the system state which you can restore later. To this end I wanted to test out seeking the current track to a new time position but I couldn't find an appropriate function. I've written one (which I've included below) but am I just being blind and missing one that's already in the ZonePlayer.Controller interface?

Andrew

Usage:

Code: Select all

retcode = zp.SeekTime("0:12:34")
Code:

Code: Select all

	Public Function SeekTime(ByVal strRelTime)
		If DeviceStatus = "Offline" Then Exit Function
		On Error Resume Next
		Dim InArg(2)				'As Variant
		Dim OutArg(0)				'As Variant
		
		InArg(0) = 0
		InArg(1) = "REL_TIME"
		InArg(2) = CStr(strRelTime)
		
		Call AVTransport.InvokeAction("Seek", InArg, OutArg)
		If Err <> 0 Then
			SeekTrack = UPnP_Error(Err.Number)
			Err.Clear
			Exit Function
		End If
		SeekTime = "OK"
	End Function
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Calling Sonos users

Post by Osler »

No, I don't think I included one for REL_TIME, but that particular call is used in a hard-coded fashion to move around the queue (don't recall the particular function at the moment). I can add what you have written to the .wsc file very easily. I will try to do that tonight as I was planning on implementing something similar to do just what you are trying to do.

If you are having any other issues or have questions about a particular function, let me know.

EDIT: it is in the SeekTrack function, but I use TRACK_NR. I will try to add the additional seek functions. I think there is one more in addition to the one you are interested in.

Osler

EDIT2: See attached for a new .wsc with your function added. I didn't add a SECTION function as I am not entirely clear what it does at the moment.
Attachments
ZonePlayerController.zip
(11.1 KiB) Downloaded 471 times
Andrew
Member
Posts: 2
Joined: Wed Apr 08, 2009 5:44 pm

Re: Calling Sonos users

Post by Andrew »

Thanks for the quick response. I actually did find your SeekTrack function - that's what I copied to implement SeekTime, hence the remarkable similarity in the code...

I think SECTION is for Audible audio books (and possibly enhanced podcasts) which have "chapter" markers within the one file - you can skip backwards and forwards to a different chapter. I've got a couple of Audible books so I might try that out.

I'm very impressed by the scope of this - suddenly Sonos integration and enhancement looks a lot more feasible. I had been looking at using the SonosWeb perl system and programmatically making http calls to that but it would have been messy.

Andrew
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Calling Sonos users

Post by Osler »

Sonosweb is what I started out with but I wanted to control it externally. I couldn't come up with a "non-messy" way to do it, hence the COM object. I was inspired by what MikeD was doing at Homeseer, but didn't like the idea of having a non-open source type approach. That is just counter to the attitude of the DIY HA people I know.

The only thing left to do is integrate RadioTime and the music services. The indexing appears to be handled with SOAP calls by the ZonePlayer itself since none of the info is stored internally. There are issues with user names and passwords and other stuff that makes it kind of a pain in the a$$ to reverse engineer, though.

Osler
vcruz777
Member
Posts: 70
Joined: Sun Jul 08, 2007 9:39 pm

Re: Calling Sonos users

Post by vcruz777 »

I have three Sonos Zones. I have the Housebot PC connected to the Pool Zone. What I would like to do is to be able to announce HouseBot Text-to-Voice Messages in any Zone I choose. I can manually set any zone to the line-in in the Pool Zone with the Sonos controller but I was wondering if there is a way to do it with the script. I have seen in a Homeseer post that somebody did it (pause the music, announce the message and then resume music). With the current script I am able only to do it with the zone the PC is connected to but not to set any other zone to the line-in connected to the Pool Zone. (At least not automatically). I hope you can understand my request. Is this something that can easily be scripted?

Thanks in advance,

Victor
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Calling Sonos users

Post by Osler »

I will have to play with line in to see. It should be "easy". I just need to figure out how to do it. I think it will probably take a day or 2 to get out....just need to find the extra time.

Osler
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Calling Sonos users

Post by Osler »

Ok, try this as an initial work around. I can add code to the script a bit later.

Create a task that changes the ZPPlayNowURI of the ZonePlayer you want to announce on to

Code: Select all

x-rincon-stream:RINCON_XXXXXXXXXXX
where RINCON_XXXXXX is the unique device name (UDN) of the ZonePlayer whose line-in you want to use minus "uuid:".

So if the line-in source is on the Pool zone, use its ZonePlayers UDN to set the the ZPPlayNowURI property for all Zones that should play the announcement.

This should set all required ZonePlayers to stream from the "announcing" ZonePlayers line-in source.

I will need to add some logic to take a snapshot of each ZP (queue, track that is playing, position in track, etc.) so that those can be reset after the announcement has completed.

Osler
vcruz777
Member
Posts: 70
Joined: Sun Jul 08, 2007 9:39 pm

Re: Calling Sonos users

Post by vcruz777 »

I tried it but it didn't work. It basically sets the zone to [no music] instead of stream. Thanks for the quick reply.
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Calling Sonos users

Post by Osler »

Ok...I will have to play with it. I don't currently have line-in set up on any of my zones so I will have to find something to attach to a zone. Give me a bit as I've got some other things on my plate at the moment.

I take it the script is performing in an acceptable manner otherwise. Are you still having periodic disconnections as you previously reported?

Osler
vcruz777
Member
Posts: 70
Joined: Sun Jul 08, 2007 9:39 pm

Re: Calling Sonos users

Post by vcruz777 »

Thanks. I am still having disconnects but learning to live with them. I am restarting housebot every day to help a little bit. There is one particular instance that I can predict it will disconnect. It has to do with playing music from a music service. Although I cannot see the music services from the script, I have set, using the sonos controllers, playlists of music from napster that then I can play from housebot. When I play those playlists from Housebot it starts playing but immediately the script disconnects. I then reset housebot and everything works fine again. This happens everytime I play those playlists after being in idle for a long time. Not sure if it can point to something but I thought it was interesting.

Thanks again for your continuous support,

Victor
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Calling Sonos users

Post by Osler »

Do you see anything in the log files after an episode like this?

Osler
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Calling Sonos users

Post by Osler »

Victor:

Follow the instructions I posted previously for task creation and the new version of the script (2.0.4a, see first post) should allow you to set a streaming source for a ZonePlayer via this task. I will add some more code to enhance this as an announcement feature. However, this should get you something to play with. The prior version of the script didn't know what to do with a URI preceded by "x-rincon-stream:", hence the issues you experienced.

Osler
Post Reply