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. NodeManager: plugin for a rapid development of battery-powered sensors

NodeManager: plugin for a rapid development of battery-powered sensors

Scheduled Pinned Locked Moved NodeManager
223 Posts 23 Posters 72.9k Views 26 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.
  • gohanG gohan

    I think you need to call the begin if you power off the sensor

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

    Thanks @gohan. @Robbie_ if you can then try copying that "_dht->begin();" you have in line 576 of NodeManager.cpp also at the beginning of "SensorDHT::onLoop()" which is just below we can see if this can help (unfortunately I don't have anymore a DHT sensor to test by myself).

    Another try would be to disable both MySensors and NodeManager debug: I've seen strange behaviors happening when approaching the dynamic memory limit (including this) and since objects are allocated dynamically, it could be the case (this issue is partially mitigated in the dev branch)

    1 Reply Last reply
    0
    • B bilbolodz

      @user2684 said in NodeManager: plugin for a rapid development of battery-powered sensors:

      @bilbolodz multiple DS18B20 are supported indeed, when you register a DS18B20 sensor and provide the pin where multiple devices are attached, NodeManager will go through all of them (by calling getDeviceCount() of DallasTemperature) and will register each of them with a different child id. Is this what you were looking for?

      Multiple sensors: great but for me important thing is "fixed" matching exact DS18B20 to particular child id. I'm going to monitor may two function water boiler and check input/output temperature. In case when one of the DS disappear (because of many reasons) after next nodemanager device startup assigning sensors to child id will change and it will be a great problem. That's why I'm asking for exact assigning DS id - child id. Is it clear now?

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

      @bilbolodz I understand what you are saying. I've opened this: https://github.com/mysensors/NodeManager/issues/42. I did not consider this use case before because according to DallasTemperature documentation the attached sensors are always returned in the same order but you're right, if one of the sensor for any reason is not detected, it will mess up your logic. Thanks for reporting it.

      B V 2 Replies Last reply
      0
      • U user2684

        @bilbolodz I understand what you are saying. I've opened this: https://github.com/mysensors/NodeManager/issues/42. I did not consider this use case before because according to DallasTemperature documentation the attached sensors are always returned in the same order but you're right, if one of the sensor for any reason is not detected, it will mess up your logic. Thanks for reporting it.

        B Offline
        B Offline
        bilbolodz
        wrote on last edited by
        #44

        @user2684 Great, so I'm waiting for version 1.4. Any ideas about timeline?

        U 1 Reply Last reply
        0
        • U user2684

          @bilbolodz I understand what you are saying. I've opened this: https://github.com/mysensors/NodeManager/issues/42. I did not consider this use case before because according to DallasTemperature documentation the attached sensors are always returned in the same order but you're right, if one of the sensor for any reason is not detected, it will mess up your logic. Thanks for reporting it.

          V Offline
          V Offline
          vikasjee
          wrote on last edited by
          #45

          @user2684 This is exactly i had mentioned in my requirement for IOExpanded pins attached to any sensor or virtual buttons... getting the same child_id everytime. Hope its clear now...

          1 Reply Last reply
          0
          • U user2684

            Hi, @Robbie_ the order doesn't matter since all of this is happening inside before(), NodeManager just keeps track of all your settings without doing anything at that stage.

            Your configuration looks correct to me, the DHT sensor attached to pin 3, pin 6 playing the role of ground, pin 7 the role of vcc and waiting for 10 seconds after powering on, before actually reading the value from the sensor. The log also tells the same story, pin 7 is turned on, then 10s of sleep and then the "nan" read which I cannot really understand (the code is very simple, just executes a digitalWrite(_vcc_pin, HIGH) at that stage).
            Would you please ensure pin 7 is HIGH during the 10s sleep?

            Not sure if it matters (and those more expert than me with a DHT sensor can confirm) but I've noticed that I call dht.begin() only once (during before()) and during loop() I just call readTemperature(). Does powering off the sensor have an impact on this? e.g. should I call begin() before every read?
            Thanks

            R Offline
            R Offline
            Robbie_
            wrote on last edited by Robbie_
            #46

            @user2684 Thanks for your reply. Ive tested the following;

            i editted the NodeManager.cpp and added _dht->begin(); to the beginning of "SensorDHT::onLoop()"

            I also disabled both debug, still the same issue.

            In your other post you mentioned "Would you please ensure pin 7 is HIGH during the 10s sleep?"

            My log looks as following;

            PWR G=6 V=7
            REG I=1 P=3 P=6 T=0
            REG I=2 P=3 P=7 T=1
            NodeManager v1.30
            INT1 M=255
            INT2 M=255
            RADIO OK
            PRES I=200, T=23
            PRES I=201, T=30
            BATT V=3.26 P=94
            SEND D=0 I=201 C=0 T=38 S= I=0 F=3.26
            PRES I=1 T=6
            PRES I=2 T=7
            READY
            
            MY I=100 M=1
            SEND D=0 I=200 C=0 T=48 S=STARTED I=0 F=0.00
            ON P=7
            DHT I=1 T=nan
            OFF P=7
            SLEEP 60s
            SEND D=0 I=200 C=1 T=48 S=SLEEPING I=0 F=0.00
            
            AWAKE
            SEND D=0 I=200 C=1 T=48 S=AWAKE I=0 F=0.00
            ON P=7
            DHT I=1 T=nan
            OFF P=7
            SLEEP 60s
            SEND D=0 I=200 C=1 T=48 S=SLEEPING I=0 F=0.00
            

            Where do you want me to messure if the pin is on?

            AWAKE
            SEND D=0 I=200 C=1 T=48 S=AWAKE I=0 F=0.00
            ON P=7
            DHT I=1 T=nan
            <------------------------ I messured here and the voltage is 3.something volts
            OFF P=7
            SLEEP 60s
            <--------------------------- HERE?
            SEND D=0 I=200 C=1 T=48 S=SLEEPING I=0 F=0.00
            
            U 1 Reply Last reply
            1
            • gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #47

              use a multimeter and check if pin 7 during the startup of the arduino and see if you get 5v out for 10 seconds

              1 Reply Last reply
              0
              • B bilbolodz

                @user2684 Great, so I'm waiting for version 1.4. Any ideas about timeline?

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

                @bilbolodz v1.4 is actually ready, just want to see if the DHT issue discussed here requires a code fix or not before releasing but it is already available in the dev branch (https://github.com/mysensors/NodeManager/tree/8280de908929a117287a70e73cd047f50ab9a5bb). Let me explain the way I have implemented it because may look cumbersome but I didn't want to make exceptions and have a sensor configured in a different way the all the others.
                First of all, for any sensor, the child id can be manually assigned by providing a third argument to registerSensor(), e.g. to assign child id 5:

                nodeManager.registerSensor(SENSOR_THERMISTOR,A1,5);
                

                This was available also in v1.3 but not very clear from the docs. Of course this approach does not work when you have multiple DS18B20 sensors attached since they are all configured with a single line.
                So I have implemented a renameSensor() function which basically assign a different child id, e.g. to give the sensor with child id 1 the child id 5:

                nodeManager.renameSensor(1,5);
                

                This is available for all the sensors. So in the case of multiple DS18B20 you need to register them all in the usual way ( registerSensor(SENSOR_DS18B20,pin)) then assign the child id you like just after so in case one is lost, you still have a static mapping. The alternative would have been to provide a special registerSensor only for DS18B20 which I don't like that much. Any other better alternative of course is more than welcome!

                Btw, I have also added for DS18B20 getDeviceAddress() - in case you want to assign the child id based on the device address, getResolution() and setResolution()

                B 1 Reply Last reply
                0
                • R Robbie_

                  @user2684 Thanks for your reply. Ive tested the following;

                  i editted the NodeManager.cpp and added _dht->begin(); to the beginning of "SensorDHT::onLoop()"

                  I also disabled both debug, still the same issue.

                  In your other post you mentioned "Would you please ensure pin 7 is HIGH during the 10s sleep?"

                  My log looks as following;

                  PWR G=6 V=7
                  REG I=1 P=3 P=6 T=0
                  REG I=2 P=3 P=7 T=1
                  NodeManager v1.30
                  INT1 M=255
                  INT2 M=255
                  RADIO OK
                  PRES I=200, T=23
                  PRES I=201, T=30
                  BATT V=3.26 P=94
                  SEND D=0 I=201 C=0 T=38 S= I=0 F=3.26
                  PRES I=1 T=6
                  PRES I=2 T=7
                  READY
                  
                  MY I=100 M=1
                  SEND D=0 I=200 C=0 T=48 S=STARTED I=0 F=0.00
                  ON P=7
                  DHT I=1 T=nan
                  OFF P=7
                  SLEEP 60s
                  SEND D=0 I=200 C=1 T=48 S=SLEEPING I=0 F=0.00
                  
                  AWAKE
                  SEND D=0 I=200 C=1 T=48 S=AWAKE I=0 F=0.00
                  ON P=7
                  DHT I=1 T=nan
                  OFF P=7
                  SLEEP 60s
                  SEND D=0 I=200 C=1 T=48 S=SLEEPING I=0 F=0.00
                  

                  Where do you want me to messure if the pin is on?

                  AWAKE
                  SEND D=0 I=200 C=1 T=48 S=AWAKE I=0 F=0.00
                  ON P=7
                  DHT I=1 T=nan
                  <------------------------ I messured here and the voltage is 3.something volts
                  OFF P=7
                  SLEEP 60s
                  <--------------------------- HERE?
                  SEND D=0 I=200 C=1 T=48 S=SLEEPING I=0 F=0.00
                  
                  U Offline
                  U Offline
                  user2684
                  Contest Winner
                  wrote on last edited by
                  #49

                  @Robbie_ even if unfortunately I do not have a spare DHT sensor to test right now, I did some tests with other sensors trying to understand the issue. My educated guess it that the problem is related to the fact that setPowerPins() set both ground and vcc but initialize both to LOW. This means that when you register the sensor (and the DHT library is initialized), the sensor is off. This behavior will be changed in v1.4 (vcc wil be set to high). What you can do with the version you are currently running is to call nodeManager.powerOn() just after the call to setPowerPins() and before registering the sensor so to keep the power on.

                  If this does not work, try calling nodeManager.setAutoPowerPins(false) after setPowerPins(): this prevent nodeManager to turn the power off which is not what you want but can help in isolating the issue.
                  Thanks!

                  R 1 Reply Last reply
                  0
                  • luizrrochaL Offline
                    luizrrochaL Offline
                    luizrrocha
                    wrote on last edited by
                    #50

                    Hello, good work !!! I'll be trying your extension very soon....

                    Quick question: is it compatible with ATMEGA chips flashed with MYSBootloader pre-1.3a ?

                    U 1 Reply Last reply
                    0
                    • luizrrochaL luizrrocha

                      Hello, good work !!! I'll be trying your extension very soon....

                      Quick question: is it compatible with ATMEGA chips flashed with MYSBootloader pre-1.3a ?

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

                      @luizrrocha I did not test it by myself but the bootloader used should have no impact on the code (unless you need to call different/specific functions with that bootloader but I guess this is not the case).

                      1 Reply Last reply
                      0
                      • U user2684

                        @Robbie_ even if unfortunately I do not have a spare DHT sensor to test right now, I did some tests with other sensors trying to understand the issue. My educated guess it that the problem is related to the fact that setPowerPins() set both ground and vcc but initialize both to LOW. This means that when you register the sensor (and the DHT library is initialized), the sensor is off. This behavior will be changed in v1.4 (vcc wil be set to high). What you can do with the version you are currently running is to call nodeManager.powerOn() just after the call to setPowerPins() and before registering the sensor so to keep the power on.

                        If this does not work, try calling nodeManager.setAutoPowerPins(false) after setPowerPins(): this prevent nodeManager to turn the power off which is not what you want but can help in isolating the issue.
                        Thanks!

                        R Offline
                        R Offline
                        Robbie_
                        wrote on last edited by
                        #52

                        @user2684 Ive tested this morning a DHT22 without resistor between VIN & DATA, now it works correct. I reverted the changes back and just use the default code (1.3), everything keeps functioning. I don't understand why it works but hey, i got data! :-)

                        Somehow the following issue pops up with domoticz (also before the DHT22 was working), im not sure if anybody can help me here with it, else il open a threat at the domoticz forum. As soon ase NodeManager presents itself (via ESP8266 WiFi Gateway // MyS v2.1.0) to domoticz, domoticz goes offline. Does somebody else had the same experiance?

                        R 2 Replies Last reply
                        0
                        • R Robbie_

                          @user2684 Ive tested this morning a DHT22 without resistor between VIN & DATA, now it works correct. I reverted the changes back and just use the default code (1.3), everything keeps functioning. I don't understand why it works but hey, i got data! :-)

                          Somehow the following issue pops up with domoticz (also before the DHT22 was working), im not sure if anybody can help me here with it, else il open a threat at the domoticz forum. As soon ase NodeManager presents itself (via ESP8266 WiFi Gateway // MyS v2.1.0) to domoticz, domoticz goes offline. Does somebody else had the same experiance?

                          R Offline
                          R Offline
                          Robbie_
                          wrote on last edited by
                          #53
                          This post is deleted!
                          1 Reply Last reply
                          0
                          • R Robbie_

                            @user2684 Ive tested this morning a DHT22 without resistor between VIN & DATA, now it works correct. I reverted the changes back and just use the default code (1.3), everything keeps functioning. I don't understand why it works but hey, i got data! :-)

                            Somehow the following issue pops up with domoticz (also before the DHT22 was working), im not sure if anybody can help me here with it, else il open a threat at the domoticz forum. As soon ase NodeManager presents itself (via ESP8266 WiFi Gateway // MyS v2.1.0) to domoticz, domoticz goes offline. Does somebody else had the same experiance?

                            R Offline
                            R Offline
                            Robbie_
                            wrote on last edited by
                            #54

                            @Robbie_ Narrowed down the issue with domoticz, if i #define SERVICE_MESSAGES 1 in config.h domoticz crashes, if i put it back to 0 it stays online.

                            U 1 Reply Last reply
                            0
                            • R Robbie_

                              @Robbie_ Narrowed down the issue with domoticz, if i #define SERVICE_MESSAGES 1 in config.h domoticz crashes, if i put it back to 0 it stays online.

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

                              @Robbie_ glad to see it is working now! It has been still a good excuse for me to review and correct the logic of the power pins. Regarding SERVICE_MESSAGES, NodeManager sends a set of V_CUSTOM, SET messages from its service child id 200. When starts, it sends a STARTED payload , when going to sleep SLEEPING and when out of sleep AWAKE. I'm not familiar with domoticz but the service child id is presented correctly as S_CUSTOM, maybe the controller does not expect or handle a string payload. However, if you disable SERVICE_MESSAGES, this has no impact on the way NodeManager works, it just does not send those messages but if you are not using them, you are ready to go.
                              In future versions I should probably even disable SERVICE_MESSAGES by default also because I expect it costs in terms of battery to send string payloads...

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

                                Hi, v1.4 is out and available at https://github.com/mysensors/NodeManager:

                                • Added support for ML8511 UV intensity sensor
                                • Added support for MQ air quality sensor
                                • Added ability to manually assign a child id to a sensor
                                • Ensured compatibility for non-sleeping nodes
                                • Ability to control if waking up from an interrupt counts for a battery level report
                                • When power pins are set the sensor is powered on just after
                                • Service messages are disabled by default
                                • Bug fixes

                                Full changelog at https://github.com/mysensors/NodeManager/milestone/4?closed=1
                                Thanks!

                                1 Reply Last reply
                                1
                                • mar.conteM Offline
                                  mar.conteM Offline
                                  mar.conte
                                  wrote on last edited by mar.conte
                                  #57

                                  Hello,
                                  I am trying to sketch a simple PIR motion as an example the official NodeManager but does not appear to me the pir of domoticz
                                  DOMOTICZ OUTPUT

                                  1	S_TEMP		#1. V_TEMP (56.5)	true	1200	2017-04-09 12:11:15
                                  200	S_CUSTOM			true	1200	2017-04-09 11:34:45
                                  201	S_MULTIMETER			true	1200	2017-04-09 12:11:15
                                  255	S_ARDUINO_NODE	2.1.1```
                                  
                                  

                                  SKETCH

                                  /*
                                  NodeManager is intended to take care on your behalf of all those common tasks a MySensors node has to accomplish, speeding up the development cycle of your projects.
                                  
                                  NodeManager includes the following main components:
                                  - Sleep manager: allows managing automatically the complexity behind battery-powered sensors spending most of their time sleeping
                                  - Power manager: allows powering on your sensors only while the node is awake
                                  - Battery manager: provides common functionalities to read and report the battery level
                                  - Remote configuration: allows configuring remotely the node without the need to have physical access to it
                                  - Built-in personalities: for the most common sensors, provide embedded code so to allow their configuration with a single line 
                                  
                                  Documentation available on: https://mynodemanager.sourceforge.io 
                                   */
                                  
                                   
                                  // load user settings
                                  #include "config.h"
                                  // load MySensors library
                                  #include <MySensors.h>
                                  // load NodeManager library
                                  #include "NodeManager.h"
                                  
                                  // create a NodeManager instance
                                  NodeManager nodeManager;
                                  
                                  // before
                                  void before() {
                                    // setup the serial port baud rate
                                    Serial.begin(MY_BAUD_RATE);  
                                    /*
                                     * Register below your sensors
                                    */
                                    nodeManager.setSleep(SLEEP,60,MINUTES); 
                                    nodeManager.registerSensor(SENSOR_MOTION,3);
                                  
                                    /*
                                     * Register above your sensors
                                    */
                                    nodeManager.before();
                                  }
                                  
                                  // presentation
                                  void presentation() {
                                    // Send the sketch version information to the gateway and Controller
                                  	sendSketchInfo(SKETCH_NAME,SKETCH_VERSION);
                                    // call NodeManager presentation routine
                                    nodeManager.presentation();
                                  
                                  }
                                  
                                  // setup
                                  void setup() {
                                    // call NodeManager setup routine
                                    nodeManager.setup();
                                  }
                                  
                                  // loop
                                  void loop() {
                                    // call NodeManager loop routine
                                    nodeManager.loop();
                                  
                                  }
                                  
                                  // receive
                                  void receive(const MyMessage &message) {
                                    // call NodeManager receive routine
                                    nodeManager.receive(message);
                                  }
                                  

                                  M.C.

                                  gohanG 1 Reply Last reply
                                  0
                                  • U user2684

                                    @bilbolodz v1.4 is actually ready, just want to see if the DHT issue discussed here requires a code fix or not before releasing but it is already available in the dev branch (https://github.com/mysensors/NodeManager/tree/8280de908929a117287a70e73cd047f50ab9a5bb). Let me explain the way I have implemented it because may look cumbersome but I didn't want to make exceptions and have a sensor configured in a different way the all the others.
                                    First of all, for any sensor, the child id can be manually assigned by providing a third argument to registerSensor(), e.g. to assign child id 5:

                                    nodeManager.registerSensor(SENSOR_THERMISTOR,A1,5);
                                    

                                    This was available also in v1.3 but not very clear from the docs. Of course this approach does not work when you have multiple DS18B20 sensors attached since they are all configured with a single line.
                                    So I have implemented a renameSensor() function which basically assign a different child id, e.g. to give the sensor with child id 1 the child id 5:

                                    nodeManager.renameSensor(1,5);
                                    

                                    This is available for all the sensors. So in the case of multiple DS18B20 you need to register them all in the usual way ( registerSensor(SENSOR_DS18B20,pin)) then assign the child id you like just after so in case one is lost, you still have a static mapping. The alternative would have been to provide a special registerSensor only for DS18B20 which I don't like that much. Any other better alternative of course is more than welcome!

                                    Btw, I have also added for DS18B20 getDeviceAddress() - in case you want to assign the child id based on the device address, getResolution() and setResolution()

                                    B Offline
                                    B Offline
                                    bilbolodz
                                    wrote on last edited by
                                    #58

                                    @user2684 said in NodeManager: plugin for a rapid development of battery-powered sensors:

                                    This is available for all the sensors. So in the case of multiple DS18B20 you need to register them all in the usual way ( registerSensor(SENSOR_DS18B20,pin)) then assign the child id you like just after so in case one is lost, you still have a static mapping. The alternative would have been to provide a special registerSensor only for DS18B20 which I don't like that much. Any other better alternative of course is more than welcome!

                                    Thanks for support but actually in case of multiple DS18B20 your "general solution" is not very useful..... It require manual checking ID (first it IDs need to bs stored in EEPROM) renaming child id sensor in case of change and so on. In my private opinion it could be better add special registerSensor() function which takes pin and DS18B20 ID and register sensor (or not). Please consider these.

                                    U 1 Reply Last reply
                                    0
                                    • mar.conteM mar.conte

                                      Hello,
                                      I am trying to sketch a simple PIR motion as an example the official NodeManager but does not appear to me the pir of domoticz
                                      DOMOTICZ OUTPUT

                                      1	S_TEMP		#1. V_TEMP (56.5)	true	1200	2017-04-09 12:11:15
                                      200	S_CUSTOM			true	1200	2017-04-09 11:34:45
                                      201	S_MULTIMETER			true	1200	2017-04-09 12:11:15
                                      255	S_ARDUINO_NODE	2.1.1```
                                      
                                      

                                      SKETCH

                                      /*
                                      NodeManager is intended to take care on your behalf of all those common tasks a MySensors node has to accomplish, speeding up the development cycle of your projects.
                                      
                                      NodeManager includes the following main components:
                                      - Sleep manager: allows managing automatically the complexity behind battery-powered sensors spending most of their time sleeping
                                      - Power manager: allows powering on your sensors only while the node is awake
                                      - Battery manager: provides common functionalities to read and report the battery level
                                      - Remote configuration: allows configuring remotely the node without the need to have physical access to it
                                      - Built-in personalities: for the most common sensors, provide embedded code so to allow their configuration with a single line 
                                      
                                      Documentation available on: https://mynodemanager.sourceforge.io 
                                       */
                                      
                                       
                                      // load user settings
                                      #include "config.h"
                                      // load MySensors library
                                      #include <MySensors.h>
                                      // load NodeManager library
                                      #include "NodeManager.h"
                                      
                                      // create a NodeManager instance
                                      NodeManager nodeManager;
                                      
                                      // before
                                      void before() {
                                        // setup the serial port baud rate
                                        Serial.begin(MY_BAUD_RATE);  
                                        /*
                                         * Register below your sensors
                                        */
                                        nodeManager.setSleep(SLEEP,60,MINUTES); 
                                        nodeManager.registerSensor(SENSOR_MOTION,3);
                                      
                                        /*
                                         * Register above your sensors
                                        */
                                        nodeManager.before();
                                      }
                                      
                                      // presentation
                                      void presentation() {
                                        // Send the sketch version information to the gateway and Controller
                                      	sendSketchInfo(SKETCH_NAME,SKETCH_VERSION);
                                        // call NodeManager presentation routine
                                        nodeManager.presentation();
                                      
                                      }
                                      
                                      // setup
                                      void setup() {
                                        // call NodeManager setup routine
                                        nodeManager.setup();
                                      }
                                      
                                      // loop
                                      void loop() {
                                        // call NodeManager loop routine
                                        nodeManager.loop();
                                      
                                      }
                                      
                                      // receive
                                      void receive(const MyMessage &message) {
                                        // call NodeManager receive routine
                                        nodeManager.receive(message);
                                      }
                                      
                                      gohanG Offline
                                      gohanG Offline
                                      gohan
                                      Mod
                                      wrote on last edited by
                                      #59

                                      @mar.conte please include node log and gateway log when node tries to connect

                                      mar.conteM 1 Reply Last reply
                                      0
                                      • BeniKB Offline
                                        BeniKB Offline
                                        BeniK
                                        wrote on last edited by
                                        #60

                                        Needles to say and re-say this is really a much needed plugin for us beginners!

                                        Made a bunch of battery operating nodes with only DHT22 and all are working flawlessly.

                                        Today I tried making a node using a DS18B20 and DHT22. DS18B20 connected to digital pin 3 and DHT22 to digital pin 4. Both sensors have 10K resistors between their vcc and data lines (tried without resistors but none of the sensors worked).

                                        Sketch compiles and uploads fine to a Arduino Pro Mini 328 3.3v 8MHz. It also connects to the gateway, but I run into some problems;

                                        The first one being that watching from the serial debug, the node strarts up, connects to the gateway, reports some data and then hangs. No more activity from the node watching on the serial debug.

                                        The second one is that the node never sleeps - Activity led on Arduino Pro Mini remains lit.

                                        The last one is that DS18B20 reports the Temp to the gateway but DHT22 reports only Temp and not the Humidity. Tried changing pins for the sensors, but the same.

                                        Connection logs (from the serial interface) are as follows:

                                        REG I=1 P=3 P=6 T=0
                                        REG I=2 P=4 P=6 T=0
                                        REG I=3 P=4 P=7 T=1
                                        NodeManager v1.4
                                        INT1 M=255
                                        INT2 M=255
                                        RADIO OK
                                        PRES I=200, T=23
                                        PRES I=201, T=30
                                        BATT V=3.44 P=100
                                        SEND D=0 I=201 C=0 T=38 S= I=0 F=3.44
                                        PRES I=1 T=6
                                        PRES I=2 T=6
                                        PRES I=3 T=7
                                        READY
                                        
                                        MY I=199 M=1
                                        DS18B20 I=1 T=47.75
                                        SEND D=0 I=1 C=0 T=0 S= N=0 F=47.75
                                        DHT I=2 T=25.00
                                        SEND D=0 I=2 C=0 T=0 S= N=0 F=25.00
                                        

                                        And the sketch I use is as follows:

                                        /*
                                        NodeManager is intended to take care on your behalf of all those common tasks a MySensors node has to accomplish, speeding up the development cycle of your projects.
                                        
                                        NodeManager includes the following main components:
                                        - Sleep manager: allows managing automatically the complexity behind battery-powered sensors spending most of their time sleeping
                                        - Power manager: allows powering on your sensors only while the node is awake
                                        - Battery manager: provides common functionalities to read and report the battery level
                                        - Remote configuration: allows configuring remotely the node without the need to have physical access to it
                                        - Built-in personalities: for the most common sensors, provide embedded code so to allow their configuration with a single line 
                                        
                                        Documentation available on: https://github.com/mysensors/NodeManager
                                         */
                                        
                                         
                                        // load user settings
                                        #include "config.h"
                                        // load MySensors library
                                        #include <MySensors.h>
                                        // load NodeManager library
                                        #include "NodeManager.h"
                                        
                                        // create a NodeManager instance
                                        NodeManager nodeManager;
                                        
                                        // before
                                        void before() {
                                          // setup the serial port baud rate
                                          Serial.begin(MY_BAUD_RATE);  
                                          /*
                                           * Register below your sensors
                                          */
                                        
                                            nodeManager.setBatteryMin(2.0);
                                            nodeManager.setBatteryMax(3.3);
                                            nodeManager.setSleep(SLEEP,60,SECONDS);
                                            nodeManager.registerSensor(SENSOR_DS18B20,3);
                                            nodeManager.registerSensor(SENSOR_DHT22,4);
                                        
                                          /*
                                           * Register above your sensors
                                          */
                                          nodeManager.before();
                                        }
                                        
                                        // presentation
                                        void presentation() {
                                          // Send the sketch version information to the gateway and Controller
                                        	sendSketchInfo(SKETCH_NAME,SKETCH_VERSION);
                                          // call NodeManager presentation routine
                                          nodeManager.presentation();
                                        
                                        }
                                        
                                        // setup
                                        void setup() {
                                          // call NodeManager setup routine
                                          nodeManager.setup();
                                        }
                                        
                                        // loop
                                        void loop() {
                                          // call NodeManager loop routine
                                          nodeManager.loop();
                                        
                                        }
                                        
                                        // receive
                                        void receive(const MyMessage &message) {
                                          // call NodeManager receive routine
                                          nodeManager.receive(message);
                                        }
                                        

                                        Also on config.h I have enabled DS18B20 and DHT22 modules.

                                        Really, any help would be welcome!

                                        Thanks all in advance!

                                        U 1 Reply Last reply
                                        0
                                        • gohanG gohan

                                          @mar.conte please include node log and gateway log when node tries to connect

                                          mar.conteM Offline
                                          mar.conteM Offline
                                          mar.conte
                                          wrote on last edited by mar.conte
                                          #61

                                          @gohan

                                          node

                                          0 MCO:BGN:INIT NODE,CP=RRNNA--,VER=2.1.1
                                          40 MCO:BGN:BFR
                                          REG I=1 P=3 P=6 T=0
                                          NodeManager v1.4
                                          INT1 M=255
                                          INT2 M=255
                                          59 TSM:INIT
                                          135 TSF:WUR:MS=0
                                          155 TSM:INIT:TSP OK
                                          176 TSM:INIT:STATID=100
                                          202 TSF:SID:OK,ID=100
                                          225 TSM:FPAR
                                          370 TSF:MSG:SEND,100-100-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
                                          2244 TSF:MSG:READ,0-0-100,s=255,c=3,t=8,pt=1,l=1,sg=0:0
                                          2301 TSF:MSG:FPAR OK,ID=0,D=1
                                          2447 TSM:FPAR:OK
                                          2463 TSM:ID
                                          2478 TSM:ID:OK
                                          2492 TSM:UPL
                                          2639 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
                                          3678 TSF:MSG:READ,0-0-100,s=255,c=3,t=25,pt=1,l=1,sg=0:1
                                          3737 TSF:MSG:PONG RECV,HP=1
                                          3768 TSM:UPL:OK
                                          3784 TSM:READY:ID=100,PAR=0,DIS=1
                                          3883 TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
                                          4003 TSF:MSG:READ,0-0-100,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
                                          4202 !TSF:MSG:SEND,100-100-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=NACK:2.1.1
                                          4415 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=NACK:0
                                          6733 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=11,pt=0,l=19,sg=0,ft=2,st=NACK:NodeManagerTemplate
                                          6928 TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=3,st=OK:1.0
                                          RADIO OK
                                          PRES I=200, T=23
                                          7137 !TSF:MSG:SEND,100-100-0-0,s=200,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=NACK:
                                          PRES I=201, T=30
                                          7321 TSF:MSG:SEND,100-100-0-0,s=201,c=0,t=30,pt=0,l=0,sg=0,ft=1,st=OK:
                                          BATT V=3.25 P=93
                                          SEND D=0 I=201 C=0 T=38 S= I=0 F=3.25
                                          7469 !MCO:SND:NODE NOT REG
                                          7587 TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:93
                                          PRES I=1 T=6
                                          7794 !TSF:MSG:SEND,100-100-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=NACK:
                                          READY
                                          
                                          7868 MCO:REG:REQ
                                          7933 TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=OK:2
                                          9019 TSF:MSG:READ,0-0-100,s=255,c=3,t=27,pt=1,l=1,sg=0:1
                                          9078 MCO:PIM:NODE REG=1
                                          9105 MCO:BGN:STP
                                          MY I=100 M=1
                                          9123 MCO:BGN:INIT OK,TSP=1
                                          THER I=1 V=354.00 T=40.05
                                           M=1
                                          SEND D=0 I=1 C=0 T=0 S= N=0 F=40.05
                                          9224 TSF:MSG:SEND,100-100-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:40.05
                                          SLEEP 3600s
                                          
                                          9316 MCO:SLP:MS=3600000,SMS=1,I1=255,M1=255,I2=255,M2=255
                                          9527 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=NACK:287
                                          9607 TSF:MSG:READ,0-0-100,s=255,c=3,t=27,pt=1,l=1,sg=0:1
                                          9666 !TSF:MSG:LEN,0!=8
                                          10108 MCO:SLP:TPD```
                                          
                                          
                                          

                                          Gateway

                                          0;255;3;0;9;TSF:MSG:READ,100-100-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
                                          0;255;3;0;9;TSF:MSG:BC
                                          0;255;3;0;9;TSF:MSG:FPAR REQ,ID=100
                                          0;255;3;0;9;TSF:PNG:SEND,TO=0
                                          0;255;3;0;9;TSF:CKU:OK
                                          0;255;3;0;9;TSF:MSG:GWL OK
                                          0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
                                          0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
                                          0;255;3;0;9;TSF:MSG:PINGED,ID=100,HP=1
                                          0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
                                          0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
                                          0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
                                          0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=0,t=17,pt=0,l=5,sg=0:2.1.1
                                          0;255;3;0;9;Sending message on topic: domoticz/in/MyMQTT/100/255/0/0/17
                                          0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=11,pt=0,l=19,sg=0:NodeManagerTemplate
                                          0;255;3;0;9;Sending message on topic: domoticz/in/MyMQTT/100/255/3/0/11
                                          0;255;3;0;9;TSF:MSG:READ,100-100-0,s=200,c=0,t=23,pt=0,l=0,sg=0:
                                          0;255;3;0;9;Sending message on topic: domoticz/in/MyMQTT/100/200/0/0/23
                                          0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=0,pt=1,l=1,sg=0:85
                                          0;255;3;0;9;Sending message on topic: domoticz/in/MyMQTT/100/255/3/0/0
                                          0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
                                          0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
                                          0;255;3;0;9;TSF:MSG:READ,100-100-0,s=1,c=1,t=0,pt=7,l=5,sg=0:36.72
                                          0;255;3;0;9;Sending message on topic: domoticz/in/MyMQTT/100/1/1/0/0
                                          0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=22,pt=5,l=4,sg=0:286
                                          0;255;3;0;9;Sending message on topic: domoticz/in/MyMQTT/100/255/3/0/22
                                          0;255;3;0;9;Message arrived on topic: domoticz/out/MyMQTT/0/0/3/0/18
                                          0;255;3;0;9;Sending message on topic: domoticz/in/MyMQTT/0/255/3/0/22
                                          

                                          0_1491753073560_domoticz_screen.jpg

                                          M.C.

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


                                          12

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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