Skip to content
  • 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. Troubleshooting
  3. Sleep issue
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

Sleep issue

Scheduled Pinned Locked Moved Troubleshooting
8 Posts 2 Posters 1.4k Views 2 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.
  • Richard van der PlasR Offline
    Richard van der PlasR Offline
    Richard van der Plas
    wrote on last edited by Richard van der Plas
    #1

    Having code with a door sensor and a light.
    Because i want to save battery time, ive incoporated a sleep mode.
    the sleep mode is called after the door is closed, and will wake up again after a change or time ( to measure temperature).
    Sleep mode must not be called when the door is open because of the light which should go out after a radio message from the Gateway.

    snippet of code:, the 2,5 seconds delay is to make sure the door doesnt open again.

    if (gotoSleep == 1) {
         Serial.print("--==## Door closed, Going to Sleep ");
         Serial.println(SLEEP_TIME);
         delay(2500);
         sleep(digitalPinToInterrupt(DOOR_SWITCH), FALLING, SLEEP_TIME);
         gotoSleep =0;
       }
    

    log file shows this:

    --==##Door Trigger1
    14061 TSF:MSG:SEND,5-5-0-0,s=0,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1
    --## Running  Loop
    --==##Door Trigger0
    16822 TSF:MSG:SEND,5-5-0-0,s=0,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:0
    --==## Door closed, Going to Sleep 
    19329 MCO:SLP:MS=300000,SMS=0,I1=0,M1=2,I2=255,M2=255
    19333 MCO:SLP:TPD
    19385 MCO:SLP:WUP=0
    

    That is so weird, why does it wake again on interrupt (as told by log parser)
    CHANGE or FALLING doesn t matter

    Richard van der PlasR YveauxY 2 Replies Last reply
    0
    • Richard van der PlasR Richard van der Plas

      Having code with a door sensor and a light.
      Because i want to save battery time, ive incoporated a sleep mode.
      the sleep mode is called after the door is closed, and will wake up again after a change or time ( to measure temperature).
      Sleep mode must not be called when the door is open because of the light which should go out after a radio message from the Gateway.

      snippet of code:, the 2,5 seconds delay is to make sure the door doesnt open again.

      if (gotoSleep == 1) {
           Serial.print("--==## Door closed, Going to Sleep ");
           Serial.println(SLEEP_TIME);
           delay(2500);
           sleep(digitalPinToInterrupt(DOOR_SWITCH), FALLING, SLEEP_TIME);
           gotoSleep =0;
         }
      

      log file shows this:

      --==##Door Trigger1
      14061 TSF:MSG:SEND,5-5-0-0,s=0,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1
      --## Running  Loop
      --==##Door Trigger0
      16822 TSF:MSG:SEND,5-5-0-0,s=0,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:0
      --==## Door closed, Going to Sleep 
      19329 MCO:SLP:MS=300000,SMS=0,I1=0,M1=2,I2=255,M2=255
      19333 MCO:SLP:TPD
      19385 MCO:SLP:WUP=0
      

      That is so weird, why does it wake again on interrupt (as told by log parser)
      CHANGE or FALLING doesn t matter

      Richard van der PlasR Offline
      Richard van der PlasR Offline
      Richard van der Plas
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • Richard van der PlasR Richard van der Plas

        Having code with a door sensor and a light.
        Because i want to save battery time, ive incoporated a sleep mode.
        the sleep mode is called after the door is closed, and will wake up again after a change or time ( to measure temperature).
        Sleep mode must not be called when the door is open because of the light which should go out after a radio message from the Gateway.

        snippet of code:, the 2,5 seconds delay is to make sure the door doesnt open again.

        if (gotoSleep == 1) {
             Serial.print("--==## Door closed, Going to Sleep ");
             Serial.println(SLEEP_TIME);
             delay(2500);
             sleep(digitalPinToInterrupt(DOOR_SWITCH), FALLING, SLEEP_TIME);
             gotoSleep =0;
           }
        

        log file shows this:

        --==##Door Trigger1
        14061 TSF:MSG:SEND,5-5-0-0,s=0,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1
        --## Running  Loop
        --==##Door Trigger0
        16822 TSF:MSG:SEND,5-5-0-0,s=0,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:0
        --==## Door closed, Going to Sleep 
        19329 MCO:SLP:MS=300000,SMS=0,I1=0,M1=2,I2=255,M2=255
        19333 MCO:SLP:TPD
        19385 MCO:SLP:WUP=0
        

        That is so weird, why does it wake again on interrupt (as told by log parser)
        CHANGE or FALLING doesn t matter

        YveauxY Offline
        YveauxY Offline
        Yveaux
        Mod
        wrote on last edited by
        #3

        @Richard-van-der-Plas update to latest MySensors library (2.2.0 beta) and try again please.

        http://yveaux.blogspot.nl

        Richard van der PlasR 1 Reply Last reply
        0
        • YveauxY Yveaux

          @Richard-van-der-Plas update to latest MySensors library (2.2.0 beta) and try again please.

          Richard van der PlasR Offline
          Richard van der PlasR Offline
          Richard van der Plas
          wrote on last edited by
          #4

          @Yveaux i dont think i can do that in the online arduino create environment.....

          YveauxY 1 Reply Last reply
          0
          • Richard van der PlasR Richard van der Plas

            @Yveaux i dont think i can do that in the online arduino create environment.....

            YveauxY Offline
            YveauxY Offline
            Yveaux
            Mod
            wrote on last edited by
            #5

            @Richard-van-der-Plas probably not, but what you're describing is a known issue in 2.1.x

            http://yveaux.blogspot.nl

            Richard van der PlasR 1 Reply Last reply
            0
            • YveauxY Yveaux

              @Richard-van-der-Plas probably not, but what you're describing is a known issue in 2.1.x

              Richard van der PlasR Offline
              Richard van der PlasR Offline
              Richard van der Plas
              wrote on last edited by
              #6

              @Yveaux damn is there any other way to fix it besides the 2.2?

              YveauxY 1 Reply Last reply
              0
              • Richard van der PlasR Richard van der Plas

                @Yveaux damn is there any other way to fix it besides the 2.2?

                YveauxY Offline
                YveauxY Offline
                Yveaux
                Mod
                wrote on last edited by
                #7

                @Richard-van-der-Plas not that I'm aware of. It's a bug in the library which you cannot fix without touching the library code.

                http://yveaux.blogspot.nl

                Richard van der PlasR 1 Reply Last reply
                0
                • YveauxY Yveaux

                  @Richard-van-der-Plas not that I'm aware of. It's a bug in the library which you cannot fix without touching the library code.

                  Richard van der PlasR Offline
                  Richard van der PlasR Offline
                  Richard van der Plas
                  wrote on last edited by
                  #8

                  @Yveaux Ok went to 2.0 and that indeed works

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


                  18

                  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
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular