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 time is not actual sleep time
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

Sleep time is not actual sleep time

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 3 Posters 1.3k Views 3 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.
  • N Offline
    N Offline
    Nicklas Starkel
    wrote on last edited by
    #1

    Hello,

    I use Sleep on one of my nodes and then wake up to report to GW.
    It is set to sleep 3600000 which should equivalent to 1 hour (10006060).
    However, I can see that this is not the case.
    My node wakes up, but about every 1hour 9 minutes instead to report.
    I'm using a arduino pro mini (chinese) so obviously this could be the culprit.
    Just wondering if anyone else has seen this :)

    mfalkviddM YveauxY 2 Replies Last reply
    0
    • N Nicklas Starkel

      Hello,

      I use Sleep on one of my nodes and then wake up to report to GW.
      It is set to sleep 3600000 which should equivalent to 1 hour (10006060).
      However, I can see that this is not the case.
      My node wakes up, but about every 1hour 9 minutes instead to report.
      I'm using a arduino pro mini (chinese) so obviously this could be the culprit.
      Just wondering if anyone else has seen this :)

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      @Nicklas-Starkel yes that is very common. The Arduino doesn't really know anything about time. It just knows how much time a clock cycle usually takes. But that varies with temperature, voltage and maybe some other factors.

      If exact sleeping time is important, add a rtc module. See https://www.mysensors.org/build/display for an example.

      1 Reply Last reply
      0
      • N Nicklas Starkel

        Hello,

        I use Sleep on one of my nodes and then wake up to report to GW.
        It is set to sleep 3600000 which should equivalent to 1 hour (10006060).
        However, I can see that this is not the case.
        My node wakes up, but about every 1hour 9 minutes instead to report.
        I'm using a arduino pro mini (chinese) so obviously this could be the culprit.
        Just wondering if anyone else has seen this :)

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

        @Nicklas-Starkel The sleep() function will use the watchdog timer to wake the ATmega from deep sleep again, not the regular oscillator.
        This watchdog timer, contrary to the oscillator, can be off by +/- 10% (which is an ATmega limitation; it has nothing to do with Chinese origin), which roughly matches the time you measured.
        The actual deviation depends on a number of factors, as @mfalkvidd already indicated.

        If however it is quite constant in your situation, you could simply corrrect for this offset by lowering the sleep time for your node.
        E.g. try 60/69 * 3 600 000 = 3 130 435 and see if it now wakes up close to 1 hour.

        http://yveaux.blogspot.nl

        N 1 Reply Last reply
        1
        • YveauxY Yveaux

          @Nicklas-Starkel The sleep() function will use the watchdog timer to wake the ATmega from deep sleep again, not the regular oscillator.
          This watchdog timer, contrary to the oscillator, can be off by +/- 10% (which is an ATmega limitation; it has nothing to do with Chinese origin), which roughly matches the time you measured.
          The actual deviation depends on a number of factors, as @mfalkvidd already indicated.

          If however it is quite constant in your situation, you could simply corrrect for this offset by lowering the sleep time for your node.
          E.g. try 60/69 * 3 600 000 = 3 130 435 and see if it now wakes up close to 1 hour.

          N Offline
          N Offline
          Nicklas Starkel
          wrote on last edited by
          #4

          @Yveaux and @mfalkvidd thanks!
          It's not important for me, just curious to know why :)

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


          13

          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