Setting filter corrupts the websocket message



  • Hello
    I've come across this strange issue:
    If I don't set any filters, an input change is reported through websocket like this:

    [{"counter_modes": ["Enabled", "Disabled"], "glob_dev_id": 1, "modes": ["Simple", "DirectSwitch"], "value": 0, "circuit": "3_13", "debounce": 50, "counter": 52, "counter_mode": "Enabled", "dev": "input", "mode": "Simple"}]
    

    While setting the filters to input only

    '{"cmd":"filter","devices":["input"]}'
    

    Returns this:

    ["counter_modes", "glob_dev_id", "modes", "value", "circuit", "debounce", "counter", "counter_mode", "dev", "mode"]
    
    

    Am I doing something wrong?

    Another question that I have is whether sending input change report is event driven or things are sent through the websocket on regular intervals? Sometimes I am experiencing longer delays that I would expect.


  • administrators

    This looks like a bug! I've made some changes to the websocket interface recently, and it's possible that the filtering got broken in the meantime. Could you just mention which version of EVOK you are using?

    As for the input change report - it is event-driven. Essentially there is a global cache which gets read via regular SPI polling in Modbus blocks, and after each read the delta is sent in a message. It should be noted that internally the individual boards are capable of much faster processing, so e.g. counter changes or DirectSwitch are not dependent on polling speed. The limiting factor is the raspberry processing speed, the SPI bus itself runs on 12MHz.



  • Not sure how to check version, but I am using the following unipian image UniPian-Neuron-OS-2017-11-24.zip.



  • @tomas_knot said in Setting filter corrupts the websocket message:

    As for the input change report - it is event-driven. Essentially there is a global cache which gets read via regular SPI polling in Modbus blocks, and after each read the delta is sent in a message. It should be noted that internally the individual boards are capable of much faster processing, so e.g. counter changes or DirectSwitch are not dependent on polling speed. The limiting factor is the raspberry processing speed, the SPI bus itself runs on 12MHz.

    I am asking because with a simple websocket script which toggles a relay for every change of an input I am getting a random delay from 0 to 0.5s between key press and relay toggle.
    0.5s is a lot and I would really like to keep the latency below 100ms. What do you suggest?


  • administrators

    @oversc0re You can increase the interval in which evok polls the individual boards for updates in the evok config file /etc/evok.conf. See the scan_frequency parameter of [NEURON] unit and increase it to 5 for start