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.
  • G graham86

    Hi, obviously a lot of work gone into NodeManager thanks, I'm quite new to MySensors but have started working on.a few sensors around my home.

    I was just looking through the code (NodeManager.cpp) and an apparent issue jumped out at me (I write C++ for a living on very large boxes but still worry about performance!)
    The two functions NodeManager::_saveConfig and NodeManager::_loadConfig are used to save the _sleep_time value to EEPROM. The code splits the long value into 3 parts by dividing by successively 255 . On loading the value is reconstructed by multiplying by 255.
    I'm pretty sure that you meant to use 256 to split the long value into three independent bytes to store.
    Dividing or multiplying by 255 is potentially expensive whereas dividing or multiplying by 256 is much faster simply requiring shifts.
    The normal code for splitting a long value into individual bytes would be something like
    uint8_t byte0 = _sleep_time & 0xff; // compiler should generate a simple byte load
    uint8_t byte1 = (_sleep_time >> 8 ) & 0xff; // compiler should still generate a simple byte load from the second byte of _sleep_time
    uint8_t byte2 = (_sleep_time >> 16) & 0xff; // as before should still be a byte load.
    I'm not sure how good the gcc optimiser is for the AVR code but, putting the shift&mask operations directly into the calls of saveSave(...) may avoid having to allocate local variables as in
    // save the 3 bits
    saveState(EEPROM_SLEEP_SAVED,1);
    saveState(EEPROM_SLEEP_1,_sleep_time & 0xff);
    saveState(EEPROM_SLEEP_2,(_sleep_time >> 8 ) & 0xff);
    saveState(EEPROM_SLEEP_3, (_sleep_time >> 16) & 0xff);

    I am not an expert in in the AVR architecture or instruction set so maybe there is a good reason why you are using 255 instead of 256 - it just seems strange!

    Regards

    Graham

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

    @graham86 there was no special reason why I used 255 apart from my lack of c++ knowledge :P Thanks for the hit, I'll fix it with https://github.com/mysensors/NodeManager/issues/215

    1 Reply Last reply
    0
    • F FredRoot

      Hi,
      I have started to play with nodemanager and I have registered a SENSOR_DS18B20. Nodemanager handles all the heavy lifting and the sensor is reporting the temperature 100%. I can change the sleep and report intervals with “setReportIntervalSeconds and setSleepSeconds”.

      Question 1:
      According to the MySensors documentation (https://www.mysensors.org/download/serial_api_20#variable-types) a S_TEMP sensor can report the V_TEMP value and a V_ID value. Nodemanager populates the V_TEMP variable, but how can I populate and send the V_ID value?
      Question2:
      If I want to add an additional sensor I must register it with “registerSensor” and I would set the report interval for this sensor by getting a pointer to this sensor with “getSensor”, but how do I add custom code for this sensor in Loop()? How do I ensure that the custom code is only executed for this sensor and not for the other sensor?

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

      Hi @FredRoot, V_ID has not been used so far by NodeManager, thanks for noticing it! I've added https://github.com/mysensors/NodeManager/issues/216 for this

      Regarding the other question you have two ways: 1) add your custom code to onLoop() in NodeManager.cpp (this will not survive to an upgrade) 2) create a custom sensor inheriting from Sensor or other subclasses and call registerSensor() by providing an instance of this class (https://github.com/mysensors/NodeManager#creating-a-custom-sensor)
      Thanks

      1 Reply Last reply
      0
      • V vikasjee

        @user2684, Will you like to consider adding a #DEFINE to let user configure PowerOn function to select "GND-On" or "Vcc-On" (5V0)?

        With this GND-On PowerOn, a single GND wire controlled by a digital pin can control the power instead of 2 wire poweron control. [so many control words :)]

        For devices that require more than ~10mA current (~Arduino pin current) this GND-On configuration can help externally supplied higher powered V+ current to switch the devices! Thus, will also help 3V3 devices to be controlled by PowerOn, of course, with external 3V3!

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

        @vikasjee sorry my bad, I think I couldn't understand your suggestion :) Do you have an example to let me understand better? thanks and sorry again, I'm sure I'm missing something somewhere :)

        V 1 Reply Last reply
        0
        • K kted

          I just started using NodeManager, mainly for the ability to send settings to the node.
          I started with a plain analog (Voltage) sensor, and it works just fine. But I cannot make a DS18B20 sensor to send any temperature data. It registers on the gateway, and that's it.
          I have enabled the DS18B20 module in the config.h.
          This is the code in the sketch:

            /*
             * Register below your sensors
            */
            nodeManager.setSleepSeconds(10);
            nodeManager.setReportIntervalSeconds(10);
            int temp = nodeManager.registerSensor(SENSOR_DS18B20);
             /*
             * Register above your sensors
            */
          

          Am I missing something?

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

          @kted I think you forgot the pin to which the sensor is attached to. e.g.

          nodeManager.registerSensor(SENSOR_DS18B20,6);
          
          K 1 Reply Last reply
          0
          • U user2684

            @kted I think you forgot the pin to which the sensor is attached to. e.g.

            nodeManager.registerSensor(SENSOR_DS18B20,6);
            
            K Offline
            K Offline
            kted
            wrote on last edited by
            #115

            @user2684 Actually, you are right. Thank you.
            But shouldn't the compiler throw an error?

            Now to the hard part: How to send the actual command from Domoticz, for example to change the sleep duration...

            Sergio RiusS U 2 Replies Last reply
            0
            • K kted

              @user2684 Actually, you are right. Thank you.
              But shouldn't the compiler throw an error?

              Now to the hard part: How to send the actual command from Domoticz, for example to change the sleep duration...

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

              @kted Such functionality it's supposed to be hard-coded in the node sketch. But if you want to make it modificable from Domoticz, perhaps you can make use of the V_VAR1-3 variables and modify them in domoticz, receive them in the node and pass to NodeManager.

              1 Reply Last reply
              0
              • K kted

                @user2684 Actually, you are right. Thank you.
                But shouldn't the compiler throw an error?

                Now to the hard part: How to send the actual command from Domoticz, for example to change the sleep duration...

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

                @kted the compiler doesn't complain because for some sensors (e.g. those using i2c), the pin is not required so I made it not mandatory. As for Domoticz, I'll let others to address your question since I don't know that controller enough. Thanks

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  graham86
                  wrote on last edited by
                  #118

                  @user2684 I have looked at the changes in https://github.com/mysensors/NodeManager/pull/174 which incorporates an alternative improved implementation for the _LoadConfig/_SaveConfig functions (interesting that using an intermediate union requires less code than my shifting version- presumably due to differences in the way the GCC optimiser works for an AVR target).
                  I spotted a coupld of minor points and was also able to further reduce the code size.
                  Firstly as we are writing C++ rather than C the declaration of the union should just be
                  // Local union used to split _sleep_time into bytes
                  union tLongByteArrayCombo{
                  long long_value;
                  uint8_t byte_array[4];
                  } ;
                  (The typedef systax, although valid C++ is unnecessary - a simple union declaration is sufficient.)
                  There is also a typo - the original had a member called byte_arrray instead of byte_array.

                  You can also save 24 bytes of code by avoiding the use of a local union variable and simply aliasing _sleep_time as the union type. So instead of _load_config doing -
                  tLongByteArrayCombo c;
                  c.byte_array[0] = loadState(EEPROM_SLEEP_1);
                  c.byte_array[1] = loadState(EEPROM_SLEEP_2);
                  c.byte_array[2] = loadState(EEPROM_SLEEP_3);
                  c.byte_array[3] = 0;
                  _sleep_time = c.long_value;
                  You can do
                  (((tLongByteArrayCombo&)_sleep_time).byte_array )[0] = loadState(EEPROM_SLEEP_1);
                  (((tLongByteArrayCombo&)_sleep_time).byte_array )[1] = loadState(EEPROM_SLEEP_2);
                  (((tLongByteArrayCombo&)_sleep_time).byte_array )[2] = loadState(EEPROM_SLEEP_3);
                  (((tLongByteArrayCombo&)_sleep_time).byte_array )[3] = 0;
                  And in _save_config instead of
                  tLongByteArrayCombo c;
                  c.long_value = _sleep_time;
                  saveState(EEPROM_SLEEP_1, c.byte_array[0]);
                  saveState(EEPROM_SLEEP_2, c.byte_array[1]);
                  saveState(EEPROM_SLEEP_3, c.byte_array[2]);
                  you can use
                  saveState(EEPROM_SLEEP_1, (((tLongByteArrayCombo&)_sleep_time).byte_array )[0] );
                  saveState(EEPROM_SLEEP_2, (((tLongByteArrayCombo&)_sleep_time).byte_array )[1] );
                  saveState(EEPROM_SLEEP_3, (((tLongByteArrayCombo&)_sleep_time).byte_array )[2] );

                  In my specific sample sketch I had the following code sizes

                  Original NodeManager.cpp 28242 Bytes
                  NodeManager with patch from pull rq 174 - 28154 Bytes (saving of 88 Bytes of code(
                  Patched NodeManager with additional changes above - 28130 Bytes ( saving another 24 Bytes of code)

                  U 1 Reply Last reply
                  0
                  • G graham86

                    @user2684 I have looked at the changes in https://github.com/mysensors/NodeManager/pull/174 which incorporates an alternative improved implementation for the _LoadConfig/_SaveConfig functions (interesting that using an intermediate union requires less code than my shifting version- presumably due to differences in the way the GCC optimiser works for an AVR target).
                    I spotted a coupld of minor points and was also able to further reduce the code size.
                    Firstly as we are writing C++ rather than C the declaration of the union should just be
                    // Local union used to split _sleep_time into bytes
                    union tLongByteArrayCombo{
                    long long_value;
                    uint8_t byte_array[4];
                    } ;
                    (The typedef systax, although valid C++ is unnecessary - a simple union declaration is sufficient.)
                    There is also a typo - the original had a member called byte_arrray instead of byte_array.

                    You can also save 24 bytes of code by avoiding the use of a local union variable and simply aliasing _sleep_time as the union type. So instead of _load_config doing -
                    tLongByteArrayCombo c;
                    c.byte_array[0] = loadState(EEPROM_SLEEP_1);
                    c.byte_array[1] = loadState(EEPROM_SLEEP_2);
                    c.byte_array[2] = loadState(EEPROM_SLEEP_3);
                    c.byte_array[3] = 0;
                    _sleep_time = c.long_value;
                    You can do
                    (((tLongByteArrayCombo&)_sleep_time).byte_array )[0] = loadState(EEPROM_SLEEP_1);
                    (((tLongByteArrayCombo&)_sleep_time).byte_array )[1] = loadState(EEPROM_SLEEP_2);
                    (((tLongByteArrayCombo&)_sleep_time).byte_array )[2] = loadState(EEPROM_SLEEP_3);
                    (((tLongByteArrayCombo&)_sleep_time).byte_array )[3] = 0;
                    And in _save_config instead of
                    tLongByteArrayCombo c;
                    c.long_value = _sleep_time;
                    saveState(EEPROM_SLEEP_1, c.byte_array[0]);
                    saveState(EEPROM_SLEEP_2, c.byte_array[1]);
                    saveState(EEPROM_SLEEP_3, c.byte_array[2]);
                    you can use
                    saveState(EEPROM_SLEEP_1, (((tLongByteArrayCombo&)_sleep_time).byte_array )[0] );
                    saveState(EEPROM_SLEEP_2, (((tLongByteArrayCombo&)_sleep_time).byte_array )[1] );
                    saveState(EEPROM_SLEEP_3, (((tLongByteArrayCombo&)_sleep_time).byte_array )[2] );

                    In my specific sample sketch I had the following code sizes

                    Original NodeManager.cpp 28242 Bytes
                    NodeManager with patch from pull rq 174 - 28154 Bytes (saving of 88 Bytes of code(
                    Patched NodeManager with additional changes above - 28130 Bytes ( saving another 24 Bytes of code)

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

                    @graham86 I guess you are referring to https://github.com/mysensors/NodeManager/pull/217, not 174, am I wrong? Anyway, any contribution that would help saving bytes is more than welcome: NodeManager is becoming more and more complex and the situations where we are out of storage start increasing so we definitely need to save whatever wherever we can :-) Regarding what you are proposing above, keep on eye on PR #217; once a new one dedicated to this part of the code will be created as discussed there, feel free to add your own PR to that branch or just let me know and I'll do it for you. Thanks!

                    1 Reply Last reply
                    0
                    • U user2684

                      @vikasjee sorry my bad, I think I couldn't understand your suggestion :) Do you have an example to let me understand better? thanks and sorry again, I'm sure I'm missing something somewhere :)

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

                      @user2684, Sorry, couldn't revert to your query earlier as i was away building a small library.

                      Expanding onto my earlier post on the requested Power Management feature -
                      A simple switch will complete a circuit whenever its switched ON. This allows for placing the switch on the ground return wire too. So only a single GND-ON (Switched ON) will complete the circuit (without requiring an additional Vcc-ON switch).

                      Now, with a developer configured #DEFINE GND_ON_POWER =1 may be checked in NodeManager's PowerManagement functions to DigitalWrite(Digital_GND_ON_Pin, LOW)
                      for a switchON effect.

                      Additionally, To provide an extra current to a sensor (i.e. more than a ~10mA-20mA, a max safe current provided by an Arduino pin) an external power source (other than Arduino +5V0 OR +3V3) may be provided by that external power source (of course with with a common ground wire between Arduino and that powersource to complete the circuit.)

                      Also, with the current 2Wire PowerOn methodology, the VccPowerOn switch can provide only one positive voltage (that provided by Arduino Vcc, say +5V0) but not +3V3 (say) to the sensors. If some attached sensors require the other voltage (+3V3), then, this 2Wire PowerOn method will not help. Whereas, a single GND_On power methodology will still switch the circuit thus managing the Power to those sensors too.
                      [PS: Signal Voltage Levels will still need to be managed by the developer attaching those sensors to the node]

                      I think this simple feature will add on to the power of the PowerManagement functions.

                      Hope this clears some air ? Open to suggestions...

                      U 1 Reply Last reply
                      0
                      • V vikasjee

                        @user2684, Sorry, couldn't revert to your query earlier as i was away building a small library.

                        Expanding onto my earlier post on the requested Power Management feature -
                        A simple switch will complete a circuit whenever its switched ON. This allows for placing the switch on the ground return wire too. So only a single GND-ON (Switched ON) will complete the circuit (without requiring an additional Vcc-ON switch).

                        Now, with a developer configured #DEFINE GND_ON_POWER =1 may be checked in NodeManager's PowerManagement functions to DigitalWrite(Digital_GND_ON_Pin, LOW)
                        for a switchON effect.

                        Additionally, To provide an extra current to a sensor (i.e. more than a ~10mA-20mA, a max safe current provided by an Arduino pin) an external power source (other than Arduino +5V0 OR +3V3) may be provided by that external power source (of course with with a common ground wire between Arduino and that powersource to complete the circuit.)

                        Also, with the current 2Wire PowerOn methodology, the VccPowerOn switch can provide only one positive voltage (that provided by Arduino Vcc, say +5V0) but not +3V3 (say) to the sensors. If some attached sensors require the other voltage (+3V3), then, this 2Wire PowerOn method will not help. Whereas, a single GND_On power methodology will still switch the circuit thus managing the Power to those sensors too.
                        [PS: Signal Voltage Levels will still need to be managed by the developer attaching those sensors to the node]

                        I think this simple feature will add on to the power of the PowerManagement functions.

                        Hope this clears some air ? Open to suggestions...

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

                        @vikasjee thanks all clear now! I'll track this with https://github.com/mysensors/NodeManager/issues/224. Thanks again for the detailed explanation!

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

                          Hello all, just to let you know when compiling against the latest version of the mysensors 2.2.0-beta library, NodeManager will crash on startup, just after presenting the mysensors logo. Thanks @gohan for pointing this out! Root cause is still unknown but when MY_DEBUG is defined, the crash doesn't take place (https://github.com/mysensors/NodeManager/issues/223)

                          V 1 Reply Last reply
                          1
                          • U user2684

                            Hello all, just to let you know when compiling against the latest version of the mysensors 2.2.0-beta library, NodeManager will crash on startup, just after presenting the mysensors logo. Thanks @gohan for pointing this out! Root cause is still unknown but when MY_DEBUG is defined, the crash doesn't take place (https://github.com/mysensors/NodeManager/issues/223)

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

                            @user2684, Can we have a quick hot fix?

                            U 1 Reply Last reply
                            0
                            • V vikasjee

                              @user2684, Can we have a quick hot fix?

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

                              @vikasjee sure, as soon as I'll be able to understand the reason why it crashes when MY_DEBUG is not defined :-( if somebody from the core team has any hit, would be really appreciated!
                              Thanks

                              1 Reply Last reply
                              0
                              • Sergio RiusS Offline
                                Sergio RiusS Offline
                                Sergio Rius
                                wrote on last edited by Sergio Rius
                                #125

                                I'm afraid that issue 223 is not a NodeManager failure. I can reproduce it in a new sketch without using NodeManager.
                                Other issue with MySensors are, NRF24 doesn't link with controller.
                                If MY_DEBUG_VERBOSE_RF24 is defined, it automagically works.

                                V 1 Reply Last reply
                                0
                                • Sergio RiusS Sergio Rius

                                  I'm afraid that issue 223 is not a NodeManager failure. I can reproduce it in a new sketch without using NodeManager.
                                  Other issue with MySensors are, NRF24 doesn't link with controller.
                                  If MY_DEBUG_VERBOSE_RF24 is defined, it automagically works.

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

                                  @Sergio-Rius, with RF24_VERBOSE on, the system crashes in 40-50 seconds especially if you're connected to the serial monitor or if your serial gateway has this #DEFINE on.

                                  Sergio RiusS 1 Reply Last reply
                                  0
                                  • V vikasjee

                                    @Sergio-Rius, with RF24_VERBOSE on, the system crashes in 40-50 seconds especially if you're connected to the serial monitor or if your serial gateway has this #DEFINE on.

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

                                    Still more strange, suddenly started to work properly on 2/3 of my testing nodes. That killed me.

                                    What about the gateways you are using? And the controllers?

                                    1 Reply Last reply
                                    0
                                    • F Offline
                                      F Offline
                                      FredRoot
                                      wrote on last edited by
                                      #128

                                      Hi,

                                      I'm having trouble with the motion sample code. I have changed the setSleepHours(1) command to setSleepMinutes(1). I understand that the sensor will send a hart beat every 1 min. This is working fine for the hart beat, but evertime the hart beat is send the sensor sends a Trigger messages as well even though the sensor is not triggered. I thought that maybe there is a power dip and that it might cause the PIR (RS501) to send a interrupt, but I have removed the setSleepMinutes command and replaced it with a setBatteryReportHours(1) command. This command is send correctly and the sensor only sends the trigger command when the PIR is triggered. Did anyone have a similar issue?

                                      Attached is the sensor debug output when the setSleepMinutes command is used:

                                      0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
                                      40 MCO:BGN:BFR
                                      REG I=1 P=3 P=1 T=16
                                      NodeManager v1.6
                                      LIB V=2.1.1 R=N T=N A=A S=- B=-
                                      INT P=3 M=1
                                      INT P=2 M=255
                                      96 TSM:INIT
                                      176 TSF:WUR:MS=0
                                      198 TSM:INIT:TSP OK
                                      219 TSM:INIT:STATID=3
                                      243 TSF:SID:OK,ID=3
                                      264 TSM:FPAR
                                      313 TSF:MSG:SEND,3-3-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
                                      385 TSF:MSG:READ,0-0-3,s=255,c=3,t=8,pt=1,l=1,sg=0:0
                                      440 TSF:MSG:FPAR OK,ID=0,D=1
                                      2387 TSM:FPAR:OK
                                      2404 TSM:ID
                                      2418 TSM:ID:OK
                                      2433 TSM:UPL
                                      2449 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
                                      2521 TSF:MSG:READ,0-0-3,s=255,c=3,t=25,pt=1,l=1,sg=0:1
                                      2578 TSF:MSG:PONG RECV,HP=1
                                      2607 TSM:UPL:OK
                                      2625 TSM:READY:ID=3,PAR=0,DIS=1
                                      2660 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
                                      2734 TSF:MSG:READ,0-0-3,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
                                      2797 TSF:MSG:SEND,3-3-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
                                      2875 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
                                      2945 TSF:MSG:READ,0-0-3,s=255,c=3,t=6,pt=0,l=1,sg=0:M
                                      RADIO OK
                                      3004 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:NodeManager
                                      3096 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
                                      PRES I=200, T=23
                                      3170 TSF:MSG:SEND,3-3-0-0,s=200,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=OK:
                                      PRES I=201, T=30
                                      3260 TSF:MSG:SEND,3-3-0-0,s=201,c=0,t=30,pt=0,l=0,sg=0,ft=0,st=OK:
                                      BATT V=3.30 P=100
                                      SEND D=0 I=201 C=0 T=38 S= I=0 F=3.30
                                      3418 !MCO:SND:NODE NOT REG
                                      3506 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:100
                                      PRES I=1 T=1
                                      3579 TSF:MSG:SEND,3-3-0-0,s=1,c=0,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
                                      READY
                                      
                                      3659 MCO:REG:REQ
                                      3688 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
                                      3760 TSF:MSG:READ,0-0-3,s=255,c=3,t=27,pt=1,l=1,sg=0:1
                                      3817 MCO:PIM:NODE REG=1
                                      3842 MCO:BGN:STP
                                      MY I=3 M=1
                                      3860 MCO:BGN:INIT OK,TSP=1
                                      SLEEP 60s
                                      
                                      3901 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                      3971 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:127
                                      4544 MCO:SLP:TPD
                                      4560 MCO:SLP:WUP=1
                                      INT P=3, M=1
                                      AWAKE
                                      SWITCH I=1 P=3 V=1
                                      SEND D=0 I=1 C=0 T=16 S= I=1 F=0.00
                                      4597 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
                                      SLEEP 60s
                                      
                                      4732 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                      4800 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:956
                                      5376 MCO:SLP:TPD
                                      5392 MCO:SLP:WUP=1
                                      INT P=3, M=1
                                      AWAKE
                                      SWITCH I=1 P=3 V=0
                                      SEND D=0 I=1 C=1 T=16 S= I=0 F=0.00
                                      5429 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                                      SLEEP 60s
                                      
                                      5564 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                      5632 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:1787
                                      6207 MCO:SLP:TPD
                                      6223 MCO:SLP:WUP=-1
                                      AWAKE
                                      SLEEP 60s
                                      
                                      6246 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                      6322 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:2478
                                      6897 MCO:SLP:TPD
                                      6914 MCO:SLP:WUP=1
                                      INT P=3, M=1
                                      AWAKE
                                      SWITCH I=1 P=3 V=1
                                      SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
                                      6950 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
                                      SLEEP 60s
                                      
                                      7086 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                      7153 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:3309
                                      7729 MCO:SLP:TPD
                                      7745 MCO:SLP:WUP=1
                                      INT P=3, M=1
                                      AWAKE
                                      SWITCH I=1 P=3 V=0
                                      SEND D=0 I=1 C=1 T=16 S= I=0 F=0.00
                                      7782 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                                      SLEEP 60s
                                      
                                      7917 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                      7985 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:4141
                                      8560 MCO:SLP:TPD
                                      8577 MCO:SLP:WUP=-1
                                      AWAKE
                                      SLEEP 60s
                                      
                                      8599 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                      8675 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:4831
                                      9252 MCO:SLP:TPD
                                      9269 MCO:SLP:WUP=1
                                      INT P=3, M=1
                                      AWAKE
                                      SWITCH I=1 P=3 V=1
                                      SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
                                      9306 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
                                      SLEEP 60s
                                      
                                      9441 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                      9508 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:5664
                                      10084 MCO:SLP:TPD
                                      10102 MCO:SLP:WUP=1
                                      INT P=3, M=1
                                      AWAKE
                                      SWITCH I=1 P=3 V=0
                                      SEND D=0 I=1 C=1 T=16 S= I=0 F=0.00
                                      10139 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                                      SLEEP 60s
                                      
                                      10274 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                      10344 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:6500
                                      10921 MCO:SLP:TPD
                                      
                                      
                                      U 1 Reply Last reply
                                      0
                                      • F FredRoot

                                        Hi,

                                        I'm having trouble with the motion sample code. I have changed the setSleepHours(1) command to setSleepMinutes(1). I understand that the sensor will send a hart beat every 1 min. This is working fine for the hart beat, but evertime the hart beat is send the sensor sends a Trigger messages as well even though the sensor is not triggered. I thought that maybe there is a power dip and that it might cause the PIR (RS501) to send a interrupt, but I have removed the setSleepMinutes command and replaced it with a setBatteryReportHours(1) command. This command is send correctly and the sensor only sends the trigger command when the PIR is triggered. Did anyone have a similar issue?

                                        Attached is the sensor debug output when the setSleepMinutes command is used:

                                        0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
                                        40 MCO:BGN:BFR
                                        REG I=1 P=3 P=1 T=16
                                        NodeManager v1.6
                                        LIB V=2.1.1 R=N T=N A=A S=- B=-
                                        INT P=3 M=1
                                        INT P=2 M=255
                                        96 TSM:INIT
                                        176 TSF:WUR:MS=0
                                        198 TSM:INIT:TSP OK
                                        219 TSM:INIT:STATID=3
                                        243 TSF:SID:OK,ID=3
                                        264 TSM:FPAR
                                        313 TSF:MSG:SEND,3-3-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
                                        385 TSF:MSG:READ,0-0-3,s=255,c=3,t=8,pt=1,l=1,sg=0:0
                                        440 TSF:MSG:FPAR OK,ID=0,D=1
                                        2387 TSM:FPAR:OK
                                        2404 TSM:ID
                                        2418 TSM:ID:OK
                                        2433 TSM:UPL
                                        2449 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
                                        2521 TSF:MSG:READ,0-0-3,s=255,c=3,t=25,pt=1,l=1,sg=0:1
                                        2578 TSF:MSG:PONG RECV,HP=1
                                        2607 TSM:UPL:OK
                                        2625 TSM:READY:ID=3,PAR=0,DIS=1
                                        2660 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
                                        2734 TSF:MSG:READ,0-0-3,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
                                        2797 TSF:MSG:SEND,3-3-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
                                        2875 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
                                        2945 TSF:MSG:READ,0-0-3,s=255,c=3,t=6,pt=0,l=1,sg=0:M
                                        RADIO OK
                                        3004 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:NodeManager
                                        3096 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
                                        PRES I=200, T=23
                                        3170 TSF:MSG:SEND,3-3-0-0,s=200,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=OK:
                                        PRES I=201, T=30
                                        3260 TSF:MSG:SEND,3-3-0-0,s=201,c=0,t=30,pt=0,l=0,sg=0,ft=0,st=OK:
                                        BATT V=3.30 P=100
                                        SEND D=0 I=201 C=0 T=38 S= I=0 F=3.30
                                        3418 !MCO:SND:NODE NOT REG
                                        3506 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:100
                                        PRES I=1 T=1
                                        3579 TSF:MSG:SEND,3-3-0-0,s=1,c=0,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
                                        READY
                                        
                                        3659 MCO:REG:REQ
                                        3688 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
                                        3760 TSF:MSG:READ,0-0-3,s=255,c=3,t=27,pt=1,l=1,sg=0:1
                                        3817 MCO:PIM:NODE REG=1
                                        3842 MCO:BGN:STP
                                        MY I=3 M=1
                                        3860 MCO:BGN:INIT OK,TSP=1
                                        SLEEP 60s
                                        
                                        3901 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                        3971 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:127
                                        4544 MCO:SLP:TPD
                                        4560 MCO:SLP:WUP=1
                                        INT P=3, M=1
                                        AWAKE
                                        SWITCH I=1 P=3 V=1
                                        SEND D=0 I=1 C=0 T=16 S= I=1 F=0.00
                                        4597 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
                                        SLEEP 60s
                                        
                                        4732 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                        4800 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:956
                                        5376 MCO:SLP:TPD
                                        5392 MCO:SLP:WUP=1
                                        INT P=3, M=1
                                        AWAKE
                                        SWITCH I=1 P=3 V=0
                                        SEND D=0 I=1 C=1 T=16 S= I=0 F=0.00
                                        5429 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                                        SLEEP 60s
                                        
                                        5564 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                        5632 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:1787
                                        6207 MCO:SLP:TPD
                                        6223 MCO:SLP:WUP=-1
                                        AWAKE
                                        SLEEP 60s
                                        
                                        6246 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                        6322 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:2478
                                        6897 MCO:SLP:TPD
                                        6914 MCO:SLP:WUP=1
                                        INT P=3, M=1
                                        AWAKE
                                        SWITCH I=1 P=3 V=1
                                        SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
                                        6950 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
                                        SLEEP 60s
                                        
                                        7086 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                        7153 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:3309
                                        7729 MCO:SLP:TPD
                                        7745 MCO:SLP:WUP=1
                                        INT P=3, M=1
                                        AWAKE
                                        SWITCH I=1 P=3 V=0
                                        SEND D=0 I=1 C=1 T=16 S= I=0 F=0.00
                                        7782 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                                        SLEEP 60s
                                        
                                        7917 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                        7985 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:4141
                                        8560 MCO:SLP:TPD
                                        8577 MCO:SLP:WUP=-1
                                        AWAKE
                                        SLEEP 60s
                                        
                                        8599 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                        8675 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:4831
                                        9252 MCO:SLP:TPD
                                        9269 MCO:SLP:WUP=1
                                        INT P=3, M=1
                                        AWAKE
                                        SWITCH I=1 P=3 V=1
                                        SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
                                        9306 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
                                        SLEEP 60s
                                        
                                        9441 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                        9508 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:5664
                                        10084 MCO:SLP:TPD
                                        10102 MCO:SLP:WUP=1
                                        INT P=3, M=1
                                        AWAKE
                                        SWITCH I=1 P=3 V=0
                                        SEND D=0 I=1 C=1 T=16 S= I=0 F=0.00
                                        10139 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                                        SLEEP 60s
                                        
                                        10274 MCO:SLP:MS=60000,SMS=1,I1=1,M1=1,I2=255,M2=255
                                        10344 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:6500
                                        10921 MCO:SLP:TPD
                                        
                                        
                                        U Offline
                                        U Offline
                                        user2684
                                        Contest Winner
                                        wrote on last edited by
                                        #129

                                        @FredRoot this is weird, from the logs looks like there is kind of a floating interrupt (alternatively 1 and 0). The strange thing is that the interrupt is coming from the call to mysensors' sleep() function which is returning a positive number corresponding to the interrupt linked to pin 3 instead of a negative value like it should after a sleeping cycle. Anybody else experiencing this behavior with NodeManager v1.6? thanks

                                        1 Reply Last reply
                                        0
                                        • M Offline
                                          M Offline
                                          mvader
                                          wrote on last edited by mvader
                                          #130

                                          @user2684 can you add support for the Si7021 sensor as found in sensebender micro?
                                          https://www.mysensors.org/hardware/micro

                                          also, 2nd question.
                                          how do i register a sensor that is onboard?
                                          you ask for a child id and pin that it's on. but if it's an onboard sensor. how do you make that work? just omit the pin?

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


                                          5

                                          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