NodeManager: Motion/Door (Interrupt) Sensor stopping DHT22 from reading value after a while



  • Hi All

    I am having a strange issue with my setup where after some time NodeManager seems to just stop reading my DHT22 sensor data, the Adruino Pro Mini will still response to the Motion and Door Interrupts but stops sensing the Temp and Hum data to my controller (Home Assistant).

    Setup:

    • Arduino Pro Mini 3.3v
    • HC-SR501 Passive Infrared Sensor (PIR) (PIN 2)
    • Reed Switch for Door Sensor (PIN 3)
    • DHT22 Temp/Hum Sensor (PIN 4)
    • DS1302 Real Time Clock (As a test)
    • NRF24L01+ with Capacitors
    • MySensors 2.3.0 release
    • NodeManager (Latest Development Branch)

    Debug logs from node:

    [Starting] Opening the serial port - COM5
    [Info] Opened the serial port - COM5
    0 NM:INIT:VER=1.8-dev
    0 NM:INIT:INO=NodeManager-DoorSensor v0.4
    0 NM:INIT:LIB VER=2.3.0 CP=RNNNA---
    0 NM:INIT:RBT p=255
    20 NM:BFR:INIT
    4093 NM:BFR:OK
    4112 NM:PRES:CONFIG(200) p=23 t=48
    4151 NM:PRES:BATTERY(14) p=30 t=38
    4190 NM:PRES:DHT22(1) p=6 t=0
    4225 NM:PRES:DHT22(2) p=7 t=1

    4294 NM:PRES:DOOR(3) p=0 t=16
    4362 NM:PRES:MOTION(4) p=1 t=16
    4470 NM:MSG:RECV(200) c=0 t=23 p=CONFIG
    4511 NM:PWR:ON p=7
    4532 NM:MSG:RECV(14) c=0 t=30 p=BATTERY
    4575 NM:PWR:ON p=7
    4595 NM:MSG:RECV(1) c=0 t=6 p=DHT22
    4632 NM:PWR:ON p=7
    4704 NM:PWR:OFF p=6
    4724 NM:PWR:OFF p=6
    4745 NM:PWR:OFF p=6
    4767 NM:PWR:ON p=7
    4839 NM:STP:ID=1 M=1
    4861 NM:BFR:INT p=3 m=1
    4886 NM:BFR:INT p=2 m=1
    4911 NM:PWR:OFF p=6
    5005 NM:STP:HW V=3319 F=9 M=843
    5040 NM:PWR:ON p=7
    5566 NM:LOOP:BATTERY(14):SET t=38 v=3.91
    5611 NM:MSG:SEND(14) t=38 p=3.91
    5652 NM:LOOP:DHT22(1):SET t=0 v=23.30
    5699 NM:LOOP:DHT22(2):SET t=1 v=53.00

    5738 NM:MSG:SEND(1) t=0 p=23.30
    5775 NM:MSG:SEND(2) t=1 p=53.00
    5810 NM:PWR:OFF p=6
    5830 NM:SLP:SLEEP s=60

    5859 NM:MSG:RECV(1) c=1 t=0 p=
    5892 NM:PWR:ON p=7
    5912 NM:MSG:RECV(2) c=1 t=1 p=
    5945 NM:PWR:ON p=7
    6014 NM:PWR:OFF p=6
    6035 NM:PWR:OFF p=6
    8040 NM:LOOP:INT p=2 v=0
    8067 NM:SLP:AWAKE
    8085 NM:PWR:ON p=7
    8155 NM:LOOP:MOTION(4):SET t=16 v=0
    8192 NM:MSG:SEND(4) t=16 p=0

    8224 NM:PWR:OFF p=6
    8245 NM:SLP:SLEEP s=60

    8273 NM:MSG:RECV(4) c=1 t=16 p=
    8306 NM:PWR:ON p=7
    8378 NM:PWR:OFF p=6
    10455 NM:LOOP:INT p=2 v=1
    10481 NM:SLP:AWAKE
    10502 NM:PWR:ON p=7
    10573 NM:LOOP:MOTION(4):SET t=16 v=1
    10612 NM:MSG:SEND(4) t=16 p=1

    10645 NM:PWR:OFF p=6
    10668 NM:SLP:SLEEP s=60

    10696 NM:MSG:RECV(4) c=1 t=16 p=
    10731 NM:PWR:ON p=7
    10803 NM:PWR:OFF p=6
    12877 NM:LOOP:INT p=2 v=0
    12904 NM:SLP:AWAKE
    12924 NM:PWR:ON p=7
    12996 NM:LOOP:MOTION(4):SET t=16 v=0
    13035 NM:MSG:SEND(4) t=16 p=0

    13068 NM:PWR:OFF p=6
    13090 NM:SLP:SLEEP s=60

    13119 NM:MSG:RECV(4) c=1 t=16 p=
    13154 NM:PWR:ON p=7
    13225 NM:PWR:OFF p=6
    15300 NM:LOOP:INT p=2 v=1
    15327 NM:SLP:AWAKE
    15347 NM:PWR:ON p=7
    15419 NM:LOOP:MOTION(4):SET t=16 v=1
    15458 NM:MSG:SEND(4) t=16 p=1

    15491 NM:PWR:OFF p=6
    15513 NM:SLP:SLEEP s=60

    15542 NM:MSG:RECV(4) c=1 t=16 p=
    15577 NM:PWR:ON p=7
    15648 NM:PWR:OFF p=6
    17725 NM:LOOP:INT p=2 v=0
    17752 NM:SLP:AWAKE
    17772 NM:PWR:ON p=7
    17844 NM:LOOP:MOTION(4):SET t=16 v=0
    17883 NM:MSG:SEND(4) t=16 p=0

    17915 NM:PWR:OFF p=6
    17938 NM:SLP:SLEEP s=60

    17967 NM:MSG:RECV(4) c=1 t=16 p=
    18001 NM:PWR:ON p=7
    18073 NM:PWR:OFF p=6
    20150 NM:LOOP:INT p=2 v=1
    20176 NM:SLP:AWAKE
    20197 NM:PWR:ON p=7
    20267 NM:LOOP:MOTION(4):SET t=16 v=1
    20305 NM:MSG:SEND(4) t=16 p=1

    20338 NM:PWR:OFF p=6
    20361 NM:SLP:SLEEP s=60

    20389 NM:MSG:RECV(4) c=1 t=16 p=
    20424 NM:PWR:ON p=7
    20496 NM:PWR:OFF p=6
    22571 NM:SLP:AWAKE
    [Temp Sensor Data Missing]<<
    22591 NM:PWR:ON p=7
    22661 NM:PWR:OFF p=6
    22683 NM:SLP:SLEEP s=60

    24893 NM:LOOP:INT p=2 v=0
    24920 NM:SLP:AWAKE
    24940 NM:PWR:ON p=7
    25012 NM:LOOP:MOTION(4):SET t=16 v=0
    25051 NM:MSG:SEND(4) t=16 p=0

    25083 NM:PWR:OFF p=6
    25106 NM:SLP:SLEEP s=60

    25135 NM:MSG:RECV(4) c=1 t=16 p=
    25169 NM:PWR:ON p=7
    25241 NM:PWR:OFF p=6
    27318 NM:LOOP:INT p=2 v=1
    27344 NM:SLP:AWAKE
    27365 NM:PWR:ON p=7
    27435 NM:LOOP:MOTION(4):SET t=16 v=1
    27473 NM:MSG:SEND(4) t=16 p=1

    27506 NM:PWR:OFF p=6
    27529 NM:SLP:SLEEP s=60

    27557 NM:MSG:RECV(4) c=1 t=16 p=
    27592 NM:PWR:ON p=7
    27664 NM:PWR:OFF p=6
    29739 NM:LOOP:INT p=2 v=0
    29765 NM:SLP:AWAKE
    29786 NM:PWR:ON p=7
    29857 NM:LOOP:MOTION(4):SET t=16 v=0
    29896 NM:MSG:SEND(4) t=16 p=0

    29929 NM:PWR:OFF p=6
    29952 NM:SLP:SLEEP s=60

    29980 NM:MSG:RECV(4) c=1 t=16 p=
    30015 NM:PWR:ON p=7
    30085 NM:PWR:OFF p=6
    32161 NM:LOOP:INT p=2 v=1
    32188 NM:SLP:AWAKE
    32208 NM:PWR:ON p=7
    32280 NM:LOOP:MOTION(4):SET t=16 v=1
    32319 NM:MSG:SEND(4) t=16 p=1

    32352 NM:PWR:OFF p=6
    32374 NM:SLP:SLEEP s=60

    32403 NM:MSG:RECV(4) c=1 t=16 p=
    32438 NM:PWR:ON p=7
    32509 NM:PWR:OFF p=6
    34584 NM:LOOP:INT p=2 v=0
    34611 NM:SLP:AWAKE
    34631 NM:PWR:ON p=7
    34703 NM:LOOP:MOTION(4):SET t=16 v=0
    34742 NM:MSG:SEND(4) t=16 p=0

    34775 NM:PWR:OFF p=6
    34797 NM:SLP:SLEEP s=60

    34828 NM:MSG:RECV(4) c=1 t=16 p=
    34863 NM:PWR:ON p=7
    34934 NM:PWR:OFF p=6
    37009 NM:LOOP:INT p=2 v=1
    37036 NM:SLP:AWAKE
    37056 NM:PWR:ON p=7
    37126 NM:LOOP:MOTION(4):SET t=16 v=1
    37165 NM:MSG:SEND(4) t=16 p=1

    37197 NM:PWR:OFF p=6
    37220 NM:SLP:SLEEP s=60

    37249 NM:MSG:RECV(4) c=1 t=16 p=
    37283 NM:PWR:ON p=7
    37355 NM:PWR:OFF p=6
    39432 NM:SLP:AWAKE
    39452 NM:PWR:ON p=7
    [Temp Sensor Data Missing]<<
    39524 NM:PWR:OFF p=6
    39546 NM:SLP:SLEEP s=60

    41754 NM:SLP:AWAKE
    41775 NM:PWR:ON p=7
    [Temp Sensor Data Missing]<<
    41846 NM:PWR:OFF p=6
    41869 NM:SLP:SLEEP s=60

    44077 NM:SLP:AWAKE
    44097 NM:PWR:ON p=7
    44169 NM:PWR:OFF p=6
    44191 NM:SLP:SLEEP s=60
    >>[Temp Sensor Data Missing]<<
    46399 NM:SLP:AWAKE
    46419 NM:PWR:ON p=7
    46491 NM:PWR:OFF p=6
    46514 NM:SLP:SLEEP s=60

    [Starting] Opening the serial port - COM5
    [Info] Opened the serial port - COM5
    0 NM:INIT:VER=1.8-dev
    0 NM:INIT:INO=NodeManager-DoorSensor v0.4
    0 NM:INIT:LIB VER=2.3.0 CP=RNNNA---
    0 NM:INIT:RBT p=255
    20 NM:BFR:INIT
    6129 NM:BFR:OK
    6148 NM:PRES:CONFIG(200) p=23 t=48
    6187 NM:PRES:BATTERY(14) p=30 t=38
    6225 NM:PRES:DHT22(1) p=6 t=0
    6260 NM:PRES:DHT22(2) p=7 t=1

    6330 NM:PRES:DOOR(3) p=0 t=16
    6397 NM:PRES:MOTION(4) p=1 t=16
    6506 NM:MSG:RECV(200) c=0 t=23 p=CONFIG
    6547 NM:PWR:ON p=7
    6567 NM:MSG:RECV(14) c=0 t=30 p=BATTERY
    6610 NM:PWR:ON p=7
    6631 NM:MSG:RECV(1) c=0 t=6 p=DHT22
    6668 NM:PWR:ON p=7
    6739 NM:PWR:OFF p=6
    6760 NM:PWR:OFF p=6
    6780 NM:PWR:OFF p=6
    6803 NM:PWR:ON p=7
    6871 NM:STP:ID=1 M=1
    6893 NM:BFR:INT p=3 m=1
    6918 NM:BFR:INT p=2 m=3
    6942 NM:PWR:OFF p=6
    7036 NM:STP:HW V=3309 F=9 M=843
    7071 NM:PWR:ON p=7
    7596 NM:LOOP:BATTERY(14):SET t=38 v=3.81
    7641 NM:MSG:SEND(14) t=38 p=3.81
    7682 NM:LOOP:DHT22(1):SET t=0 v=22.90
    7729 NM:LOOP:DHT22(2):SET t=1 v=52.80

    7768 NM:MSG:SEND(1) t=0 p=22.90
    7804 NM:MSG:SEND(2) t=1 p=52.80
    7839 NM:PWR:OFF p=6
    7860 NM:SLP:SLEEP s=60

    7888 NM:MSG:RECV(1) c=1 t=0 p=
    7921 NM:PWR:ON p=7
    7942 NM:MSG:RECV(2) c=1 t=1 p=
    7974 NM:PWR:ON p=7
    8044 NM:PWR:OFF p=6
    8065 NM:PWR:OFF p=6
    10070 NM:SLP:AWAKE
    10090 NM:PWR:ON p=7
    10616 NM:LOOP:BATTERY(14):SET t=38 v=3.94
    10661 NM:MSG:SEND(14) t=38 p=3.94
    10704 NM:LOOP:DHT22(1):SET t=0 v=23.00
    10752 NM:LOOP:DHT22(2):SET t=1 v=52.90

    10792 NM:MSG:SEND(1) t=0 p=23.00
    10829 NM:MSG:SEND(2) t=1 p=52.90
    10866 NM:PWR:OFF p=6
    10889 NM:SLP:SLEEP s=60

    10917 NM:MSG:RECV(1) c=1 t=0 p=
    10952 NM:PWR:ON p=7
    10973 NM:MSG:RECV(2) c=1 t=1 p=
    11008 NM:PWR:ON p=7
    11079 NM:PWR:OFF p=6
    11102 NM:PWR:OFF p=6
    13099 NM:LOOP:INT p=2 v=1
    13125 NM:SLP:AWAKE
    13146 NM:PWR:ON p=7
    13217 NM:LOOP:MOTION(4):SET t=16 v=1
    13256 NM:MSG:SEND(4) t=16 p=1

    13289 NM:PWR:OFF p=6
    13312 NM:SLP:SLEEP s=60

    13340 NM:MSG:RECV(4) c=1 t=16 p=
    13375 NM:PWR:ON p=7
    13445 NM:PWR:OFF p=6
    15521 NM:SLP:AWAKE
    15542 NM:PWR:ON p=7
    [Temp Sensor Data Missing]<<
    15613 NM:PWR:OFF p=6
    15636 NM:SLP:SLEEP s=60

    17846 NM:SLP:AWAKE
    17866 NM:PWR:ON p=7
    [Temp Sensor Data Missing]<<
    17938 NM:PWR:OFF p=6
    17960 NM:SLP:SLEEP s=60

    20168 NM:SLP:AWAKE
    20189 NM:PWR:ON p=7
    [Temp Sensor Data Missing]<<
    20260 NM:PWR:OFF p=6
    20283 NM:SLP:SLEEP s=60

    22493 NM:SLP:AWAKE
    22513 NM:PWR:ON p=7
    [Temp Sensor Data Missing]<<
    22585 NM:PWR:OFF p=6
    22607 NM:SLP:SLEEP s=60

    My Code:

    #define SKETCH_NAME "NodeManager-DoorSensor"
    #define SKETCH_VERSION "0.4"
    #define MY_RADIO_NRF24
    #define MY_BAUD_RATE 9600
    //#define MY_SPLASH_SCREEN_DISABLED
    //#define MY_DEBUG
    
    /***********************************
     * NodeManager configuration
     */
    #define NODEMANAGER_DEBUG OFF
    #define NODEMANAGER_DEBUG_VERBOSE OFF
    #define NODEMANAGER_INTERRUPTS ON
    #define NODEMANAGER_SLEEP ON
    #define NODEMANAGER_RECEIVE ON
    #define NODEMANAGER_POWER_MANAGER ON
    #define NODEMANAGER_CONDITIONAL_REPORT OFF
    #define NODEMANAGER_EEPROM OFF
    #define NODEMANAGER_TIME ON
    #define NODEMANAGER_RTC ON
    #define NODEMANAGER_SD OFF
    #define NODEMANAGER_HOOKING OFF
    #define NODEMANAGER_OTA_CONFIGURATION ON
    #define NODEMANAGER_SERIAL_INPUT OFF
    
     // import NodeManager library (a nodeManager object will be then made available)
    #include <MySensors_NodeManager.h>
    
    /***********************************
     * NodeManager Sensors
     */
    PowerManager power(6, 7);
    
    #include <sensors/SensorBattery.h>
    SensorBattery battery(A0);
    
    #include <sensors/SensorDHT22.h>
    SensorDHT22 dht22(4);
    
    #include <sensors/SensorDoor.h>
    SensorDoor door(3);
    
    #include <sensors/SensorMotion.h>
    SensorMotion motion(2);
    
    // Define Functions below here or use other .ino or cpp files
    //
    
    // before
    void before()
    {
    	nodeManager.setSleepMinutes(5);
    	nodeManager.setReportIntervalMinutes(5);
    
    	nodeManager.setPowerManager(power);
    
    	nodeManager.setAck(true);
    
    	/***********************************
    	 * Sensor Configuration
    	 */
    
    	 //Battery Voltage Sensor
    	float voltageDividerFactor = (1000000 + 300000) / 300000; //(1M Ohm + 330K Ohm) / 330K Ohm);
    	float RefVcc = 1.1;
    	float maxValue = voltageDividerFactor * RefVcc;
    	float voltsPerBit = maxValue / 1024;
    
    	battery.setMinVoltage(2.7);
    	battery.setMaxVoltage(4.2);
    	battery.setBatteryInternalVcc(false);
    	battery.setBatteryPin(A0);
    	battery.setBatteryVoltsPerBit(voltsPerBit);
    	battery.setSamples(3);
    	battery.setReportIntervalMinutes(5);
    
    	//Motion Sensor
    	motion.setInterruptMode(CHANGE);
    
    	nodeManager.setSyncTimeAfterInterval(1440);
    
    	nodeManager.before();
    }
    
    
    // presentation
    void presentation() {
    	// call NodeManager presentation routine
    	nodeManager.presentation();
    }
    
    // The setup() function runs once each time the micro-controller starts
    void setup()
    {
    	// call NodeManager setup routine
    	nodeManager.setup();
    }
    
    // Add the main program code into the continuous loop() function
    void loop()
    {
    	//door.se
    	// 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
    

    Bug logged: https://github.com/mysensors/NodeManager/issues/437

    Any help would be greatly appreciated.

    Thanks



  • How did you wire the dht22? I had problems with it when I didn't use a pull up resistor in the past



  • @electrik said in NodeManager: Motion/Door (Interrupt) Sensor stopping DHT22 from reading value after a while:

    How did you wire the dht22? I had problems with it when I didn't use a pull up resistor in the past

    The breakout board I'm using supposedly has one integrated, will verify later this week as I'm out of town. The stage thing is if I disable the interrupt sensors (Prevent them from triggering) then the DHT does not stop reporting in.


Log in to reply
 

Suggested Topics

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts