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.
  • grauG Offline
    grauG Offline
    grau
    wrote on last edited by
    #212

    Thank you very much. BTW: Is it possible to use Nodemanager with two, three or even four door sensors on a single ESP8266 (as Gateway without NRF radio)? Any help very appreciated!

    U 1 Reply Last reply
    0
    • grauG grau

      Thank you very much. BTW: Is it possible to use Nodemanager with two, three or even four door sensors on a single ESP8266 (as Gateway without NRF radio)? Any help very appreciated!

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

      @grau the current door sensor implementation (SensorDoor class) leverages attachInterrupt(); not sure how many interrupt pins are there on a ESP8266 but if there are enough it should work

      1 Reply Last reply
      0
      • U user2684

        Hi, being a newbie in this wonderful MySensors world, I found myself excited about the flexibility of the overall platform but also somehow implementing the same common functionalities across my sensors over and over again. I decided then to spend some reasonable amount of time to expand the idea behind MyExtention (https://forum.mysensors.org/topic/6062/myextension) into something I have called NodeManager (I know, I'm bad with names!).

        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. It should help who is new to MySensors to get up to speed quicker and for those already into the matter to delegate to NodeManager common and boring tasks so to focus on more interesting scenarios.

        NodeManager main features are:

        • Manage all the aspects of a sleeping cycle by leveraging smart sleep
        • Allow configuring the sleep mode and the sleep duration remotely
        • Allow waking up a sleeping node remotely at the end of a sleeping cycle
        • Allow powering on each connected sensor only while the node is awake to save battery
        • Report battery level periodically and automatically
        • Calculate battery level without requiring an additional pin and the resistors
        • Report battery voltage through a built-in sensor
        • Can report battery level on demand
        • Allow rebooting the board remotely
        • Provide out-of-the-box sensors personalities and automatically execute their main task at each cycle

        Specifically on this last point, the idea behind providing built-in the functionalities of most common sensors is to simplify the development especially for somebody new to it.
        E.g. if I connect a thermistor to one of the pin, I just need a single line to have it working, as it was leveraging some sort of embedded firmware:

        nodeManager.registerSensor(SENSOR_THERMISTOR,A2);
        

        The following built-in sensors are available:

        • SENSOR_ANALOG_INPUT Generic analog sensor, return a pin's analog value or its percentage
        • SENSOR_LDR LDR sensor, return the light level of an attached light resistor in percentage
        • SENSOR_THERMISTOR Thermistor sensor, return the temperature based on the attached thermistor
        • SENSOR_DIGITAL_INPUT Generic digital sensor, return a pin's digital value
        • SENSOR_DIGITAL_OUTPUT Generic digital output sensor, allows setting the digital output of a pin to the requested value
        • SENSOR_RELAY Relay sensor, allows activating the relay
        • SENSOR_LATCHING_RELAY Latching Relay sensor, allows activating the relay with a pulse
        • SENSOR_DHT11 DHT11 sensor, return temperature/humidity based on the attached DHT sensor
        • SENSOR_DHT22 DHT22 sensor, return temperature/humidity based on the attached DHT sensor
        • SENSOR_SHT21 SHT21 sensor, return temperature/humidity based on the attached SHT21 sensor
        • SENSOR_SWITCH Generic switch, wake up the board when a pin changes status
        • SENSOR_DOOR Door sensor, wake up the board and report when an attached magnetic sensor has been opened/closed
        • SENSOR_MOTION Motion sensor, wake up the board and report when an attached PIR has triggered
        • SENSOR_DS18B20 DS18B20 sensor, return the temperature based on the attached sensor

        I put the package on Sourceforce so to avoid leaving here piece of code which may become obsolete in a short time.

        The project is here: https://sourceforge.net/projects/mynodemanager
        I've also tried to document everything the best as I could on https://sourceforge.net/p/mynodemanager/wiki

        Thanks

        RPunktR Offline
        RPunktR Offline
        RPunkt
        wrote on last edited by
        #214

        @user2684 Hello all of You,
        this topic is quite old, but hopefully someone is reading this.
        I could not figure out, what to do if the NRF24 is wired to different pins.
        I have a board with nrf24 on board, but this are connected like:
        // Enable and select radio type attached
        #define MY_RADIO_NRF24
        #define MY_RF24_CE_PIN 7
        #define MY_RF24_CS_PIN 10
        #define MY_SOFT_SPI_SCK_PIN 11
        #define MY_SOFT_SPI_MOSI_PIN 12
        #define MY_SOFT_SPI_MISO_PIN 13
        How can this be inplemented in the nodemanager?

        U 1 Reply Last reply
        0
        • RPunktR RPunkt

          @user2684 Hello all of You,
          this topic is quite old, but hopefully someone is reading this.
          I could not figure out, what to do if the NRF24 is wired to different pins.
          I have a board with nrf24 on board, but this are connected like:
          // Enable and select radio type attached
          #define MY_RADIO_NRF24
          #define MY_RF24_CE_PIN 7
          #define MY_RF24_CS_PIN 10
          #define MY_SOFT_SPI_SCK_PIN 11
          #define MY_SOFT_SPI_MOSI_PIN 12
          #define MY_SOFT_SPI_MISO_PIN 13
          How can this be inplemented in the nodemanager?

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

          @rpunkt just use those directives in your sketch, no differences with NodeManager, those will be seen by the MySensors library and applied. Thanks

          RPunktR 1 Reply Last reply
          0
          • U user2684

            @rpunkt just use those directives in your sketch, no differences with NodeManager, those will be seen by the MySensors library and applied. Thanks

            RPunktR Offline
            RPunktR Offline
            RPunkt
            wrote on last edited by
            #216

            @user2684 Thanks a lot. I should have tried this, before to post a question, but sometimes the brain is sticky.

            1 Reply Last reply
            0
            • RPunktR Offline
              RPunktR Offline
              RPunkt
              wrote on last edited by
              #217

              Hello all of You,
              if have a flight time sensor VL53L0X, that is running so far.
              It should measure the water level in a rain tank.
              But now i want to customize my sensornode in that way, that two other values will be transmitted.
              It should be
              V_level, that represents the percentage of my water tank
              and
              V_volume, that represents the available volume of water
              V_level and V_volume could be calculated from the sensor value of the distance sensor (VL53L0X).
              But somehow I could not manage to to get this running. I don't know where to insert what.
              Cant someone point me to the right direction, help appreciated

              /*
              * The MySensors Arduino library handles the wireless radio link and protocol
              * between your home built sensors/actuators and HA controller of choice.
              * The sensors forms a self healing radio network with optional repeaters. Each
              * repeater and gateway builds a routing tables in EEPROM which keeps track of the
              * network topology allowing messages to be routed to nodes.
              *
              * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
              * Copyright (C) 2013-2017 Sensnology AB
              * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
              *
              * Documentation: http://www.mysensors.org
              * Support Forum: http://forum.mysensors.org
              *
              * This program is free software; you can redistribute it and/or
              * modify it under the terms of the GNU General Public License
              * version 2 as published by the Free Software Foundation.
              */
              
              /**************************
              Template
              
              This sketch can be used as a template since containing the most relevant MySensors library configuration settings, 
              NodeManager's settings, all its the supported sensors commented out and a sketch structure fully functional to operate with
              NodeManager. Just uncomment the settings you need and the sensors you want to add and configure the sensors in before()
              */
              
              /**********************************
               * MySensors node configuration
               */
              
              // General settings
              #define SKETCH_NAME "NodeManager"
              #define SKETCH_VERSION "1.0"
              //#define MY_DEBUG
              #define MY_NODE_ID 8
              
              // NRF24 radio settings
              #define MY_RADIO_NRF24
              #define MY_RF24_CE_PIN 7
              #define MY_RF24_CS_PIN 10
              #define MY_SOFT_SPI_SCK_PIN 11
              #define MY_SOFT_SPI_MOSI_PIN 12
              #define MY_SOFT_SPI_MISO_PIN 13
              
              // Advanced settings
              #define MY_BAUD_RATE 9600
              #define MY_SPLASH_SCREEN_DISABLED
              
              /**********************************
               * MySensors gateway configuration
               */
               
              // Common gateway settings
              //#define MY_REPEATER_FEATURE
              
              /***********************************
               * NodeManager configuration
               */
              
              #define NODEMANAGER_DEBUG ON
              #define NODEMANAGER_INTERRUPTS ON
              #define NODEMANAGER_SLEEP ON
              #define NODEMANAGER_RECEIVE OFF
              #define NODEMANAGER_DEBUG_VERBOSE OFF
              #define NODEMANAGER_POWER_MANAGER ON
              #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
               */
              
              //PowerManager power(5,6);
               
              #include <sensors/SensorBattery.h>
              SensorBattery battery;
              
              //#include <sensors/SensorConfiguration.h>
              //SensorConfiguration configuration;
              
              #include <sensors/SensorSignal.h>
              SensorSignal signal;
              
              #include <sensors/SensorVL53L0X.h>
              SensorVL53L0X vl53l0x(9);
              
              /***********************************
               * Main Sketch
               */
              
              // before
              void before() {
              	
                /***********************************
                 * Configure your sensors
                 */
                // 
                // EXAMPLES:
                // report measures of every attached sensors every 10 seconds
                nodeManager.setReportIntervalSeconds(10);
                void setADCOff();
                nodeManager.setSleepSeconds(10);
                // 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```
              U 1 Reply Last reply
              0
              • RPunktR RPunkt

                Hello all of You,
                if have a flight time sensor VL53L0X, that is running so far.
                It should measure the water level in a rain tank.
                But now i want to customize my sensornode in that way, that two other values will be transmitted.
                It should be
                V_level, that represents the percentage of my water tank
                and
                V_volume, that represents the available volume of water
                V_level and V_volume could be calculated from the sensor value of the distance sensor (VL53L0X).
                But somehow I could not manage to to get this running. I don't know where to insert what.
                Cant someone point me to the right direction, help appreciated

                /*
                * The MySensors Arduino library handles the wireless radio link and protocol
                * between your home built sensors/actuators and HA controller of choice.
                * The sensors forms a self healing radio network with optional repeaters. Each
                * repeater and gateway builds a routing tables in EEPROM which keeps track of the
                * network topology allowing messages to be routed to nodes.
                *
                * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
                * Copyright (C) 2013-2017 Sensnology AB
                * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
                *
                * Documentation: http://www.mysensors.org
                * Support Forum: http://forum.mysensors.org
                *
                * This program is free software; you can redistribute it and/or
                * modify it under the terms of the GNU General Public License
                * version 2 as published by the Free Software Foundation.
                */
                
                /**************************
                Template
                
                This sketch can be used as a template since containing the most relevant MySensors library configuration settings, 
                NodeManager's settings, all its the supported sensors commented out and a sketch structure fully functional to operate with
                NodeManager. Just uncomment the settings you need and the sensors you want to add and configure the sensors in before()
                */
                
                /**********************************
                 * MySensors node configuration
                 */
                
                // General settings
                #define SKETCH_NAME "NodeManager"
                #define SKETCH_VERSION "1.0"
                //#define MY_DEBUG
                #define MY_NODE_ID 8
                
                // NRF24 radio settings
                #define MY_RADIO_NRF24
                #define MY_RF24_CE_PIN 7
                #define MY_RF24_CS_PIN 10
                #define MY_SOFT_SPI_SCK_PIN 11
                #define MY_SOFT_SPI_MOSI_PIN 12
                #define MY_SOFT_SPI_MISO_PIN 13
                
                // Advanced settings
                #define MY_BAUD_RATE 9600
                #define MY_SPLASH_SCREEN_DISABLED
                
                /**********************************
                 * MySensors gateway configuration
                 */
                 
                // Common gateway settings
                //#define MY_REPEATER_FEATURE
                
                /***********************************
                 * NodeManager configuration
                 */
                
                #define NODEMANAGER_DEBUG ON
                #define NODEMANAGER_INTERRUPTS ON
                #define NODEMANAGER_SLEEP ON
                #define NODEMANAGER_RECEIVE OFF
                #define NODEMANAGER_DEBUG_VERBOSE OFF
                #define NODEMANAGER_POWER_MANAGER ON
                #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
                 */
                
                //PowerManager power(5,6);
                 
                #include <sensors/SensorBattery.h>
                SensorBattery battery;
                
                //#include <sensors/SensorConfiguration.h>
                //SensorConfiguration configuration;
                
                #include <sensors/SensorSignal.h>
                SensorSignal signal;
                
                #include <sensors/SensorVL53L0X.h>
                SensorVL53L0X vl53l0x(9);
                
                /***********************************
                 * Main Sketch
                 */
                
                // before
                void before() {
                	
                  /***********************************
                   * Configure your sensors
                   */
                  // 
                  // EXAMPLES:
                  // report measures of every attached sensors every 10 seconds
                  nodeManager.setReportIntervalSeconds(10);
                  void setADCOff();
                  nodeManager.setSleepSeconds(10);
                  // 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```
                U Offline
                U Offline
                user2684
                Contest Winner
                wrote on last edited by
                #218

                @rpunkt my recommendation would be to create a custom sensor in NodeManager which is implementing the logic you like. Feel free to copy from https://github.com/mysensors/NodeManager/blob/master/sensors/SensorVL53L0X.h and create your own or make your own class by inheriting directly from SensorVL53L0X.

                RPunktR 1 Reply Last reply
                0
                • U user2684

                  @rpunkt my recommendation would be to create a custom sensor in NodeManager which is implementing the logic you like. Feel free to copy from https://github.com/mysensors/NodeManager/blob/master/sensors/SensorVL53L0X.h and create your own or make your own class by inheriting directly from SensorVL53L0X.

                  RPunktR Offline
                  RPunktR Offline
                  RPunkt
                  wrote on last edited by RPunkt
                  #219

                  @user2684 Seems to be to difficult for a rookie :sob:
                  On the conventional MySensors library it is possible with my abilities, but then the power management is a issue.
                  For me the NodeManager was the choice, because it saves so much battery energy.
                  Other way of solution:
                  A friend of mine, convinced me off doing all the calculations in the home- automation (in my case FHEM).
                  Now I only use the node transmitting the distance and calculating the "volume of water" and "percentage of water" as a "user reading".

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    justfra
                    wrote on last edited by
                    #220

                    Hello @user2684 et al,

                    I'm trying to use this library on an ESP32 board. I'm trying this sketch out (https://raw.githubusercontent.com/mysensors/NodeManager/master/examples/AnalogLightAndTemperatureSensor/AnalogLightAndTemperatureSensor.ino)

                    My problem is that if I just try to use the 1.8 version of NodeManager it will use as a dependency a version of MySensors which do not work with ESP32 and I get a known error regarding re-definition of app_main. Because of that I need to use the development version of MySensors but it seems not compatible with NodeManager 1.8 as I get the following error:

                    In file included from .pio/libdeps/nodemcu-32s/MySensors/MySensors.h:43:0,
                                     from .pio/libdeps/nodemcu-32s/NodeManager/MySensors_NodeManager.h:43,
                                     from src\main.cpp:60:
                    .pio/libdeps/nodemcu-32s/MySensors/MyConfig.h:288:2: warning: #warning MY_RADIO_NRF24 is deprecated, use MY_RADIO_RF24 instead. [-Wcpp]
                     #warning MY_RADIO_NRF24 is deprecated, use MY_RADIO_RF24 instead.
                      ^
                    In file included from .pio/libdeps/nodemcu-32s/NodeManager/MySensors_NodeManager.h:87:0,
                                     from src\main.cpp:60:
                    .pio/libdeps/nodemcu-32s/NodeManager/nodemanager/Sensor.cpp: In member function 'void Sensor::presentation()':
                    .pio/libdeps/nodemcu-32s/NodeManager/nodemanager/Sensor.cpp:135:54: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'mysensors_sensor_t' [-fpermissive]
                       present(child->getChildId(), child->getPresentation(), child->getDescription(), nodeManager.getAck());
                                                                          ^
                    In file included from .pio/libdeps/nodemcu-32s/MySensors/MySensors.h:433:0,
                                     from .pio/libdeps/nodemcu-32s/NodeManager/MySensors_NodeManager.h:43,
                                     from src\main.cpp:60:
                    .pio/libdeps/nodemcu-32s/MySensors/core/MySensorsCore.cpp:375:6: note:   initializing argument 2 of 'bool present(uint8_t, mysensors_sensor_t, const char*, bool)'   
                     bool present(const uint8_t childSensorId, const mysensors_sensor_t sensorType,
                          ^
                    *** [.pio\build\nodemcu-32s\src\main.cpp.o] Error 1
                    

                    I have also tried using the development version of NodeManager with the development version of MySensors although I get the same result.
                    I'm stuck and I would really appreciate any input.

                    Thanks in advance!

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

                      @justfra thanks for reporting this issue, I believe there is some sort of library conflicts which is arising across MySensors/Nodemanager versions...something which has to be investigated carefully, I'll track this bug with https://github.com/mysensors/NodeManager/issues/491

                      U 1 Reply Last reply
                      1
                      • G Offline
                        G Offline
                        ghiglie
                        wrote on last edited by
                        #222

                        Oh, I hate saying I've noticed this great piece of software just now! :( It would have saved me countless hours of software tinkering, giving more eyecare for better soldering...!

                        atmega328p serial killer
                        HomeAssistant / gateway: ESP8266 & NRF24L01+ gateway

                        1 Reply Last reply
                        2
                        • U user2684

                          @justfra thanks for reporting this issue, I believe there is some sort of library conflicts which is arising across MySensors/Nodemanager versions...something which has to be investigated carefully, I'll track this bug with https://github.com/mysensors/NodeManager/issues/491

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

                          @justfra realizing only now the issue you reported was not ESP32 related but due to a compatibility issues between MySensors v2.3.2 and NodeManager just fixed in the development version with https://github.com/mysensors/NodeManager/pull/508. Either try the latest development version of NodeManager or use MySensors v2.3.1. Thanks

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


                          8

                          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