Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. NodeManager
  4. Water pulse meter value not reported automatically

Water pulse meter value not reported automatically

Scheduled Pinned Locked Moved NodeManager
watermeternode managerpulse sensor
13 Posts 3 Posters 2.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F fredswed

    @user2684 Many thanks - somtimes it is hard to see the obvious! Pin 2 is definitely connected to the radio which is more than likely a problem. Note to self: do not connect keyboard to ethernet port :-)
    Have not had the time to fix it and check yet but will do asap.

    Btw, Is the reportInterval required, or will the sensor report on every pulse if an interval is not specified?

    U Offline
    U Offline
    user2684
    Contest Winner
    wrote on last edited by
    #4

    @fredswed if not specified, sensor will report every hour (https://github.com/mysensors/NodeManager/blob/master/sensors/SensorPulseMeter.h#L45). The sensor itself will take care of summing up the accumulated value along the timeframe

    F 1 Reply Last reply
    0
    • U user2684

      @fredswed if not specified, sensor will report every hour (https://github.com/mysensors/NodeManager/blob/master/sensors/SensorPulseMeter.h#L45). The sensor itself will take care of summing up the accumulated value along the timeframe

      F Offline
      F Offline
      fredswed
      wrote on last edited by
      #5

      @user2684 Thanks!
      Finally had the time to try again. Unfortunately no success. Even worse - I can't find the problem :-) I'd really appreciate any advice on the code or how to troubleshoot.

      I changed the pulse pin to 3 and recompiled just before the run.

      After startup, pulses were simulated by quickly connecting pin 3 to ground starting at 141883
      I expected values to be sent every 30 seconds but none were sent.
      I did a C_REQ request at 1452361
      Automatic reports were sent from the node around 1 hour (3600000) and 2 hours (7200000), so the reporting interval seems to be at the default 1 hour, not 30 seconds as stated in the code. It's either strange or I have missed something basic...

      Code for the node below. Verbose debug log follows further down.

      /**************************
      *This DC-driven EasyPCB board reads pulses from a water meter and reports water consumption
      */
      
      /**********************************
      * MySensors node configuration
      */
      
      // General settings
      #define SKETCH_NAME "EasyPCB Water Meter #11"
      #define SKETCH_VERSION __DATE__ " - " __TIME__
      // Default baudrate 115200
      #define MY_BAUD_RATE 115200
      #define MY_DEBUG
      
      #define MY_NODE_ID 11
      
      // NRF24 radio settings
      #define MY_RADIO_RF24
      
      /***********************************
       * NodeManager configuration
       */
      
      #define NODEMANAGER_DEBUG ON       // Default ON
      #define NODEMANAGER_INTERRUPTS ON
      #define NODEMANAGER_SLEEP OFF       // Default ON
      #define NODEMANAGER_RECEIVE ON
      #define NODEMANAGER_DEBUG_VERBOSE ON
      #define NODEMANAGER_POWER_MANAGER OFF
      #define NODEMANAGER_CONDITIONAL_REPORT OFF
      #define NODEMANAGER_EEPROM OFF
      #define NODEMANAGER_TIME OFF
      #define NODEMANAGER_RTC OFF
      #define NODEMANAGER_SD OFF
      #define NODEMANAGER_HOOKING OFF
      #define NODEMANAGER_OTA_CONFIGURATION OFF
      #define NODEMANAGER_SERIAL_INPUT OFF
      
      // import NodeManager library (a nodeManager object will be then made available)
      #include <MySensors_NodeManager.h>
      
      /***********************************
       * Add your sensors
       */
      
      #include <sensors/SensorWaterMeter.h>
      SensorWaterMeter waterMeter(3);
      
      /***********************************
       * Main Sketch
       */
      
      // before
      void before() {
      	
        /***********************************
         * Configure your sensors
         */
      
        nodeManager.setReportIntervalSeconds(30)
      
        // call NodeManager before routine
        nodeManager.before();
      }
      
      // presentation
      void presentation() {
        // call NodeManager presentation routine
        nodeManager.presentation();
      }
      
      // setup
      void setup() {
        // call NodeManager setup routine
        nodeManager.setup();
      }
      
      // loop
      void loop() {
        // call NodeManager loop routine
        nodeManager.loop();
      }
      
      #if NODEMANAGER_RECEIVE == ON
      // receive
      void receive(const MyMessage &message) {
        // call NodeManager receive routine
        nodeManager.receive(message);
      }
      #endif
      
      #if NODEMANAGER_TIME == ON
      // receiveTime
      void receiveTime(unsigned long ts) {
        // call NodeManager receiveTime routine
        nodeManager.receiveTime(ts);
      }
      #endif
      

      Serial debug from node:

      0 NM:INIT:VER=1.8
      0 NM:INIT:INO=EasyPCB Water Meter #11 vJan 12 2019 - 20:36:35
      0 NM:INIT:LIB VER=2.3.1 CP=RNNNA---
      
       __  __       ____
      |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
      | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
      | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
      |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
              |___/                      2.3.1
      
      16 MCO:BGN:INIT NODE,CP=RNNNA---,REL=255,VER=2.3.1
      26 MCO:BGN:BFR
      28 NM:INIT:RBT p=255
      30 NM:BFR:INIT
      32 TSM:INIT
      34 TSF:WUR:MS=0
      40 TSM:INIT:TSP OK
      43 TSM:INIT:STATID=11
      45 TSF:SID:OK,ID=11
      47 TSM:FPAR
      83 TSF:MSG:SEND,11-11-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      346 TSF:MSG:READ,0-0-11,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      352 TSF:MSG:FPAR OK,ID=0,D=1
      2093 TSM:FPAR:OK
      2093 TSM:ID
      2095 TSM:ID:OK
      2097 TSM:UPL
      2101 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      2203 TSF:MSG:READ,0-0-11,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      2209 TSF:MSG:PONG RECV,HP=1
      2213 TSM:UPL:OK
      2215 TSM:READY:ID=11,PAR=0,DIS=1
      2220 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      2349 TSF:MSG:READ,0-0-11,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      2357 TSF:MSG:SEND,11-11-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
      2365 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      2607 TSF:MSG:READ,0-0-11,s=255,c=3,t=6,pt=0,l=1,sg=0:M
      2613 NM:BFR:OK
      2617 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=11,pt=0,l=23,sg=0,ft=0,st=OK:EasyPCB Water Meter #11
      2629 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=12,pt=0,l=22,sg=0,ft=0,st=OK:Jan 12 2019 - 20:36:35
      2639 NM:PRES:WATER(1) p=21 t=35
      2643 TSF:MSG:SEND,11-11-0-0,s=1,c=0,t=21,pt=0,l=5,sg=0,ft=0,st=OK:WATER
      2652 MCO:REG:REQ
      2684 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      2990 TSF:MSG:READ,0-0-11,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      2996 MCO:PIM:NODE REG=1
      2998 MCO:BGN:STP
      3000 NM:STP:ID=11 M=1
      3002 NM:LOOP:INT p=3 v=1
      3004 NM:BFR:INT p=3 m=2
      3080 NM:STP:HW V=3441 F=8 M=1360
      3082 MCO:BGN:INIT OK,TSP=1
      3086 NM:LOOP:WATER(1):SET t=35 v=0.0010
      3090 NM:MSG:SEND(1) t=35 p=0.00
      3096 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0010
      
      
      141883 NM:LOOP:INT p=3 v=0
      141883 NM:LOOP:INT p=3 v=0
      141883 NM:LOOP:INT p=3 v=0
      141883 NM:LOOP:INT p=3 v=0
      141885 NM:LOOP:INT p=3 v=0
      141885 NM:LOOP:INT p=3 v=0
      141885 NM:LOOP:WATER(1):SET t=35 v=0.0010
      141893 NM:LOOP:INT p=3 v=1
      141893 NM:LOOP:INT p=3 v=0
      141893 NM:LOOP:INT p=3 v=0
      141893 NM:LOOP:INT p=3 v=1
      141895 NM:LOOP:WATER(1):SET t=35 v=0.0020
      
      
      244365 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
      244371 TSF:MSG:BC
      245037 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
      1452361 TSF:MSG:READ,0-0-11,s=1,c=2,t=35,pt=0,l=0,sg=0:
      1452367 NM:MSG:RECV(1) c=2 t=35 p=
      1452371 NM:MSG:SEND(1) t=35 p=0.00
      1452376 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0020
      1452386 NM:MSG:SEND(1) t=35 p=0.00
      1452390 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
      
      3603003 NM:MSG:SEND(1) t=35 p=0.00
      3603007 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
      5023537 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
      5023543 TSF:MSG:BC
      5024374 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
      6218539 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
      6218545 TSF:MSG:BC
      6219368 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
      7203016 NM:MSG:SEND(1) t=35 p=0.00
      7203020 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
      
      U 1 Reply Last reply
      0
      • F fredswed

        @user2684 Thanks!
        Finally had the time to try again. Unfortunately no success. Even worse - I can't find the problem :-) I'd really appreciate any advice on the code or how to troubleshoot.

        I changed the pulse pin to 3 and recompiled just before the run.

        After startup, pulses were simulated by quickly connecting pin 3 to ground starting at 141883
        I expected values to be sent every 30 seconds but none were sent.
        I did a C_REQ request at 1452361
        Automatic reports were sent from the node around 1 hour (3600000) and 2 hours (7200000), so the reporting interval seems to be at the default 1 hour, not 30 seconds as stated in the code. It's either strange or I have missed something basic...

        Code for the node below. Verbose debug log follows further down.

        /**************************
        *This DC-driven EasyPCB board reads pulses from a water meter and reports water consumption
        */
        
        /**********************************
        * MySensors node configuration
        */
        
        // General settings
        #define SKETCH_NAME "EasyPCB Water Meter #11"
        #define SKETCH_VERSION __DATE__ " - " __TIME__
        // Default baudrate 115200
        #define MY_BAUD_RATE 115200
        #define MY_DEBUG
        
        #define MY_NODE_ID 11
        
        // NRF24 radio settings
        #define MY_RADIO_RF24
        
        /***********************************
         * NodeManager configuration
         */
        
        #define NODEMANAGER_DEBUG ON       // Default ON
        #define NODEMANAGER_INTERRUPTS ON
        #define NODEMANAGER_SLEEP OFF       // Default ON
        #define NODEMANAGER_RECEIVE ON
        #define NODEMANAGER_DEBUG_VERBOSE ON
        #define NODEMANAGER_POWER_MANAGER OFF
        #define NODEMANAGER_CONDITIONAL_REPORT OFF
        #define NODEMANAGER_EEPROM OFF
        #define NODEMANAGER_TIME OFF
        #define NODEMANAGER_RTC OFF
        #define NODEMANAGER_SD OFF
        #define NODEMANAGER_HOOKING OFF
        #define NODEMANAGER_OTA_CONFIGURATION OFF
        #define NODEMANAGER_SERIAL_INPUT OFF
        
        // import NodeManager library (a nodeManager object will be then made available)
        #include <MySensors_NodeManager.h>
        
        /***********************************
         * Add your sensors
         */
        
        #include <sensors/SensorWaterMeter.h>
        SensorWaterMeter waterMeter(3);
        
        /***********************************
         * Main Sketch
         */
        
        // before
        void before() {
        	
          /***********************************
           * Configure your sensors
           */
        
          nodeManager.setReportIntervalSeconds(30)
        
          // call NodeManager before routine
          nodeManager.before();
        }
        
        // presentation
        void presentation() {
          // call NodeManager presentation routine
          nodeManager.presentation();
        }
        
        // setup
        void setup() {
          // call NodeManager setup routine
          nodeManager.setup();
        }
        
        // loop
        void loop() {
          // call NodeManager loop routine
          nodeManager.loop();
        }
        
        #if NODEMANAGER_RECEIVE == ON
        // receive
        void receive(const MyMessage &message) {
          // call NodeManager receive routine
          nodeManager.receive(message);
        }
        #endif
        
        #if NODEMANAGER_TIME == ON
        // receiveTime
        void receiveTime(unsigned long ts) {
          // call NodeManager receiveTime routine
          nodeManager.receiveTime(ts);
        }
        #endif
        

        Serial debug from node:

        0 NM:INIT:VER=1.8
        0 NM:INIT:INO=EasyPCB Water Meter #11 vJan 12 2019 - 20:36:35
        0 NM:INIT:LIB VER=2.3.1 CP=RNNNA---
        
         __  __       ____
        |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
        | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
        | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
        |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
                |___/                      2.3.1
        
        16 MCO:BGN:INIT NODE,CP=RNNNA---,REL=255,VER=2.3.1
        26 MCO:BGN:BFR
        28 NM:INIT:RBT p=255
        30 NM:BFR:INIT
        32 TSM:INIT
        34 TSF:WUR:MS=0
        40 TSM:INIT:TSP OK
        43 TSM:INIT:STATID=11
        45 TSF:SID:OK,ID=11
        47 TSM:FPAR
        83 TSF:MSG:SEND,11-11-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
        346 TSF:MSG:READ,0-0-11,s=255,c=3,t=8,pt=1,l=1,sg=0:0
        352 TSF:MSG:FPAR OK,ID=0,D=1
        2093 TSM:FPAR:OK
        2093 TSM:ID
        2095 TSM:ID:OK
        2097 TSM:UPL
        2101 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
        2203 TSF:MSG:READ,0-0-11,s=255,c=3,t=25,pt=1,l=1,sg=0:1
        2209 TSF:MSG:PONG RECV,HP=1
        2213 TSM:UPL:OK
        2215 TSM:READY:ID=11,PAR=0,DIS=1
        2220 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
        2349 TSF:MSG:READ,0-0-11,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
        2357 TSF:MSG:SEND,11-11-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
        2365 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
        2607 TSF:MSG:READ,0-0-11,s=255,c=3,t=6,pt=0,l=1,sg=0:M
        2613 NM:BFR:OK
        2617 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=11,pt=0,l=23,sg=0,ft=0,st=OK:EasyPCB Water Meter #11
        2629 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=12,pt=0,l=22,sg=0,ft=0,st=OK:Jan 12 2019 - 20:36:35
        2639 NM:PRES:WATER(1) p=21 t=35
        2643 TSF:MSG:SEND,11-11-0-0,s=1,c=0,t=21,pt=0,l=5,sg=0,ft=0,st=OK:WATER
        2652 MCO:REG:REQ
        2684 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
        2990 TSF:MSG:READ,0-0-11,s=255,c=3,t=27,pt=1,l=1,sg=0:1
        2996 MCO:PIM:NODE REG=1
        2998 MCO:BGN:STP
        3000 NM:STP:ID=11 M=1
        3002 NM:LOOP:INT p=3 v=1
        3004 NM:BFR:INT p=3 m=2
        3080 NM:STP:HW V=3441 F=8 M=1360
        3082 MCO:BGN:INIT OK,TSP=1
        3086 NM:LOOP:WATER(1):SET t=35 v=0.0010
        3090 NM:MSG:SEND(1) t=35 p=0.00
        3096 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0010
        
        
        141883 NM:LOOP:INT p=3 v=0
        141883 NM:LOOP:INT p=3 v=0
        141883 NM:LOOP:INT p=3 v=0
        141883 NM:LOOP:INT p=3 v=0
        141885 NM:LOOP:INT p=3 v=0
        141885 NM:LOOP:INT p=3 v=0
        141885 NM:LOOP:WATER(1):SET t=35 v=0.0010
        141893 NM:LOOP:INT p=3 v=1
        141893 NM:LOOP:INT p=3 v=0
        141893 NM:LOOP:INT p=3 v=0
        141893 NM:LOOP:INT p=3 v=1
        141895 NM:LOOP:WATER(1):SET t=35 v=0.0020
        
        
        244365 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
        244371 TSF:MSG:BC
        245037 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
        1452361 TSF:MSG:READ,0-0-11,s=1,c=2,t=35,pt=0,l=0,sg=0:
        1452367 NM:MSG:RECV(1) c=2 t=35 p=
        1452371 NM:MSG:SEND(1) t=35 p=0.00
        1452376 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0020
        1452386 NM:MSG:SEND(1) t=35 p=0.00
        1452390 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
        
        3603003 NM:MSG:SEND(1) t=35 p=0.00
        3603007 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
        5023537 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
        5023543 TSF:MSG:BC
        5024374 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
        6218539 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
        6218545 TSF:MSG:BC
        6219368 TSF:MSG:SEND,11-11-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
        7203016 NM:MSG:SEND(1) t=35 p=0.00
        7203020 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
        
        U Offline
        U Offline
        user2684
        Contest Winner
        wrote on last edited by
        #6

        @fredswed ok looks like the interrupt is intercepted and accumulated value is calculated correctly but the values are just not sent at the specified interval, right? Try calling setReportIntervalSeconds()
        on waterMeter rather than nodeManager. When you call nodeManager.setReportIntervalSeconds(30), this is applied to all the sensors with a report interval not set yet. But since SensorPulseMeter already calls setReportIntervalMinutes() I believe NodeManager will skip it. Thanks

        F 1 Reply Last reply
        0
        • U user2684

          @fredswed ok looks like the interrupt is intercepted and accumulated value is calculated correctly but the values are just not sent at the specified interval, right? Try calling setReportIntervalSeconds()
          on waterMeter rather than nodeManager. When you call nodeManager.setReportIntervalSeconds(30), this is applied to all the sensors with a report interval not set yet. But since SensorPulseMeter already calls setReportIntervalMinutes() I believe NodeManager will skip it. Thanks

          F Offline
          F Offline
          fredswed
          wrote on last edited by fredswed
          #7

          @user2684 Thanks! Using waterMeter.setReportIntervalSeconds(30); works and values are now reported every 30 seconds as expected.

          One problem still persists - the counter seem to be reset and there is always a zero value reported after the true value. E.g. after creating a few pulses, I get the log:

          27027 NM:LOOP:WATER(1):SET t=35 v=0.0190
          35086 NM:MSG:SEND(1) t=35 p=0.01
          35090 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0190
          35098 NM:MSG:SEND(1) t=35 p=0.00
          35104 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
          65099 NM:MSG:SEND(1) t=35 p=0.00
          65103 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
          65112 NM:MSG:SEND(1) t=35 p=0.00
          65118 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
          
          F 1 Reply Last reply
          0
          • F fredswed

            @user2684 Thanks! Using waterMeter.setReportIntervalSeconds(30); works and values are now reported every 30 seconds as expected.

            One problem still persists - the counter seem to be reset and there is always a zero value reported after the true value. E.g. after creating a few pulses, I get the log:

            27027 NM:LOOP:WATER(1):SET t=35 v=0.0190
            35086 NM:MSG:SEND(1) t=35 p=0.01
            35090 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0190
            35098 NM:MSG:SEND(1) t=35 p=0.00
            35104 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
            65099 NM:MSG:SEND(1) t=35 p=0.00
            65103 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
            65112 NM:MSG:SEND(1) t=35 p=0.00
            65118 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
            
            F Offline
            F Offline
            fredswed
            wrote on last edited by
            #8

            I've digged a bit in the NodeManager code on my own and is far from certain, but isn't it a problem that reset() is called when the value has been reported by the child (line 199)

            If I get it correctly:
            When waterSensor calls setValue, it in turn calls setValueNumber which adds the pulse to _total. That's fine.
            But when sendValue is called at a later time, both _value and _total are reset to 0 as _value_processingis SUM.

            So the pulse count will restart from zero.
            Wouldn't we want to keep at least _total at its current value, to keep the accumulated number of pulses over time?

            U 1 Reply Last reply
            0
            • F fredswed

              I've digged a bit in the NodeManager code on my own and is far from certain, but isn't it a problem that reset() is called when the value has been reported by the child (line 199)

              If I get it correctly:
              When waterSensor calls setValue, it in turn calls setValueNumber which adds the pulse to _total. That's fine.
              But when sendValue is called at a later time, both _value and _total are reset to 0 as _value_processingis SUM.

              So the pulse count will restart from zero.
              Wouldn't we want to keep at least _total at its current value, to keep the accumulated number of pulses over time?

              U Offline
              U Offline
              user2684
              Contest Winner
              wrote on last edited by
              #9

              @fredswed thanks for your analysis. I think you hit a bug here,I believe is correct that _total is set to 0 when the value is sent (so to start counting again) but it should not send that 0 value message. Keeping track with https://github.com/mysensors/NodeManager/issues/458

              F G 2 Replies Last reply
              0
              • U user2684

                @fredswed thanks for your analysis. I think you hit a bug here,I believe is correct that _total is set to 0 when the value is sent (so to start counting again) but it should not send that 0 value message. Keeping track with https://github.com/mysensors/NodeManager/issues/458

                F Offline
                F Offline
                fredswed
                wrote on last edited by
                #10

                @user2684 Thanks! Looking forward to a solution, one pulse at a time :-)

                1 Reply Last reply
                0
                • U user2684

                  @fredswed thanks for your analysis. I think you hit a bug here,I believe is correct that _total is set to 0 when the value is sent (so to start counting again) but it should not send that 0 value message. Keeping track with https://github.com/mysensors/NodeManager/issues/458

                  G Offline
                  G Offline
                  gomba777
                  wrote on last edited by
                  #11

                  @user2684

                  I'm trying to convert all my existing sensors from the old mysensors code to the nodemanager which is really a great and easy approach. The problem is that on the original mysensors water pulse sensor, the value is not reseted to 0 after each SEND but the total keeps incrementing. So my question is why is it better to reset to 0?

                  Also on the old water meter, there is a FLOW value and the sensor also try to get the existing value from the controller when starting. Do you think that could be implemented on the Nodemanager version?

                  F 1 Reply Last reply
                  0
                  • G gomba777

                    @user2684

                    I'm trying to convert all my existing sensors from the old mysensors code to the nodemanager which is really a great and easy approach. The problem is that on the original mysensors water pulse sensor, the value is not reseted to 0 after each SEND but the total keeps incrementing. So my question is why is it better to reset to 0?

                    Also on the old water meter, there is a FLOW value and the sensor also try to get the existing value from the controller when starting. Do you think that could be implemented on the Nodemanager version?

                    F Offline
                    F Offline
                    fredswed
                    wrote on last edited by
                    #12

                    @gomba777 I have only tried the NodeManager version but am considering the old-style code until it works. I would expect any water meter sensor to at least report accumulated totals, similarly to the physical device. I am sure that can be implemented in NodeManager - it is perfectly possible to use extend the framwork oneself even if it is not in there by default. It is more a question that someone as to put the time into it.
                    If the other code works for you, I guess the best choice is to hang on to it for a while longer.

                    1 Reply Last reply
                    0
                    • U Offline
                      U Offline
                      user2684
                      Contest Winner
                      wrote on last edited by
                      #13

                      Thanks @fredswed and @gomba777 I've added to the roadmap the capabilities you are referencing to from https://www.mysensors.org/build/pulse_water so the align with NodeManager's. I'll likely come back to you once the development will get to that point for reviewing the implementation if you don't mind. Thanks

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      18

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular