Level Status Request Command Error

Discussion in 'C-Bus Serial Protocols' started by driverman, Jul 2, 2019.

  1. driverman

    driverman

    Joined:
    Jul 2, 2019
    Messages:
    6
    Likes Received:
    0
    Hi,

    I'm new to C-Bus and having an issue with the level status request command.

    Looking at the protocol, this should be a valid command.

    Page 22 of Serial Interface User Guide:
    "a. Status Requests have two versions:
    one version ( beginning $7A )...
    one version (beginning $7303 )...

    b. The Level Status Request, using sequence $7307, is only supported in Serial Interface version 4.0.00 and later..."

    The level request command being sent is "\05FF00730738004An<CR>" and is compliant with the protocol shown on the flowchart of the same page and the Serial Interface version is 4.4.00. If I replaced 7307 with 7A (binary status request) then I dont't get an error.

    \
    05 - Point to Multi Point Header Normal Value 05
    FF
    00
    7307 - Level status
    38 - Application ID ( 56 decimal )
    00 - Start from group address 00
    4A - Checksum
    n - Confirmation
    <CR>

    I get a reply with all the levels for the command but the error count goes up after each send ( using Traffic Analyzer in CBus Diagnostic Utility )

    This is being used with Clipsal Lighting 8CH dimmer if that matters.

    Thanks
     
    Last edited: Jul 2, 2019
    driverman, Jul 2, 2019
    #1
    1. Advertisements

  2. driverman

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    950
    Likes Received:
    65
    Location:
    Adelaide, Australia
    Commands like get status return a lot of data which shows up a flaky network. You have a problem with the network, not the command, which you need to investigate.
     
    Ashley, Jul 3, 2019
    #2
    1. Advertisements

  3. driverman

    driverman

    Joined:
    Jul 2, 2019
    Messages:
    6
    Likes Received:
    0
    I'm not sure where to start with investigating the network. do you have any advice?

    Thanks
     
    driverman, Jul 3, 2019
    #3
  4. driverman

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    950
    Likes Received:
    65
    Location:
    Adelaide, Australia
    Are you actually seeing any problems in the normal running of the network. i.e. having to press a switch more than once, or scenes not setting correctly, or scans sometimes failing? It is usual for the traffic analyser to show a small number of errors. Cbus will automatically retry and correct these.

    Otherwise, the diagnostic utility has a reliability test which hits each unit individually. It can show up flaky units or segments. If this is ok and you are not seeing any issues under normal operation I would just ignore the traffic analyzer errors.
     
    Ashley, Jul 3, 2019
    #4
  5. driverman

    driverman

    Joined:
    Jul 2, 2019
    Messages:
    6
    Likes Received:
    0
    I'm not currently having any problems with the errors but a much bigger system than mine is ( using my software ) the error rate is quite high since I have to get the status fairly frequently.

    the request is currently every 2 seconds.
     
    driverman, Jul 3, 2019
    #5
  6. driverman

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    950
    Likes Received:
    65
    Location:
    Adelaide, Australia
    You shouldn't be using the get status every 2 seconds. That is not how Cbus operates. You get the status once at the start then listen for incoming messages to update your internal database. You will need to fix your software.
     
    Ashley, Jul 3, 2019
    #6
  7. driverman

    driverman

    Joined:
    Jul 2, 2019
    Messages:
    6
    Likes Received:
    0
    I would do that but the lights don't send level updates without me sending a level status request.

    I'm not sure what exactly I'm looking for in the network but there doesn't seem to be anything wrong.

    do you have any thoughts on why the binary status request doesn't cause an error but level request does? I'd have thought a network problem would affect both
     
    driverman, Jul 3, 2019
    #7
  8. driverman

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    950
    Likes Received:
    65
    Location:
    Adelaide, Australia
    You seem to have a fundamental misunderstanding on how Cbus operates. Why would you expect a light to send a level update? The light will only change when requested to by another unit, and you will receive that command as a lighting ga change. You use this to update your database.

    Level requests return more data. The more data, the more possibility of errors. The larger the network, the more traffic, the more errors.

    The Serial Interface User Guide under the level status request specifically cautions about polling. It is never necessary. You need to understand how Cbus works and fix this first.

    Then worry about network errors.
     
    Ashley, Jul 4, 2019
    #8
  9. driverman

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,392
    Likes Received:
    35
    Location:
    Adelaide
    Ashley is correct... you should not be issuing any status requests that frequently. There is even a big warning about not doing this on the next page of the document that you referred to.

    A status request takes around 150ms on the bus. A binary status request uses one of these, but a level status request requires 8. If you are issuing a level status request every 2 seconds then you are utilising over 60% of the bus bandwidth.

    The increasing error count you are seeing is quite possibly either due to retries of other devices who are trying to transmit, or other PC interface based devices who are NACKing messages as they are busy (probably transferring all the status request traffic).

    Perhaps if you can explain what you're trying to do we can guide you toward a better way of doing it.

    Nick
     
    NickD, Jul 4, 2019
    #9
  10. driverman

    driverman

    Joined:
    Jul 2, 2019
    Messages:
    6
    Likes Received:
    0
    I guess I really didn't have a good understanding of how CBus worked.
    I changed the level status request timer after the initial request to now be 10 minutes, not sure if that frequency is too low but should satisfy. If i send a command from Diagnostic Utility, my program also processes it and updates it's levels.

    All I'm trying to do is make sure my program is always up to date with the current level. If I'm now doing everything correctly with the change above then great! ( still have errors with level request however https://imgur.com/a/aRCRP8V )

    I took it over from someone else and they'd added a level request timer for 10 seconds ( not 2 seconds my mistake of not double checking ).

    And I think a level status request taking up 8 buses and being issued very 10 seconds might be the cause of the other bigger system I mentioned, having a lot performance problems.

    Thanks
     
    Last edited: Jul 4, 2019
    driverman, Jul 4, 2019
    #10
  11. driverman

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    950
    Likes Received:
    65
    Location:
    Adelaide, Australia
    You still haven't understood how Cbus operates. You don't need to continuously poll for changes. Cbus will forward any changes to you via Monitored SAL commands. See page 31 of the Serial Interface Guide.

    When your program first starts, issue the get status command to get current values. Then just wait for the lighting monitored SAL commands to turn up and decode them to update your internal status. This way no polling is required and you get instant updates when anything changes.
     
    Ashley, Jul 4, 2019
    #11
  12. driverman

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,392
    Likes Received:
    35
    Location:
    Adelaide
    Ok.. this sounds like you have the foundation for something that will work.

    The only time you should need to issue a level status request is when your software initially connects, to establish the current state, if, after that, you are able to observe the traffic and update the state, then you should never have to use a status request again, but if you absolutely have to, once every 10 minutes is probably OK.

    The key is that you have to stay connected, and you have to monitor the traffic and keep track of the resulting levels. If for whatever reason you can't stay connected, then you should not be trying to display status because the impact on the normal performance of the installation would be unacceptable.

    Nick

    PS : If you haven't already found it, search for "C-Bus Module" on sourgeforce. This is (an old) version of the source code used in many of the C-Bus products like the touchscreens and the PAC, as well as documentation on how to use it. If nothing else it gives an example of how to do the above.
     
    NickD, Jul 5, 2019
    #12
  13. driverman

    driverman

    Joined:
    Jul 2, 2019
    Messages:
    6
    Likes Received:
    0
    Thank you both for you help. I'll have a look at the C-Bus Module later as well.
     
    driverman, Jul 5, 2019
    #13
    1. Advertisements

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.