rs232 'get lighting state' command?

Discussion in 'C-Bus Wired Hardware' started by boganbill, Feb 24, 2010.

  1. boganbill

    boganbill

    Joined:
    Jan 21, 2010
    Messages:
    11
    Likes Received:
    0
    Location:
    melbourne
    Using the nifty program "cbus 2 rs232.exe" you can send direct serial commands via a PCI/CNI from remotes/control4/other av control systems.

    What I want to know is what are the direct serial commands for querying a certain group adresss' lighting state? Using c-gate its easy, however I'm programming up some equipement that only has imbedded code and obviously can't use java to run a copy of cgate. It would be much easier just to poll every 30 seconds or so and decypher the return string.

    Presumably there is a serial command that can be sent directly via the PCI which will then return string(s) you can use to work out a group address' current level without ever touching cgate.

    I can't work it out even using a sniffer, I figured during an auto-synch I could find my answer, any ideas?
     
    boganbill, Feb 24, 2010
    #1
  2. boganbill

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,391
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    You can't and should not be polling a cbus network. Especially not every 30 seconds. Danger danger danger!
     
    ashleigh, Feb 24, 2010
    #2
  3. boganbill

    Don

    Joined:
    Aug 4, 2004
    Messages:
    429
    Likes Received:
    0
    Location:
    Townsville, Australia
    Ashleigh's right. Polling's not the answer.

    You should be setting up the PC Interface / CNI to monitor the application(s) of interest.

    Your embedded code then only has to respond to the short messages resulting from C-Bus traffic. Your code should then maintain a variable to represent the level of any groups you are interested in.

    This not only reduces network traffic, but simplifies your embedded code.
     
    Don, Feb 24, 2010
    #3
  4. boganbill

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,391
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    All the yummy code you need is available for free, written in C, and portable to boot.

    Search sourceforge for "cbus module".

    There is a stack of documentation there and for download from the clipsal web site as well. READ IT.

    If you leap in without reading it you will be asking a whole lot more questions here, to which the rather impatient answer will be "read the doco".

    :)
     
    ashleigh, Feb 25, 2010
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.