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. OpenHardware.io
  3. 💬 NodeManager

💬 NodeManager

Scheduled Pinned Locked Moved OpenHardware.io
contest2017arduinonewbiemysensorsbattery sensor
196 Posts 42 Posters 67.4k Views 41 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.
  • Sergio RiusS Offline
    Sergio RiusS Offline
    Sergio Rius
    wrote on last edited by
    #53

    Very good job @user2684 ! I like it very much.
    Only one thing, how I can create a simple DHT22 node? I activated MODULE_DHT, and registered like this:

      /*
         Register below your sensors
      */
      int sensorDHT_Id = nodeManager.registerSensor(SENSOR_DHT22,4);
      SensorDHT*  sensorDHT = (SensorDHT*)nodeManager.getSensor(sensorDHT_Id);
      sensorDHT->setSamples(5);
      sensorDHT->setTackLastValue(true);
      sensorDHT->setForceUpdate(5);
      /*
         Register above your sensors
      */
    

    But when compiling it throws: 'DHT11' was not declared in this scope

    I have the DHT library installed by the env, and a copy at the projects libraries folder (portable) and also at the same project folder (when opening the sketch also opens the library), but still complains.

    ??

    U 1 Reply Last reply
    0
    • Sergio RiusS Sergio Rius

      Very good job @user2684 ! I like it very much.
      Only one thing, how I can create a simple DHT22 node? I activated MODULE_DHT, and registered like this:

        /*
           Register below your sensors
        */
        int sensorDHT_Id = nodeManager.registerSensor(SENSOR_DHT22,4);
        SensorDHT*  sensorDHT = (SensorDHT*)nodeManager.getSensor(sensorDHT_Id);
        sensorDHT->setSamples(5);
        sensorDHT->setTackLastValue(true);
        sensorDHT->setForceUpdate(5);
        /*
           Register above your sensors
        */
      

      But when compiling it throws: 'DHT11' was not declared in this scope

      I have the DHT library installed by the env, and a copy at the projects libraries folder (portable) and also at the same project folder (when opening the sketch also opens the library), but still complains.

      ??

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

      @Sergio-Rius thanks! Are you sure you are using the DHT library from the arduino IDE ( https://github.com/adafruit/DHT-sensor-library) and not the one from the MySensors example folder? Thanks

      Sergio RiusS 1 Reply Last reply
      0
      • U user2684

        @Sergio-Rius thanks! Are you sure you are using the DHT library from the arduino IDE ( https://github.com/adafruit/DHT-sensor-library) and not the one from the MySensors example folder? Thanks

        Sergio RiusS Offline
        Sergio RiusS Offline
        Sergio Rius
        wrote on last edited by Sergio Rius
        #55

        @user2684
        AH! You're right, you got me. I'll change and test it. Anyways the one I was using was failing frecuently reading the sensor.

        But you could also make your wrapper compatible with the MyS one. The difference between both is that the later places its declarations inside the class. You can make it work by fully qualifying the calls like the example:

        NodeManager.cpp @1949:       int dht_type = sensor_type == SENSOR_DHT11 ? _dht.DHT11 : _dht.DHT22;
        

        It could be interesting if there are anyone really needing the MyS DHT library. And also it seems more memory optimized. The adafruit's are two in one and also needs another library helper in cascade.

        U Sergio RiusS 2 Replies Last reply
        0
        • Sergio RiusS Sergio Rius

          @user2684
          AH! You're right, you got me. I'll change and test it. Anyways the one I was using was failing frecuently reading the sensor.

          But you could also make your wrapper compatible with the MyS one. The difference between both is that the later places its declarations inside the class. You can make it work by fully qualifying the calls like the example:

          NodeManager.cpp @1949:       int dht_type = sensor_type == SENSOR_DHT11 ? _dht.DHT11 : _dht.DHT22;
          

          It could be interesting if there are anyone really needing the MyS DHT library. And also it seems more memory optimized. The adafruit's are two in one and also needs another library helper in cascade.

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

          @Sergio-Rius great idea! Will prevent people to get crazy with compile errors, thanks!
          I'll track this with https://github.com/mysensors/NodeManager/issues/144

          Sergio RiusS 1 Reply Last reply
          0
          • U user2684

            @Sergio-Rius great idea! Will prevent people to get crazy with compile errors, thanks!
            I'll track this with https://github.com/mysensors/NodeManager/issues/144

            Sergio RiusS Offline
            Sergio RiusS Offline
            Sergio Rius
            wrote on last edited by
            #57

            @user2684 Nevermid! I'm still struggling trying to make the TH sensor :sweat_smile:
            That's the serial output I get and nothing at domoticz.

            REG I=1 P=4 P=6 T=0
            REG I=2 P=4 P=7 T=1
            NodeManager v1.5
            INT1 M=255
            INT2 M=255
            RADIO OK
            PRES I=200, T=23
            PRES I=201, T=30
            BATT V=2.95 P=50
            SEND D=0 I=201 C=0 T=38 S= I=0 F=2.95
            PRES I=1 T=6
            PRES I=2 T=7
            READY
            
            MY I=3 M=1
            
            U 1 Reply Last reply
            0
            • Sergio RiusS Sergio Rius

              @user2684 Nevermid! I'm still struggling trying to make the TH sensor :sweat_smile:
              That's the serial output I get and nothing at domoticz.

              REG I=1 P=4 P=6 T=0
              REG I=2 P=4 P=7 T=1
              NodeManager v1.5
              INT1 M=255
              INT2 M=255
              RADIO OK
              PRES I=200, T=23
              PRES I=201, T=30
              BATT V=2.95 P=50
              SEND D=0 I=201 C=0 T=38 S= I=0 F=2.95
              PRES I=1 T=6
              PRES I=2 T=7
              READY
              
              MY I=3 M=1
              
              U Offline
              U Offline
              user2684
              Contest Winner
              wrote on last edited by
              #58

              @Sergio-Rius ok, this is kind of a standard startup with the temperature and humidity sensors presented as child 1 and 2, so far so good.

              PRES I=1 T=6
              PRES I=2 T=7
              

              By default no data is reported unless the node enters in a cycle. You would like to add:

              nodeManager.setSleep(SLEEP, 10, MINUTES);
              

              Or

              nodeManager.setSleep(WAIT, 10, MINUTES);
              

              To start getting periodically the data out. Alternatively you can send a REQ message to the child id with the appropriate V_type

              Sergio RiusS 1 Reply Last reply
              0
              • U user2684

                @Sergio-Rius ok, this is kind of a standard startup with the temperature and humidity sensors presented as child 1 and 2, so far so good.

                PRES I=1 T=6
                PRES I=2 T=7
                

                By default no data is reported unless the node enters in a cycle. You would like to add:

                nodeManager.setSleep(SLEEP, 10, MINUTES);
                

                Or

                nodeManager.setSleep(WAIT, 10, MINUTES);
                

                To start getting periodically the data out. Alternatively you can send a REQ message to the child id with the appropriate V_type

                Sergio RiusS Offline
                Sergio RiusS Offline
                Sergio Rius
                wrote on last edited by
                #59

                @user2684 Mmmmm what if you have a motion sensor in the same node? (I'm trying to migrate my own sketch)

                U 1 Reply Last reply
                0
                • Sergio RiusS Sergio Rius

                  @user2684
                  AH! You're right, you got me. I'll change and test it. Anyways the one I was using was failing frecuently reading the sensor.

                  But you could also make your wrapper compatible with the MyS one. The difference between both is that the later places its declarations inside the class. You can make it work by fully qualifying the calls like the example:

                  NodeManager.cpp @1949:       int dht_type = sensor_type == SENSOR_DHT11 ? _dht.DHT11 : _dht.DHT22;
                  

                  It could be interesting if there are anyone really needing the MyS DHT library. And also it seems more memory optimized. The adafruit's are two in one and also needs another library helper in cascade.

                  Sergio RiusS Offline
                  Sergio RiusS Offline
                  Sergio Rius
                  wrote on last edited by
                  #60

                  @Sergio-Rius said in 💬 NodeManager:

                  The difference between both is that the later places its declarations inside the class.

                  Please don't waste your time as they are not compatible. In my stupidity didn't make sure that my lib wasn't "personalized".
                  What a pity.

                  1 Reply Last reply
                  0
                  • Sergio RiusS Sergio Rius

                    @user2684 Mmmmm what if you have a motion sensor in the same node? (I'm trying to migrate my own sketch)

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

                    @Sergio-Rius yes, you can have a motion sensor on the same node as far as it is a sleeping node. This is because the interrupt is coming from the MySensors sleep() call. Having this compatibility in a non sleeping node is instead only planned (https://github.com/mysensors/NodeManager/issues/142)

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      strangeoptics
                      wrote on last edited by
                      #62

                      Hi, I would like to have smartSleep for my nodes. I read that NodeManager can do that. But I couldn't find an explanation how it is doing it. I use OpenHAB as the controller and MQTT to communicate to the MySensors-Gateway. Is smartSleep working for this scenario? Did you extend the Gateway?

                      U 1 Reply Last reply
                      0
                      • S strangeoptics

                        Hi, I would like to have smartSleep for my nodes. I read that NodeManager can do that. But I couldn't find an explanation how it is doing it. I use OpenHAB as the controller and MQTT to communicate to the MySensors-Gateway. Is smartSleep working for this scenario? Did you extend the Gateway?

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

                        @strangeoptics NodeManager does use smart sleep by default. The way it works (with or without node manager) is pretty simple: when the node tells the gw/controller is about to go to sleep, it actually wait (by default 500ms I think) for new messages before powering off the radio and going to sleep. Useful if you have a sleeping node and want to communicate with it. Im not familiar with those controllers but I'm sure others are but generally speaking the way it works is the controller usually queue your messages and when the node checks in release the queue.

                        S 1 Reply Last reply
                        0
                        • U user2684

                          @strangeoptics NodeManager does use smart sleep by default. The way it works (with or without node manager) is pretty simple: when the node tells the gw/controller is about to go to sleep, it actually wait (by default 500ms I think) for new messages before powering off the radio and going to sleep. Useful if you have a sleeping node and want to communicate with it. Im not familiar with those controllers but I'm sure others are but generally speaking the way it works is the controller usually queue your messages and when the node checks in release the queue.

                          S Offline
                          S Offline
                          strangeoptics
                          wrote on last edited by
                          #64

                          @user2684 If I understand it correct, NodeManager is basically using the smartSleep method of the MySensors library and extended it with a default delay of 500ms after the heart beat message.
                          The logic for queuing the messages inbetween the wakeup periods is not implementet from NodeManager and has to come from the controller. In my case OpenHAB hasn't got the logic and smartSleep wouldn't work :(

                          U 1 Reply Last reply
                          0
                          • S strangeoptics

                            @user2684 If I understand it correct, NodeManager is basically using the smartSleep method of the MySensors library and extended it with a default delay of 500ms after the heart beat message.
                            The logic for queuing the messages inbetween the wakeup periods is not implementet from NodeManager and has to come from the controller. In my case OpenHAB hasn't got the logic and smartSleep wouldn't work :(

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

                            @strangeoptics not really, node manager is not extending smart sleep at all, smart sleep from the core MySensors library by itself is implemented with this delay :)

                            S 1 Reply Last reply
                            0
                            • U user2684

                              @strangeoptics not really, node manager is not extending smart sleep at all, smart sleep from the core MySensors library by itself is implemented with this delay :)

                              S Offline
                              S Offline
                              strangeoptics
                              wrote on last edited by
                              #66

                              @user2684 so which controler are you using?

                              U 1 Reply Last reply
                              0
                              • S strangeoptics

                                @user2684 so which controler are you using?

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

                                https://www.mysensors.org/controller/myhouse but since I wrote it, my opinion would be biased :P

                                1 Reply Last reply
                                1
                                • stefaanvS Offline
                                  stefaanvS Offline
                                  stefaanv
                                  wrote on last edited by
                                  #68

                                  The configuration service is a good ideaal.
                                  Even better would be if it would allow setting and reading user parameters.

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

                                    Hi
                                    I have a led ir emitter can i send to my air contiotioner a code like x0284828 by digital output in nodemanager(with irremote library is simple)

                                    M.C.

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

                                      Hi
                                      I have a led ir emitter can i send to my air contiotioner a code like x0284828 by digital output in nodemanager(with irremote library is simple)

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

                                      @mar.conte mmm not sure I got the use case. I think we need some sort of "IR" specific output. Btw if you prefer, feel free to open a new thread on https://forum.mysensors.org/category/43/nodemanager

                                      1 Reply Last reply
                                      0
                                      • D Dencan

                                        Hi, nice work!
                                        I have changed the code for REBOOT so there is no need for a reboot-pin.
                                        like this...

                                        else if (strcmp(message, "REBOOT") == 0) {
                                        #if DEBUG == 1
                                        Serial.println(F("REBOOT"));
                                        #endif
                                        // Software reboot with watchdog timer
                                        // Enter Watchdog Configuration mode:
                                        WDTCSR |= (1<<WDCE) | (1<<WDE);
                                        // Reset enable
                                        WDTCSR= (1<<WDE);
                                        // Infinite loop until watchdog reset after 16 ms
                                        while(true){}
                                        }

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

                                        Hi @Dencan @core_c I'm having trouble with both the solutions you recommended. When the reboot code is triggered, I have my pro mini 3.3v board freezing with the power led blinking continuously (https://github.com/mysensors/NodeManager/issues/133). Do you guys know what the issue could be? Thanks!

                                        D 1 Reply Last reply
                                        0
                                        • U user2684

                                          Hi @Dencan @core_c I'm having trouble with both the solutions you recommended. When the reboot code is triggered, I have my pro mini 3.3v board freezing with the power led blinking continuously (https://github.com/mysensors/NodeManager/issues/133). Do you guys know what the issue could be? Thanks!

                                          D Offline
                                          D Offline
                                          Dencan
                                          wrote on last edited by
                                          #72

                                          @user2684 It appears that this problem is caused by a bug in bootloaders used in some Arduino boards.

                                          The solution suggested is to flash optiboot bootloader to the Arduino Pro Mini. Or not using a bootloader.

                                          I use mostly barebone atmega328's with optiboot bootloader, working perfectly with reboot function, so I haven't been aware of the problem until now when I used a pro mini.

                                          Please read this article which explains the cause of the problem and suggested fix.
                                          https://andreasrohner.at/posts/Electronics/How-to-make-the-Watchdog-Timer-work-on-an-Arduino-Pro-Mini-by-replacing-the-bootloader/

                                          I will try it on a pro mini when I have time.

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


                                          10

                                          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