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.
  • hekH Offline
    hekH Offline
    hek
    Admin
    wrote on last edited by
    #5

    FYI: Added the NodeManager project under the download/api section on the main site.

    Keep up the good work!

    1 Reply Last reply
    3
    • Ivan ZI Offline
      Ivan ZI Offline
      Ivan Z
      Hardware Contributor
      wrote on last edited by
      #6

      How make not sleep sensor?

      void NodeManager::loop() {
      #if SLEEP_MANAGER == 1
      Only for sleep
      #end
      }

      May be to make wait logic

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

        @Ivan-Z there should be already something in this direction available. You still need to load the sleep module and set sleep time but you have to set sleep mode like this:

        nodeManager.setSleepMode(WAIT);
        

        And the library will use wait() instead of sleep(). All the rest will stay the same.
        I probably need to double check if there is anythig in the code which will use sleep instead of wait outside loop() so I've opened https://github.com/mysensors/NodeManager/issues/38 for this but you should be ready to go even with the current version.
        Thanks

        1 Reply Last reply
        0
        • Ivan ZI Offline
          Ivan ZI Offline
          Ivan Z
          Hardware Contributor
          wrote on last edited by
          #8

          Please show my sample with DHT22

          Append optimization flag.
          For save battery life, do not send the same values

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

            @Ivan-Z if you mean an example with DHT22, you need first of all to enable the DHT module in config.h with:

            #define MODULE_DHT 1
            

            Then just register the sensor in before() with:

            nodeManager.registerSensor(SENSOR_DHT22,6);
            

            Where 6 is the pin where the sensor is attached to. NodeManager will then create automatically two child ids, one for temperature and the other for humidity.
            As written in the documentation you need the DHT library from https://github.com/adafruit/DHT-sensor-library (or install it by using the arduino IDE). For some unknown (to me) reasons I had issues in using the library from the mysensors example.

            What do you mean by optimization flag?
            As for avoid sending the same value, this is already available, have a look at setTackLastValue() from the documentation. When set to true, the value will not be send if the same as the previous (default is of course false). I also implemented setForceUpdate(), to force to send an update after the configured number of cycles, as many examples here are using this approach.

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

              Hi, I've updated the project (including files and documentation) to version 1.4.
              Main changes are:

              • 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

              Thanks!

              1 Reply Last reply
              2
              • openhardware.ioO openhardware.io

                https://www.openhardware.io/view/363/NodeManager

                S Offline
                S Offline
                Straydog
                wrote on last edited by
                #11

                @openhardware.io Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
                Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
                Keep up the great work.

                U 3 Replies Last reply
                0
                • S Straydog

                  @openhardware.io Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
                  Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
                  Keep up the great work.

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

                  @Straydog said in 💬 NodeManager:

                  Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
                  Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
                  Keep up the great work.

                  Thanks for the advice! I'd be very happy to support any sensor which would be useful for the community! I've opened https://github.com/mysensors/NodeManager/issues/63 and https://github.com/mysensors/NodeManager/issues/62.
                  Since I don't have those sensors and delivery is kind of a pain, would you like to give me a hand in testing the code I can put together? If so, please add a comment on git with some sample code and I'll integrate it into NodeManager straight away for your testing.
                  Thanks!

                  1 Reply Last reply
                  0
                  • hekH Offline
                    hekH Offline
                    hek
                    Admin
                    wrote on last edited by
                    #13

                    @user2684
                    If you send me your paypal email, I'll forward community donations to help you buy a sonoff and HC-SR04 for testing.

                    1 Reply Last reply
                    0
                    • jlehtinenJ Offline
                      jlehtinenJ Offline
                      jlehtinen
                      wrote on last edited by
                      #14

                      @user2684 Good work with NodeManager, greatly appreciated by "MySensors noob" like myself! :+1:

                      1 Reply Last reply
                      0
                      • Ivan ZI Offline
                        Ivan ZI Offline
                        Ivan Z
                        Hardware Contributor
                        wrote on last edited by
                        #15

                        This version already allows wizard (.php) to generate a sketch

                        1 Reply Last reply
                        0
                        • S Straydog

                          @openhardware.io Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
                          Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
                          Keep up the great work.

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

                          @Straydog said in 💬 NodeManager:

                          Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?

                          I spend some time in the forum but still I'm struggling a bit to understand the Sonoff use case to then buy the right piece to test. Is it related to what has been discussed in this thread?
                          https://forum.mysensors.org/topic/5858/sonoff-relay-using-mysensors-esp8266-wifi-or-mqtt-gateway
                          Thanks!

                          EfflonE S 2 Replies Last reply
                          0
                          • U user2684

                            @Straydog said in 💬 NodeManager:

                            Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?

                            I spend some time in the forum but still I'm struggling a bit to understand the Sonoff use case to then buy the right piece to test. Is it related to what has been discussed in this thread?
                            https://forum.mysensors.org/topic/5858/sonoff-relay-using-mysensors-esp8266-wifi-or-mqtt-gateway
                            Thanks!

                            EfflonE Offline
                            EfflonE Offline
                            Efflon
                            wrote on last edited by
                            #17

                            @user2684 I have a sonoff and have posted a few examples here https://www.mysensors.org/build/sonoff, nodeManager would maybe save a few lines of code for the end user but you will have quite a lot to code :smile: I guess if you add esp8266 support, the sonoff is just a relay with a LED and a button which nodeManager already supports.

                            U 1 Reply Last reply
                            0
                            • S Straydog

                              @openhardware.io Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
                              Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
                              Keep up the great work.

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

                              @Straydog just to be sure I'm buying the right sensor, I can only see HC-SR04 with 4 pins on aliexpress I guess this is the right sensor but I will use only three of the four pins, is it the case?
                              Thanks

                              S 1 Reply Last reply
                              0
                              • EfflonE Efflon

                                @user2684 I have a sonoff and have posted a few examples here https://www.mysensors.org/build/sonoff, nodeManager would maybe save a few lines of code for the end user but you will have quite a lot to code :smile: I guess if you add esp8266 support, the sonoff is just a relay with a LED and a button which nodeManager already supports.

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

                                @Efflon said in 💬 NodeManager:

                                @user2684 I have a sonoff and have posted a few examples here https://www.mysensors.org/build/sonoff,

                                Cool project, I wonder how I've missed it so far! I understand the idea, basically the sonoff runs as a gateway (otherwise would require a radio attached which is not possible/easy) and has a relay type of sensor attached. I think I can make it easily, I'm ordering a sonoff right now so to test the implementation. I need this https://github.com/mysensors/NodeManager/issues/65 first of all and then I can adapt the SENSOR_RELAY which is already available in NodeManager. I'll keep you posted while I will progress.
                                Thanks!

                                1 Reply Last reply
                                0
                                • U user2684

                                  @Straydog just to be sure I'm buying the right sensor, I can only see HC-SR04 with 4 pins on aliexpress I guess this is the right sensor but I will use only three of the four pins, is it the case?
                                  Thanks

                                  S Offline
                                  S Offline
                                  Straydog
                                  wrote on last edited by
                                  #20

                                  @user2684 It's the regular HC-SR04, with ECHO & TRIGGER soldered together. I believe you can get them in either 5 or 3.3V
                                  There are only 3 exposed pins on the SonOff SV, I need the other pins for other sensors.
                                  Would like to help you test this project, tried to sign up to GIT yesterday but all Usernames came back as in use, will try again.
                                  Two issues 1) AVR/EEPROM is not found, with PERSIST 0 & board ESP8266. 2) Don't know how to define HC-SR04 as a custom sensor, or can disguise it as another sensor type, with a PulseWidth.

                                  Great job

                                  U 1 Reply Last reply
                                  0
                                  • U user2684

                                    @Straydog said in 💬 NodeManager:

                                    Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?

                                    I spend some time in the forum but still I'm struggling a bit to understand the Sonoff use case to then buy the right piece to test. Is it related to what has been discussed in this thread?
                                    https://forum.mysensors.org/topic/5858/sonoff-relay-using-mysensors-esp8266-wifi-or-mqtt-gateway
                                    Thanks!

                                    S Offline
                                    S Offline
                                    Straydog
                                    wrote on last edited by
                                    #21

                                    @user2684 You mean, why use SonOff?!?!
                                    In my case I want to have sensors I can control over the Internet i.e. SonOff for the garage door opener(RELAY), with a PIR and HC_SR04.
                                    I also prefer the SonOff/ESP8266 as it has more memory than the Arduino.

                                    1 Reply Last reply
                                    0
                                    • S Straydog

                                      @user2684 It's the regular HC-SR04, with ECHO & TRIGGER soldered together. I believe you can get them in either 5 or 3.3V
                                      There are only 3 exposed pins on the SonOff SV, I need the other pins for other sensors.
                                      Would like to help you test this project, tried to sign up to GIT yesterday but all Usernames came back as in use, will try again.
                                      Two issues 1) AVR/EEPROM is not found, with PERSIST 0 & board ESP8266. 2) Don't know how to define HC-SR04 as a custom sensor, or can disguise it as another sensor type, with a PulseWidth.

                                      Great job

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

                                      @Straydog said in 💬 NodeManager:

                                      It's the regular HC-SR04, with ECHO & TRIGGER soldered together.

                                      Great, so if I order the HC-SR04 with 4 pins I should be ready to go. As for the Sonoff, I'm working on it right now, I need to add a few conditions here and there to have NodeManager running as a gateway but it is not that complicated. I'll let you know when I have something ready to test, can be quicker while I'm waiting my sonoff to be delivered.
                                      As for the Sonoff use case it took me a while because it was not clear to me why a gateway and not a node but now I can see it clearly. And btw I needed something similar at home so I'll explore it even more ;-)

                                      1 Reply Last reply
                                      0
                                      • K Offline
                                        K Offline
                                        ksga
                                        wrote on last edited by ksga
                                        #23

                                        Way too cool solution :dancers:

                                        I decided to give it a go with my Light/Baro/Hum/Temp node.
                                        Installed the dependencies from Adafruit, cleared EEPROM, compiled and flashed - no issues :+1:

                                        The node reports the expected sensors to MyController.
                                        The BH1750 light sensor works like a charm, but I'm not getting anything from the BME280 except from a 0.0°C reading on temperature (which, even though spring is pretty lousy so far is a bit on the low side for my office).

                                        Output on serial looks like this:

                                        PWR G=6 V=7
                                        REG I=1 P=18 P=16 T=37
                                        REG I=2 P=18 P=6 T=0
                                        REG I=3 P=18 P=7 T=1
                                        REG I=4 P=18 P=8 T=4
                                        NodeManager v1.4
                                        INT1 M=255
                                        INT2 M=255
                                        RADIO OK
                                        PRES I=200, T=23
                                        PRES I=201, T=30
                                        BATT V=3.35 P=94
                                        SEND D=0 I=201 C=0 T=38 S= I=0 F=3.35
                                        PRES I=1 T=16
                                        PRES I=2 T=6
                                        PRES I=3 T=7
                                        PRES I=4 T=8
                                        READY
                                        
                                        MY I=1 M=1
                                        ON P=7
                                        BH1 I=1 L=2500
                                        SEND D=0 I=1 C=0 T=37 S= N=2500 F=0.00
                                        BME I=2 T=0.00
                                        SEND D=0 I=2 C=0 T=0 S= N=0 F=0.00
                                        BME I=3 H=69.25
                                        SEND D=0 I=3 C=0 T=1 S= N=0 F=69.25
                                        BME I=4 P=0.00
                                        SEND D=0 I=4 C=0 T=4 S= N=0 F=0.00
                                        OFF P=7
                                        SLEEP 300s
                                        
                                        AWAKE
                                        ON P=7
                                        BH@PWR G=6 V=7
                                        REG I=1 P=18 P=16 T=37
                                        REG I=2 P=18 P=6 T=0
                                        REG I=3 P=18 P=7 T=1
                                        REG I=4 P=18 P=8 T=4
                                        NodeManager v1.4
                                        INT1 M=255
                                        INT2 M=255
                                        RADIO OK
                                        PRES I=200, T=23
                                        PRES I=201, T=30
                                        BATT V=3.35 P=94
                                        SEND D=0 I=201 C=0 T=38 S= I=0 F=3.35
                                        PRES I=1 T=16
                                        PRES I=2 T=6
                                        PRES I=3 T=7
                                        PRES I=4 T=8
                                        READY
                                        
                                        MY I=1 M=1
                                        ON P=7
                                        BH1 I=1 L=9951
                                        SEND D=0 I=1 C=0 T=37 S= N=9951 F=0.00
                                        BME I=2 T=0.00
                                        SEND D=0 I=2 C=0 T=0 S= N=0 F=0.00
                                        BME I=3 H=69.25
                                        SEND D=0 I=3 C=0 T=1 S= N=0 F=69.25
                                        BME I=4 P=0.00
                                        SEND D=0 I=4 C=0 T=4 S= N=0 F=0.00
                                        OFF P=7
                                        SLEEP 300s
                                        

                                        The node was running fine for months using the same BH1750 library, but the BME280 library by Tyler Glenn.

                                        Any ideas?

                                        Should notice that I'm using this kind of BME280 from Ali

                                        U 1 Reply Last reply
                                        0
                                        • K ksga

                                          Way too cool solution :dancers:

                                          I decided to give it a go with my Light/Baro/Hum/Temp node.
                                          Installed the dependencies from Adafruit, cleared EEPROM, compiled and flashed - no issues :+1:

                                          The node reports the expected sensors to MyController.
                                          The BH1750 light sensor works like a charm, but I'm not getting anything from the BME280 except from a 0.0°C reading on temperature (which, even though spring is pretty lousy so far is a bit on the low side for my office).

                                          Output on serial looks like this:

                                          PWR G=6 V=7
                                          REG I=1 P=18 P=16 T=37
                                          REG I=2 P=18 P=6 T=0
                                          REG I=3 P=18 P=7 T=1
                                          REG I=4 P=18 P=8 T=4
                                          NodeManager v1.4
                                          INT1 M=255
                                          INT2 M=255
                                          RADIO OK
                                          PRES I=200, T=23
                                          PRES I=201, T=30
                                          BATT V=3.35 P=94
                                          SEND D=0 I=201 C=0 T=38 S= I=0 F=3.35
                                          PRES I=1 T=16
                                          PRES I=2 T=6
                                          PRES I=3 T=7
                                          PRES I=4 T=8
                                          READY
                                          
                                          MY I=1 M=1
                                          ON P=7
                                          BH1 I=1 L=2500
                                          SEND D=0 I=1 C=0 T=37 S= N=2500 F=0.00
                                          BME I=2 T=0.00
                                          SEND D=0 I=2 C=0 T=0 S= N=0 F=0.00
                                          BME I=3 H=69.25
                                          SEND D=0 I=3 C=0 T=1 S= N=0 F=69.25
                                          BME I=4 P=0.00
                                          SEND D=0 I=4 C=0 T=4 S= N=0 F=0.00
                                          OFF P=7
                                          SLEEP 300s
                                          
                                          AWAKE
                                          ON P=7
                                          BH@PWR G=6 V=7
                                          REG I=1 P=18 P=16 T=37
                                          REG I=2 P=18 P=6 T=0
                                          REG I=3 P=18 P=7 T=1
                                          REG I=4 P=18 P=8 T=4
                                          NodeManager v1.4
                                          INT1 M=255
                                          INT2 M=255
                                          RADIO OK
                                          PRES I=200, T=23
                                          PRES I=201, T=30
                                          BATT V=3.35 P=94
                                          SEND D=0 I=201 C=0 T=38 S= I=0 F=3.35
                                          PRES I=1 T=16
                                          PRES I=2 T=6
                                          PRES I=3 T=7
                                          PRES I=4 T=8
                                          READY
                                          
                                          MY I=1 M=1
                                          ON P=7
                                          BH1 I=1 L=9951
                                          SEND D=0 I=1 C=0 T=37 S= N=9951 F=0.00
                                          BME I=2 T=0.00
                                          SEND D=0 I=2 C=0 T=0 S= N=0 F=0.00
                                          BME I=3 H=69.25
                                          SEND D=0 I=3 C=0 T=1 S= N=0 F=69.25
                                          BME I=4 P=0.00
                                          SEND D=0 I=4 C=0 T=4 S= N=0 F=0.00
                                          OFF P=7
                                          SLEEP 300s
                                          

                                          The node was running fine for months using the same BH1750 library, but the BME280 library by Tyler Glenn.

                                          Any ideas?

                                          Should notice that I'm using this kind of BME280 from Ali

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

                                          @ksga I can see from the logs the light sensor correctly returning something but the BME280 apparently only able to get the humidity. I also see the node rebooting itself at a certain point. Was it you resetting it? Because if it was not you, it may be due to the memory almost full and when this happens, the behaviors I've seen are really unpredictable including weird numbers reported. To start with, I'd recommend to disable NodeManager's debug which will save some memory and see on the controller if the data returned is correct. If it is still not correct, do you set any specific i2c channel in the other sketch where both the sensors are working fine? I wonder if there is any difference between the two sketches.
                                          Also, are the sensors powered by pin 6 and 7? If so I'd power them directly just to take away this variable at least for now.
                                          Thanks!

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


                                          9

                                          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