@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