Author Topic: Current Status of Insteon PLM Integration  (Read 11949 times)

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #30 on: December 26, 2007, 03:18:52 am »
I think I found what I need to do...

It's in the wiki under Plug&Play...

The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5499
  • DOES work for LinuxMCE.
    • View Profile
Re: Current Status of Insteon PLM Integration
« Reply #31 on: December 26, 2007, 06:12:01 am »
holy shit, dude! you rock!!!!

damn it, i'm itching to code on my mame plugin :-/

-thom

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #32 on: December 26, 2007, 06:26:58 am »
Merry Christmas Thom!
Hope your feeling better..

Thanks for the comments.. it's always uplifting when you post! :)

I've now had about 3 people enquire about beta testing the PLM interface..
To those people:
  I haven't forgot about you, cam across a couple bugs that lock the driver up..
(access points)

I want to fix those before I release more code...

Dan
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5499
  • DOES work for LinuxMCE.
    • View Profile
Re: Current Status of Insteon PLM Integration
« Reply #33 on: December 26, 2007, 06:29:49 am »
we need to get together and start documenting our work

1. how to add support for other home automation systems
2. how to create support for a new type of media

;)

-Thom


PeteK

  • Guru
  • ****
  • Posts: 408
    • View Profile
Re: Current Status of Insteon PLM Integration
« Reply #34 on: December 26, 2007, 03:56:46 pm »
Heh, Pete, We're definately on the same page!

I just slapped together a quick script: InsteonPLM.sh
#!/bin/bash

echo "Insteon PLM Detection Script  queue $2"
/usr/pluto/bin/TestSerialPort -p $3 -P N81 -b 19200 -t "\02\60" -i 5 -s
"\03\05"
if [[ "$?" -ne 0 ]]; then
echo "It's not a PLM"
/usr/pluto/bin/MessageSend dcerouter -r 0 $1 1 806 224 $2 13 "$4" 44 0
else
echo "It is a PLM"
/usr/pluto/bin/MessageSend dcerouter -r 0 $1 1 806 224 $2 13 "$4" 44
1901
fi


I can definately send a 0x02 0x60 - which is Get IM Info..
This should respond with
ie 0x02 0x60 0x11 0x11 0x11 0x03 0x05 0x53 0x06 where:
02 60 is the command echoed back
11 11 11 is the PLM's Insteon ID
03 05 is the Cat / Subcat (This is the Identification)
53 is the firmware version
06 is ACK

I haven't tested it yet.. still working on it.

I copied most of that from the 60_apex configure script..

I will try it with the hex values.. if it fails, I should be able to 'build' a string consisting of those hex values in sh.

Dan

Dan--
I believe hat the arguments you used above will send the ACII characters '0' and '2', then '6', '0'.  I think the PLM accepts hex values for commands, correct?

-Peter

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #35 on: December 26, 2007, 11:41:58 pm »
I'll double check that.. I was basing it off of TestSerialPort's help display...
I haven't tested this script yet..

The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #36 on: December 27, 2007, 10:56:53 am »
Ok, I'm frustrated, and have a REALLY sore neck..
12 hours of debugging, and I'm NO CLOSER..
I guess all that forward progress came to bite me in the a$$.

I think I need a break, G'night all..  I'll make another attemp tomorrow.

Dan

The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #37 on: December 28, 2007, 03:00:12 am »
<hmm of relief>
Well, I guess I just needed to sleep on it..

I solved my timing issue (I think), and was able to make the code even more reentrant.. (!)

What it did before, was run through the spider, finding all FIRST LEVEL devices (ie devices it knows about, and all devices in THOSE devices databases)

Now, it essentially 'loops' if it detects a new device (at the end of the routine).  All detected devices are then KNOWN..

It has to download the all the databases.. but is seems to work quite well now.

I've only implemented the "report Child Devices" as a test routine..
(This was what was giving me such a headache, it WAS finding all the devices, but didn't store their configuration, so when I called that routine, it lost some devices because it couldn't figure out the template to use...)

Now, off to PLUG&PLAY world..
Things <should> go a bit smoother now...

Regards,
Dan
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #38 on: December 28, 2007, 03:01:09 am »
BTW, the code is now over 2000 lines...  ;D
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #39 on: December 28, 2007, 05:10:18 am »
It seems I'm not quite understanding the PNP side...
I send the commands as per the wiki but it's hard to determine which commands are REQUIRED.

I follow it up with a Done Detecting Devices...
the PNP log says it's doing a GOTO screen 116... but there's no activity on the MD..

Can anyone who has implemented PNP chime in here and maybe point me in the right direction?

Thanks,

Dan
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #40 on: December 28, 2007, 05:11:48 am »
Oh, yeah. heh, here's my TEST code...
Code: [Select]
  myDevFrom = device_.devid_
  myDevTo = -1001
  myDevPriority = 1
  myDevType = 2 #event
  myDevID = 65 # Device Detected
  #create command
  cmd = Command.new(myDevFrom, myDevTo, myDevPriority, myDevType, myDevID)
  #Add params...
  cmd.params_[56] = "72" # environment
  cmd.params_[49] = "38" # Light (dimmable)
  cmd.params_[55] = "12|0A.97.0B\n" # test lamp module
  cmd.params_[13] = "TEST LampLinc V2" # text to display
  cmd.params_[52] = "10"
  cmd.params_[53] = "3"
  cmd.params_[54] = "pnpserialnumber"
  cmd.params_[59] = "Insteon PLM"
  SendCommand(cmd)
  #Now, Fire the Done Detecting event...
  cmd = Command.new(myDevFrom, myDevTo, myDevPriority, myDevType, 74) #Done detecting...
  cmd.params_[59] = "Insteon PLM"
  SendCommand(cmd)
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #41 on: December 28, 2007, 05:28:41 am »
and here's the log...  This is right after a fresh reboot, with NO lighting devices..
Code: [Select]
07 12/27/07 21:01:32.310 Event #65 has no handlers <0x7fdf9b90>
07 12/27/07 21:01:32.310 Received Message from 37 (PLM / Office) to -1001 (unknown / ), type 2 id 65 Event:Device Detected, retry none, parameters: <0x7fdf9b90>
07 12/27/07 21:01:32.310   Parameter 5(Mac Address):  <0x7fdf9b90>
07 12/27/07 21:01:32.310   Parameter 13(Text): TEST LampLinc V2 <0x7fdf9b90>
07 12/27/07 21:01:32.311   Parameter 28(IP Address):  <0x7fdf9b90>
07 12/27/07 21:01:32.311   Parameter 49(PK_DeviceTemplate): 38 <0x7fdf9b90>
07 12/27/07 21:01:32.311   Parameter 51(VendorModelID):  <0x7fdf9b90>
07 12/27/07 21:01:32.311   Parameter 52(PK_CommMethod): 10 <0x7fdf9b90>
07 12/27/07 21:01:32.311   Parameter 53(PK_PnpProtocol): 3 <0x7fdf9b90>
07 12/27/07 21:01:32.311   Parameter 54(PNP Serial Number): pnpserialnumber <0x7fdf9b90>
07 12/27/07 21:01:32.311   Parameter 55(DeviceData): 12|0A.97.0B
 <0x7fdf9b90>
07 12/27/07 21:01:32.311   Parameter 56(Category): 72 <0x7fdf9b90>
07 12/27/07 21:01:32.311   Parameter 59(Signature): Insteon PLM <0x7fdf9b90>
07 12/27/07 21:01:32.339 Event #74 has no handlers <0x7fdf9b90>
07 12/27/07 21:01:32.339 Received Message from 37 (PLM / Office) to -1001 (unknown / ), type 2 id 74 Event:Done Detecting Devices, retry none, parameters: <0x7fdf9b90>
07 12/27/07 21:01:32.339   Parameter 59(Signature): Insteon PLM <0x7fdf9b90>
08 12/27/07 21:01:33.321 Received Message from 37 (PLM / Office) to OnScreen Orbiter(20),Generic Proxy Orbiter(51), type 1 id  809 Command:Display Alert, retry none, parameters: <0xa1e50b90>
08 12/27/07 21:01:33.321   Parameter 9(Text): 33429 Confirming 72Light Switch (dimmable) <0xa1e50b90>
08 12/27/07 21:01:33.321   Parameter 70(Tokens): pnp_33429 <0xa1e50b90>
08 12/27/07 21:01:33.321   Parameter 182(Timeout): 3 <0xa1e50b90>
08 12/27/07 21:01:33.321   Parameter 251(Interruption): 2 <0xa1e50b90>
08 12/27/07 21:01:33.327 Received Message from 14 (Plug And Play Plug-in / Office) to OnScreen Orbiter(20),Generic Proxy Orbiter(51), type 1 id  741 Command:Goto Screen, retry none, parameters: <0xa1e50b90>
08 12/27/07 21:01:33.328   Parameter 159(PK_Screen): 116 <0xa1e50b90>
08 12/27/07 21:01:33.328   Parameter 163(Description): Light Switch (dimmable)(Pluto / Lighting Device) <0xa1e50b90>
08 12/27/07 21:01:33.328   Parameter 224(PK_PnpQueue): 33429 <0xa1e50b90>
08 12/27/07 21:01:33.328   Parameter 251(Interruption): 3 <0xa1e50b90>
08 12/27/07 21:01:33.328   Parameter 252(Turn On): 0 <0xa1e50b90>
08 12/27/07 21:01:33.328   Parameter 253(Queue): 1 <0xa1e50b90>
08 12/27/07 21:01:33.338 Received Message from 20 (OnScreen Orbiter / Office) to 6 (Datagrid Plug-in / Office), type 1 id 35 Command:Populate Datagrid, retry none, parameters: <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 4(PK_Variable): 0 <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 5(Value To Assign):  <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 10(ID): 1 <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 15(DataGrid ID): pnp_20 <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 38(PK_DataGrid): 44 <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 39(Options): 33429 <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 40(IsSuccessful): 1 <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 44(PK_DeviceTemplate): 0 <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 60(Width): 3 <0x7c5f2b90>
08 12/27/07 21:01:33.338   Parameter 61(Height): 5 <0x7c5f2b90>
05 12/27/07 21:01:33.339 Plug_And_Play_Plugin::PNPDevices Parms=33429 returning sole device template 38 Light Switch (dimmable) <0x9863db90>
08 12/27/07 21:01:33.345 Received Message from 51 (Generic Proxy Orbiter / ) to 6 (Datagrid Plug-in / Office), type 1 id 35 Command:Populate Datagrid, retry none, parameters: <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 4(PK_Variable): 0 <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 5(Value To Assign):  <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 10(ID): 1 <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 15(DataGrid ID): pnp_51 <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 38(PK_DataGrid): 44 <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 39(Options): 33429 <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 40(IsSuccessful): 1 <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 44(PK_DeviceTemplate): 0 <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 60(Width): 3 <0x7ddf5b90>
08 12/27/07 21:01:33.345   Parameter 61(Height): 5 <0x7ddf5b90>
05 12/27/07 21:01:33.346 Plug_And_Play_Plugin::PNPDevices Parms=33429 returning sole device template 38 Light Switch (dimmable) <0x9863db90>
08 12/27/07 21:01:33.386 Received Message from 51 (Generic Proxy Orbiter / ) to 6 (Datagrid Plug-in / Office), type 1 id 34 Command:Request Datagrid Contents, retry none, parameters: <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 10(ID): 2 <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 15(DataGrid ID): pnp_51 <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 32(Row): 0 <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 33(Column): 0 <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 34(Row count): 5 <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 35(Column count): 3 <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 36(Keep Row Header): 0 <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 37(Keep Column Header): 0 <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 49(Add Up-Down Arrows): 1 <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 73(Seek):  <0x7ddf5b90>
08 12/27/07 21:01:33.387   Parameter 74(Offset): 0 <0x7ddf5b90>
08 12/27/07 21:01:33.414 Received Message from 20 (OnScreen Orbiter / Office) to 6 (Datagrid Plug-in / Office), type 1 id 34 Command:Request Datagrid Contents, retry none, parameters: <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 10(ID): 2 <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 15(DataGrid ID): pnp_20 <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 32(Row): 0 <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 33(Column): 0 <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 34(Row count): 5 <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 35(Column count): 3 <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 36(Keep Row Header): 0 <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 37(Keep Column Header): 0 <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 49(Add Up-Down Arrows): 1 <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 73(Seek):  <0x7c5f2b90>
08 12/27/07 21:01:33.415   Parameter 74(Offset): 0 <0x7c5f2b90>
05 12/27/07 21:01:55.808 Socket::ReceiveData 0x73c2de88 failed, bytes left 0 start: 1560000 1: 0 1b: 0 2: 0 2b: 0 m_Socket: 180 Incoming_Conn Socket 180 192.168.80.3 <0x65be3b90>
05 12/27/07 21:01:55.808 Socket::ReceiveString2 ReceiveData failed m_Socket: -1 Incoming_Conn Socket 180 192.168.80.3 <0x65be3b90>
05 12/27/07 21:01:55.808 TCPIP: Closing connection to -1003 (Router Dev #0) 0x73c2de88 m_Socket: -1 <0x65be3b90>
05 12/27/07 21:01:55.809 Router::RemoveAndDeleteSocket 0x73c2de88 -1003 <0x65be3b90>
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #42 on: December 28, 2007, 12:47:08 pm »
BuMp

HeLp!
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Current Status of Insteon PLM Integration
« Reply #43 on: December 28, 2007, 07:50:18 pm »
Ok, after MUCH trial and error, I think I figured out how to activate that DAMN wizard...

I was successful in getting it to execute ONCE that I know of...

The problem is that I munched my whole configuration, probably trying to figure it out...

Eventually, I went down to the core, and there it was, waiting for me to click 'Light'

I tried to clean up my MD's, but then it said my CORE was in my living room... EEK!

So, backed up all my code, and re-installing 0704 fresh..

Then, I can retry my code..

If all goes well, I should have a PnP Insteon PLM Driver later today! Ready for TESTING...

Will keep you all informed..

Regards,

Dan
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

PeteK

  • Guru
  • ****
  • Posts: 408
    • View Profile
Re: Current Status of Insteon PLM Integration
« Reply #44 on: December 28, 2007, 11:18:02 pm »
Looking at the TestSerialPort code, i noticed that there is no detection mechanism in there for sending hex values.  My guess is they planned to implement it, but did not finish.  I'm working on extending it to support the PLM, which will require hex send and probably a way to receive values and correctly work the compare, ignoring address bytes.