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 73.0k 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.
  • mar.conteM mar.conte

    @gohan
    Should the gateway have the right nodemamager sketch?
    Tanks

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

    @mar.conte said in NodeManager: plugin for a rapid development of battery-powered sensors:

    Should the gateway have the right nodemamager sketch?

    Just to confirm what already discussed: a node/sensor with NodeManager running does not require a gateway with NodeManager on it. Generally speaking, there are two situations in which you may want use NodeManager on a gateway as well (available starting from v1.5):

    • It as to run on a Sonoff device which requires to be configured as a gateway
    • The gateway has sensors attached to it so you may want to use NodeManager's capabilities to configure your sensors in an easy way

    There is also a third situation: you are just lazy and have NodeManager already open in the arduino IDE so you just configure the gateway's settings in config.h and upload the sketch :P

    mar.conteM 1 Reply Last reply
    1
    • U user2684

      @mar.conte said in NodeManager: plugin for a rapid development of battery-powered sensors:

      Should the gateway have the right nodemamager sketch?

      Just to confirm what already discussed: a node/sensor with NodeManager running does not require a gateway with NodeManager on it. Generally speaking, there are two situations in which you may want use NodeManager on a gateway as well (available starting from v1.5):

      • It as to run on a Sonoff device which requires to be configured as a gateway
      • The gateway has sensors attached to it so you may want to use NodeManager's capabilities to configure your sensors in an easy way

      There is also a third situation: you are just lazy and have NodeManager already open in the arduino IDE so you just configure the gateway's settings in config.h and upload the sketch :P

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

      @user2684
      👍🏾😉

      M.C.

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

        Last chance guys to report any issue for those who had tested the dev version of v1.5 :-)
        The final version will be out in a day or two otherwise.

        Thanks!

        1 Reply Last reply
        0
        • gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #156

          I am waiting for the LCD mod :D

          U 1 Reply Last reply
          0
          • gohanG gohan

            I am waiting for the LCD mod :D

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

            @gohan LCD unfortunately has to wait for the another release (https://github.com/mysensors/NodeManager/issues/95), I would like to find a way to provide the info on the LCD without the need for the user to configure it for every sensor but this would require investigating on the best generic approach and will take some time :-)

            1 Reply Last reply
            0
            • gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #158

              If you could provide a method to retrieve sensor data from main loop(), it is quite easy for everyone to print it to LCD

              U 1 Reply Last reply
              0
              • gohanG gohan

                If you could provide a method to retrieve sensor data from main loop(), it is quite easy for everyone to print it to LCD

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

                @gohan I wonder if something can be done even right now based on what you're saying. In the main sketch, after invoking nodeManager.loop(), you can actually retrieve the instance of each sensor and do something. The last "value", depending on the type of the sensor, is stored in a variable (e.g. _value_int) BUT it is private. I'll add a getValue() function so you can get out this value. Not ideal but I think it can be a workaround I can easily add before releasing 1.5 (https://github.com/mysensors/NodeManager/issues/104)

                1 Reply Last reply
                0
                • gohanG Offline
                  gohanG Offline
                  gohan
                  Mod
                  wrote on last edited by
                  #160

                  The problem is how do I know the name of the instance of the sensors

                  U 1 Reply Last reply
                  0
                  • gohanG gohan

                    The problem is how do I know the name of the instance of the sensors

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

                    @gohan I mean if you declare a global int to store the child id, then you can save it when calling registersensor() (which returns the id of the sensor) in before() so eventually in loop() you can call getSensor() and then retrieve the value or do whatever else. Something like:

                    NodeManager nodeManager;
                    int sensor_id;
                    
                    void before() {
                      Serial.begin(MY_BAUD_RATE);  
                      sensor_id = nodeManager.registerSensor(SENSOR_THERMISTOR,A1);
                      nodeManager.before();
                    }
                    
                    void loop() {
                      nodeManager.loop();
                      float value = ((SensorThermistor*)nodeManager.getSensor(sensor_id))->getValueFloat();
                    
                    }
                    

                    Just the getValueFloat() is missing. Not ideal but a starting point. Don't you think? Thanks!

                    1 Reply Last reply
                    0
                    • gohanG Offline
                      gohanG Offline
                      gohan
                      Mod
                      wrote on last edited by
                      #162

                      That would work, at least for me :)

                      U 1 Reply Last reply
                      0
                      • gohanG gohan

                        That would work, at least for me :)

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

                        @gohan cool, just added it to the dev code. I'm packing now the final v1.5 and about to post it here in a few minutes. Thanks!

                        1 Reply Last reply
                        0
                        • gohanG Offline
                          gohanG Offline
                          gohan
                          Mod
                          wrote on last edited by
                          #164

                          At least now we can add some more code besides the default created by nodemanager ;)

                          U 1 Reply Last reply
                          0
                          • gohanG gohan

                            At least now we can add some more code besides the default created by nodemanager ;)

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

                            Very true also because I'd avoid having the users customizing their NodeManager.cpp (even if it is always possible) to prevent issues during the upgrade. For your information the alternative to create an inline class inheriting from Sensor and then invoking registerSensor() with an instance of this class is always valid even if clearly much more complex.

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

                              Version 1.5 of NodeManager is finally available here!
                              https://github.com/mysensors/NodeManager

                              I've done my best to implement most of the requests received so far since unfortunately I'm expecting starting from June very little spare time to spend here so I tried to hurry up a bit :-) The result is a pretty long change log and a total of 26 between ad-hoc and generic out-of-the-box sensors supported up to this release:

                              • Added support for ACS712 current sensor
                              • Added support for HC-SR04 distance sensor
                              • Added support for BMP085/BMP180 temperature and pressure sensor
                              • Added support for Sonoff smart switch
                              • Added support for Rain Gauge sensor
                              • Added support for MCP9808 temperature sensor
                              • Added forecast output to all Bosch sensors
                              • Added I2C address auto-discovery for all Bosch sensors
                              • Added support for running as a gateway
                              • Added option to retrieve the latest value of a sensor from outside NodeManager
                              • Remote reboot now does not need a reboot pin configured
                              • A heartbeat is now sent also when waking up from a wait cycle
                              • When waking up for an interrupt, only the code of the sensor expecting that interrupt is executed
                              • Added capability to retrieve the time from the controller
                              • Optimized battery life for DS18B20 sensors
                              • SLEEP_MANAGER has been deprecated (now always enabled) and setMode() replaces setSleepMode()
                              • New mode ALWAYS_ON to let the node staying awake and executing each sensors' loop
                              • ESP8266WiFi.h has to be included in the main sketch if MY_GATEWAY_ESP8266 is defined
                              • Added receiveTime() wrapper in the main sketch
                              • Fixed the logic for output sensors
                              • Added common gateway settings in config.h

                              I've added upgrade instructions as well in the documentation. Generally speaking to upgrade it is safe to just replace the existing NodeManager.h and NodeManager.cpp files but with this release I had to do some minor changes to the main sketch as well, as documented in the release notes.

                              Thanks everybody for all the advice and for reporting any issue always in a constructive way :-)

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

                                Hi, only for those having problems with a too high utilization of the dynamic memory preventing NodeManager to run smoothly (e.g. generating random data / outputting garbage characters / rebooting, etc), a quick fix is to decrease from 255 to a small number like 5 or 10 the size of the Sensor* _sensors array. This saves more than 20% on a pro mini which is huge. Of course you also need to change every cycle in NodeManager.cpp which is using that 255.

                                This of course will be also fixed in the next release. Very silly mistake I know to initialize such a big array but I couldn't image 255 pointers were consuming so much :-)

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

                                  Hi, i wanted to know in which section of the sketch I turn on and turn off a led when the node controls the battery because at night the led me starts the pir; Now I've put the digitalwrite after nodemanger.loop

                                  M.C.

                                  U gohanG 2 Replies Last reply
                                  0
                                  • mar.conteM mar.conte

                                    Hi, i wanted to know in which section of the sketch I turn on and turn off a led when the node controls the battery because at night the led me starts the pir; Now I've put the digitalwrite after nodemanger.loop

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

                                    @mar.conte NodeManager does not control any led so I think you are free to place your code where you think is most appropriate for your needs. Thanks

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

                                      Hi, i wanted to know in which section of the sketch I turn on and turn off a led when the node controls the battery because at night the led me starts the pir; Now I've put the digitalwrite after nodemanger.loop

                                      gohanG Offline
                                      gohanG Offline
                                      gohan
                                      Mod
                                      wrote on last edited by
                                      #170

                                      @mar.conte put a capacitor on the PIR vcc/gnd and increase the size until it is stable.

                                      mar.conteM 1 Reply Last reply
                                      0
                                      • gohanG gohan

                                        @mar.conte put a capacitor on the PIR vcc/gnd and increase the size until it is stable.

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

                                        @gohan
                                        Good idea Tanks

                                        M.C.

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

                                          Hi, I've added a "How to contribute" section in the documentation of the dev release in case anybody is interested to contribute to this project: https://github.com/mysensors/NodeManager/tree/development#contributing.

                                          I'm not a git expert so I hope those instructions to have some sense :)

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


                                          14

                                          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