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. Troubleshooting
  3. gw.sleep(...) and milis()

gw.sleep(...) and milis()

Scheduled Pinned Locked Moved Troubleshooting
2 Posts 2 Posters 2.8k Views 1 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.
  • marceltrapmanM Offline
    marceltrapmanM Offline
    marceltrapman
    Mod
    wrote on last edited by
    #1

    When using

    gw.sleep( INTERRUPT, CHANGE, SLEEP_TIME );
    

    I noticed that the millis() are not updated until the board wakes up again.

    Is that how it is supposed to be?
    If so, is there an alternative?
    Based on the millis() before and after the sleep I want to execute different methods...
    Due to the fact that I use the interrupt I obviously don't know how much time lies between the two.

    Fulltime Servoy Developer
    Parttime Moderator MySensors board

    I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
    I have a FABtotum to print cases.

    hekH 1 Reply Last reply
    0
    • marceltrapmanM marceltrapman

      When using

      gw.sleep( INTERRUPT, CHANGE, SLEEP_TIME );
      

      I noticed that the millis() are not updated until the board wakes up again.

      Is that how it is supposed to be?
      If so, is there an alternative?
      Based on the millis() before and after the sleep I want to execute different methods...
      Due to the fact that I use the interrupt I obviously don't know how much time lies between the two.

      hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      @marceltrapman

      Yes, it is a fact we have to live with. You can look at the return-value if wake-up was triggered by external interrupt or timer.

      If timer triggered wake-up you know how long the sensor has slept. But if wakeup was triggered by external interrupt there is no way to know how long it slept.

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


      22

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 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