Home AMX User Forum AMXForums Archive Threads Residential Forum

Insteon control with AMX - Hexadecimal string problems

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?

Comments

  • John NagyJohn Nagy Posts: 1,734
    First, you can and should go delete your duplicate post.
    Second, you really do need training, this question is the tip of the iceberg.
  • Joe HebertJoe Hebert Posts: 2,159
    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).
    Show us your code and we'll see if we can spot the problem.
  • No doubt I need training. I have gone to AMX's programming class but it was 5 years ago and I've not been active using the system due to other job distractions. I have been reading through all the manuals on their site, been watching all the tutorial videos and am signed up for the programming class again in 1 week. Just thought I might be missing something obvious to somebody with some experience.
  • After Defining the devices, this is what I am trying to run.

    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'"
    }
    }
  • Joe HebertJoe Hebert Posts: 2,159
    After Defining the devices, this is what I am trying to run.

    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"
  • Joe Hebert wrote: »
    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.
  • Joe HebertJoe Hebert Posts: 2,159
    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.
    Don’t use single quotes, for this case they need to be double quotes just as I posted. If the string doesn’t work then syntax is not the issue. Are you sure the cable is good?
  • Joe Hebert wrote: »
    Don’t use single quotes, for this case they need to be double quotes just as I posted. If the string doesn’t work then syntax is not the issue. Are you sure the cable is good?

    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.
  • Joe HebertJoe Hebert Posts: 2,159
    So I checked the cable by plugging into laptop, ran the code through 'Docklight Scripting' again, the light turned on
    Are you sure the cable is good? Please read the forum FAQ.

    http://www.amxforums.com/showthread.php?4085-Forum-FAQs
  • Joe Hebert wrote: »
    Are you sure the cable is good? Please read the forum FAQ.

    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!
  • CedricCedric Posts: 32
    You can also use the notifications information this can help.


    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
  • viningvining Posts: 4,368
    For intial serial connection I like to use these:
    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.
  • Cedric wrote: »
    You can also use the notifications information this can help.


    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

    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.
  • vining wrote: »
    For intial serial connection I like to use these:
    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 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!!
  • 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!

    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.
  • DarksideDarkside Posts: 345
    Are you sure you have the protocol right? I just had a very quick look at the doc and it looks like 9 bytes to me but your demo string shows 8.

    For example from the manwell I found:
    Message 2
    Keypad: “Dimmer Module A, turn on”
    00 00 CC 00 00 AA 4F 01 00
    

    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.........
  • viningvining Posts: 4,368
    Same cable used with pc software? Have you tried a null modem (cross over) adapter on it or swap pins 2 & 3 on your made cable. That's one reason I love those easy adapters cuz that always screws me up.
  • Joe HebertJoe Hebert Posts: 2,159
    If you are expecting to receive data from your serial device then you need to tell the RS-232 port to wake up and listen for data. To do that either:

    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.
  • Joe HebertJoe Hebert Posts: 2,159
    How did the story end? What did you do to get things working?
  • Hi Joe,
    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.
  • So after trying all else, I came across the capacitor issue that is referenced as c206 in other threads.
    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!
  • DHawthorneDHawthorne Posts: 4,584
    So after trying all else, I came across the capacitor issue that is referenced as c206 in other threads.
    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.
Sign In or Register to comment.