What is the "counter_mode" for in evok.conf?



  • What is the "counter_mode" for in evok.conf?

    Thanks,
    Brett.



  • What is the "counter_mode" for in evok.conf?

    Thanks,
    Brett.



  • It can be used to count rising or falling edges which you will find useful when dealing with energy metering - eg. you can have a electricity meter that gives you 1000impulses/kwh



  • Can you access the count number from node-red?
    Is it a constantly increasing number? or can you reset it?
    Is there a specified amount of time that it counts for? i.e. counts/sec?

    Thanks



  • Of course, it should be sent in every message along with all the other data.
    It is constantly increasing, so far without possibility of resetting (will think about it).
    It counts only the rising/falling edges - no time. So when the system detects a valid edge (eg. pulses with minimum time pulse of debounce [ms]) it will increase the 'count' number



  • I am not seeing any kind of count value returned even when I change the counter_mode to either "falling" or "rising".

    In the end, I was mostly wondering what it was and how it might be used.

    Thanks.



  • Hello,
    for me the counter mode is operating but resets when RPI reboots…...this is a real problem!



  • There are Node-Red database nodes that can store those values in non-volatile storage, leveldb being a very simple one to use. Of course, then you get into having to deal with possibly being in the middle of a write to the SD card when a reboot occurs and the possible corruption of the SD card. So, before you start writing to non-volatile storage, you might want to make sure your reboots won't be unexpected (UPS?)

    Thanks,
    Brett.