Premise Extrange premise behaviour --> one way IP communication.....

Motorola Premise

jrutllant

New Member
Hello all,

I am new to Premise and just starting.

First let me thank all of you for the excellent forum and keeping alive this HA System. So far I am very very impressed with it, I have tried HomeSeer, Elve, Mcontrol and let me tell you that Premise seems to be absolutelly in another leage, way way more sophisticated and well designed, I just dont undestand why it was cancellled. Any way I have been seing its features and it is more than enough for what I want.

I have been watching the videos, reading & reading & reading.

I have managed to install the server in a Windows Vista machine and (I think is running OK). I use the Home COntrol Builder and have been able to do a couple of things, no problem.

I have just hit a very extrange behaviour and would like to ask you if you know what could it be.

I have an ONKYO TX-NR808 that can be controlled through IP. I followed the good instructions here in the forum to have it configured as a custom device using the integra module "integra_serial_v2.xdo" then I proceed to create a Lantronics UDS10 and assigned the Onkyo IP to the Port 1 on the UDS10 and Port 60128 into the port. I created a receiver and assigned the serial comunication property to port 1 on the UDS, the PortStatus in the receiver says: Port(Opened), communications failure : false. So far so good.

I opened the port spy to Port 1 and try to turn on the receiver, I see !1PWR01 getting out (twice: one brown one green), the receiver does not turn on and nothing else is shown in the spy.

I have been trying to debug but nothing, and I just discover that if I mannually do stuff in the receiver I get all those things I am doing into the port spy ! in black as messages in the integra format.

So, I have concluded that the physical connection is done and OK since the receiver can send to the UDS10 and I see those in the spy, but for some reason when I try to send messages to the 808 they dont go through.

Any ideas or help is really appreciated, I would really like to give Premise a chance.....but this is obviously a show stopper.

Many Thnaks,
Jorge.
 
Hi Jorge, welcome to Premise!

I think the issue is that the protocol over IP on the Onkyo/Integra units is different from that of the RS232 protocol (I don't know this for sure). I believe you will need to create a custom module to do what you're trying to do if you want to control it over ethernet.

If you have an RS232 port on the Onkyo, I would try a Lantronix WiBox (from ebay). Then connect the UDS10 device in Builder to the WiBox. The WiBox is an ethernet or wifi serial controller and they're pretty cheap on ebay every now and then.

If you know that the ip protocol is the same and ascii based, I would ensure the Onkyo uses a socket port and that the port number is correct. Let me know if the documentation says the protocol is the same and I'll try this with my TX-NR905.
 
Thanks for the prompt response etc.

I do not know for sure that the the IP & Serial protocols are the same, it is a good point. I can tell you that when I move stuff on the Onkyo (i.e. volume,change sources, etc...) I see the Spy receiving lists of caracters that contain the same type of strings that are described in the protocol, for example (doing cut & paste from the spy) :

"ISCP



!1PWR01



ISCP



!1LMD0C



ISCP!1TFRB00T+A



ISCP



!1PWR00"

There are additional control carachters that are lost when I do the paste.

I probably missunderstood the comments and instructions for the Integra stuff. My impression was that you have done succesfully exactly what I am trying to do : control the Onkyo (Integra) directly through TCP/IP (without anything in between, I mean using only the network port in the premise PC and the network port in the Onkyo). I think I was wrong then.

Has anyone achieved what I am trying to do in Premise ?. In the case of the other software packages (Homeseer, Elve, etc....) it is really trivial to do.

Many thanks,
Jorge.
 
Any chance you can email or post a print screen of what's in the portspy window?

Also, could you post a link that point to the integra drivers you are using? I think there are at least four versions:

1. An XDO used in one of the videos by Damon
2. A native plug-in developed by Damon (I think it's in a zip file he posted)
3. A version I posted
4. A version that Chuck posted

What I think is happening is the line terminators aren't compatible.
 
Another question: do you see anything at all on port spy when Premise sends a command to the Onkyo?

I didn't mention it and should have, but an even better device to buy instead of the Lantronix Wibox is this thing:
http://www.globalcache.com/products/gc-100/models1/

They are cheap and offer IR, RS232 and contacts, all over the network.

Here's what an excel file says that I got from Onkyo in 2009:
1.2. ISCP over Ethernet (eISCP)
*Protocol is TCP(Transmission Control Protocol)
*Destination Port Number is 60000(default)

Please set the destination port number by the setup menu in the Receiver and turn off to stand-by once, If you need to change it from default.
*Receiver MAC Address

Please confirm the Receiver MAC address on the setup menu in the Receiver.
*eISCP Packet Format

Header Size is the size of eISCP Header. In order to extend header size in the future, it is necessary to take it into calculation. Now, it is 0x00000010. (**BIGENDIAN**)
Data Size is the size of the eISCP Data. (**BIGENDIAN**)
Version is ISCP version. Now, it is 0x01.
Reserved is used extending it in the future. Now, it is 0x000000.
Unit Type is the model category ID. The Receiver is "1".

Note: The communication between server and client should hold one connection continuously. Unless it has connected continuously, the notice of status cannot be performed from a client.
Note: The number of the connections who can connect with a client is one.
Note: The Interval Time Receiving the message needs to take more than 50msec.

Why what your trying to do will not work:
Note that in order for the Onkyo to receive a valid packet, it needs the IPSC header as specified (see image). Since the IPSC header is not necessary for RS232 communications, I doubt any of the modules posted calculate it (I could be wrong). However, I'm hoping one of the four drivers already posted gives the IPSC header (there could be some option you need to enable). If it was working, you should see IPSC followed by a bunch of other stuff whenever SYS sends a command.

You can modify the integra module to build this IPCS header, but it would take some experience with SYS and vbscript. The issue is you would have to use binary data (not ascii) as the header contains two size values (one for the header, one for the data). Since you can't mix ascii and binary in the same module, you'd have to rewrite a lot of the code that's there and can't use the wizard to the driver.

PS: If I had to pick which driver to use, I'd use this one by Damon with a GC-100. It's a native driver, so the code is not exposed though. However, native add-ins run in their own thread. Unlike the modules that all run in a single thread.
http://www.cocoontech.com/forums/index.php?autocom=downloads&showfile=114
 

Attachments

  • onkyoIPCS.jpg
    onkyoIPCS.jpg
    46.3 KB · Views: 3
I was thinking about this idea of IP control more and have even more questions:

1. Have you used this method on other AV devices (I'm interested in Samsung TVs specifically)?

2. How does power on/off work? I was under the impression that most AV devices probably cut power to their ethernet port when they are off? I'm sure Onkyo did things right, but what about other manufacturers?
 
Etc & Chuck,

Again, many thanks for your responses, you are totally correct on many fronts :

1. I thought the instructions on some posts to connect to an integra through the uds10 technique (only software) was for doing what I wanted (pure IP to IP communication between premise server & Onkyo), I tend to think now that the premise is correct (I am getting these things IP commmunicated, see below) but the Onkyo protocol for Serial & IP is different.

2. The VBScript I used is "integra_serial_v2.xdo", I decided against the dll because given that this is an unsuported system I believe to have access to customize the code is paramount for me.

3. From what I can see in the spy windows these things are in fact "connected", at least at the physical, TCP & IP layers, I say this because : when I press "On" in the integra device I see in the spy the proper serial command going out (without any response though), the key to my thinking that the layers are OK is because when I touch anything on the Onkyo I receive a message on the spy, the message is probably formatted as many of the threads you pointed me to say, there is a different header when talking through TCP/IP but the command is in fact within the received message.

4. I have not taken a look at the code yet but given the results I tend to think that capturing the place where the code actually sends/receives the serial string and enriching the record to comply with the IP Onkyo protocol could do the trick. BUT what would really be nice is to have instead of a serial conversation a direct IP to IP conversation between premise server and the Onkyo, I am guessing it should not be that difficult starting with the serial routines. One question I have here is that I dont know if you can within VBSript handle IP connections, if this is not possible then serial should be.

5. About turning on and off the Onkyo through IP only I can confirm that this is possible, I have done it (and much more) using the ELve software that has a good driver for the Onkyo. The only "trick" for me was to make sure within the network configuration of the Onkyo I checked to allow IP control on it, just put the IP address and port number on the Elve driver and voila the Onkyo was doing what I commanded it through the Elve software.

6. This are my very first steps with premise and I have not done this with any other equipment, I am such a beginner that I can confess that I have not yet seen any code.

Again, thanks a lot for your helpfull responses and the links that really are right on the money on what I am trying to do.

As most of you (I think) time is very scarce for me, if I do advance on my search I will post the news.

Best Regards,
Jorge.
 
Normally, vbscript cannot create/handle IP packets directly. However, if the device uses socket communication over IP (e.g. the UDS10 trick shows the data through port spy in Builder), vbscript can handle things (as you've figured out) and the UDS10 virtual device can handle the rest transparently.

You would need to do the following:
1. change the serial receipt type from text to binary (modify RxMode property)
2. change the worker object (inherits from schema.Device.Serial.Command) as necessary
3. write a method that converts the ascii commands to text
4. write a send method that adds the appropriate command headers (this will probably call several sub methods to calculate checksum etc...)
5. write onchange scripts for every property that uses the worker object to send binary data

To make things worse, you can't use RxTextLineTerminators with binary data (SYS will not do it). This means for any response from the Onkyo you manually have to keep track of how many bytes there should be and grab the correct number of bytes from the buffer. This involves creating another method to figure out how many bytes to grab and calling this method from OnChangeOnNewData

To start, I'd recommend hard coding a few binary commands like on/off first to make sure the UDS10 trick will work (I think it will). I could be wrong and the checksum the documentation talks about might be represented in ascii (e.g. the hex value checksum is given in ascii form. In other words for a checksum of FF you would see the ascii characters FF in portspy with the raw data being 46 46). This is why it's so important to figure things out manually first, then develop the methods as I've seen packets done both ways. This is really why I wanted you to post a screen capture of port spy so we'd know for sure ;) Hopefully you can do everything in RxTextMode as it would be easier.

4. I have not taken a look at the code yet but given the results I tend to think that capturing the place where the code actually sends/receives the serial string and enriching the record to comply with the IP Onkyo protocol could do the trick. BUT what would really be nice is to have instead of a serial conversation a direct IP to IP conversation between premise server and the Onkyo, I am guessing it should not be that difficult starting with the serial routines. One question I have here is that I dont know if you can within VBSript handle IP connections, if this is not possible then serial should be.
 
Dear all,

I have taken a look at the code embedded in "integra_serial_v2.xdo" (and others built into Premise) and I must say that I am very surprised at the very little amount of code there. This got me thinking that perhaps I am going about learning Premise the wrong way.

I think I am focusing on a minor element that Premise is not capable (out of the box) of doing: having direct IP to IP communication with the Onkyo receiver, but from what I can see Premise has all I need (and much much more) out of the box with this small exception.

So, seems to me that if I focus on changing the scripts etc.... (which I may or may not be capable of) I will be missing the oportunity to learn more about what Premise is able to do "out of the box" and by doing this I may end up "programming" more than needed and probably without reusing the great functionalities the Premise framework implements.

My dream is to have many elements of automation done at home (lights, weather, sensors, entrance,etc....) but so far I have the elements to start with the media center (HDTV Plasma tv, cable box, Onkyo receiver, Blue Ray, WD LiveHub) also I have a Sonos system around the house. On the other hand for automation I have a Windows Vista Laptop and a USBUIRT to control.

So I think it is more smart from my part to start by cutting my hands in the programming domain (I am a computer engenieer) and use the time to explore with the media center automation example the wonders of this System, then when I have really learned the framework try to explore the ways in which to change it (not the other way around).

I know this may sound a bit filosophical and not really specific but I would really appreciate your more experienced thoughts & advice.

Many Thanks,
Jorge.
 
Back
Top