Insteon control with AMX - Hexadecimal string problems
danieldrew1
Posts: 31
I posted this somewhere else in the forum but this seems to be more correct of a location for it.
Hi, I am a bit new to AMX programming and am trying to put a system together with multiple control types.
I am stuck on setting up my lighting control. I am using RS232 control of Insteon lighting. I have their developers kit to explain the communication protocol. I have initialized the correct port with baud rate etc.
In sending the command string, I get no results. The string is hexadecimal, (02 62 11 11 11 05 11 FF).
When sending this string through Docklight Scripting software, the light responds correctly.
I have had success with serial control of other devices with a literal string. I am not sure what I am missing, if I have to separate the bits or something. The controller is flashing the TX light when the GUI button is activated but the light does not respond. Does AMX require something done when hexadecimal is being sent?
Hi, I am a bit new to AMX programming and am trying to put a system together with multiple control types.
I am stuck on setting up my lighting control. I am using RS232 control of Insteon lighting. I have their developers kit to explain the communication protocol. I have initialized the correct port with baud rate etc.
In sending the command string, I get no results. The string is hexadecimal, (02 62 11 11 11 05 11 FF).
When sending this string through Docklight Scripting software, the light responds correctly.
I have had success with serial control of other devices with a literal string. I am not sure what I am missing, if I have to separate the bits or something. The controller is flashing the TX light when the GUI button is activated but the light does not respond. Does AMX require something done when hexadecimal is being sent?
0
Comments
Second, you really do need training, this question is the tip of the iceberg.
DATA_EVENT [dvInsteon]
{
ONLINE:
{
SEND_COMMAND dvInsteon, "'SET BAUD 19200,N,8,1'"
}
}
BUTTON_EVENT[dvTP_Insteon,1]
{
PUSH:
{
SEND_STRING dvInsteon, "'02 62 11 11 11 05 11 FF'"
}
}
Try this instead:
SEND_STRING dvInsteon, "$02,$62,$11,$11,$11,$05,$11,$FF"
Thanks Joe, I gave that a try to no avail... I tried with double quotes then I tried with single quote but no response from the light.
So I checked the cable by plugging into laptop, ran the code through 'Docklight Scripting' again, the light turned on.
I changed the port in the controller to just eliminate possibility that it had a problem, verified set up protocal and ran program again as follows:
DATA_EVENT [dvInsteon]
{
ONLINE:
{
SEND_COMMAND dvInsteon, "'SET BAUD 19200,N,8,1'"
}
}
BUTTON_EVENT[dvTP_Insteon,1]
{
PUSH:
{
SEND_STRING dvInsteon, "$02,$62,$11,$11,$11,$05,$11,$FF"
}
}
But it still did not work,
Netlinx Studio is showing that the button push is being received properly and that it corresponds to my code, as well as tx led flashing on controller.
http://www.amxforums.com/showthread.php?4085-Forum-FAQs
Thanks Joe, I am using the cable provided by Insteon, I am going to run out right now and get a connector to make the adapter according to the post you referenced and give it a shot!
In the output Bar window, you have the notification Tab
Just click on it and while your program is runing
right click 'Netlinx device notifications' then edit all device (select all then ok)
done
and then right click again and select 'enable asynchronous Notifications'
You should see when you press your button and send string on the RS232.
You should see the rs232 reply string
http://www.easyadapters.com/products.php?cat=8
Quick and easy for bench testing and I have no problems using them in the final install either using the tie wrap strain relief and some intelligent wire management.
Thanks Cedric, This is actually a great help. I see my string go from ($02,$62,$11,$11,$11,$05,$11,$FF) to ($02b,$11,$11,$11,$05,$11,$FF) I also don't see the ONLINE Baud set up in the notification.. so now I am getting more confused.
Thanks for the reference, these look so much easier to use than the crimp style DB9's I am working with. I am going to order a bunch!!
And so it is not the cable. I made up a cable with the correct pin out at each end, tested them and also looked at the provided cable. It only used pins 2, 3 and 5 as well. Running out of hair to pull on.
For example from the manwell I found:
I could easily be on the wrong bus here but have a good look at the doco to be sure...
Make sure you take these bytes and format them for netlinx exactly as pointed out by Joe.
Hth.
It's possible the scriptlight software may be showing you the string as you displayed to us here but be adding a chksum or crc byte automatically.........
1) Add a STRING: {} handler to [DATA_EVENT, dvInsteon]
2) Or In the ONLINE event add a SEND_COMMAND dvInsteon, ‘RXON’
3) Or Use CREATE_BUFFER
If you want to confirm that you have the baud rate setup properly turn on Notifications and use Control A Device to issue a GET BAUD command to your serial port.
If you want to confirm that your serial port is transmitting data and can receive data, loop back pins 2 and 3 and watch Notifications.
I have not resolved this yet. I was in AMX programming training all last week and brought it up to the instructor.
I was told that I just have to enter the hexadecimal code as it is, but went home to try it and it did not work.
I added the "RXON" to receive data but it didn't seem to work.
I will try the jumper from pins 2 to 3 this evening to check if the string is going out. I think I had done that but its a blur in my memory.
I am going to try the port with a different device as well to check it out.
Apparently an inherent threat to the NI controllers. I found a website that showed the capacitor and repair explanations. After trial and error on another board I learned to remove SMD's with a special heat gun, removed the bad capacitor, soldered in a new one, fired up the NI, sent it a code as per previous advise of others on this thread and voila, (or actually after discovering another bad piece of hardware) voila, the light is controllable.
Thanks everybody for the assist!
I'm actually surprised none of us thought of this, it's such a common issue.