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. Test time with TimeAwareSensor sketch

Test time with TimeAwareSensor sketch

Scheduled Pinned Locked Moved Troubleshooting
6 Posts 2 Posters 1.2k 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.
  • F Offline
    F Offline
    Fl0rian
    wrote on last edited by
    #1

    Hi,

    Actually I test utilisation of time. I can see into the sketch :

    When time has been received, request update every hour

    Why requesting every hour the datetime to the controller ? Desynchronization ?

    Thanks

    mfalkviddM 1 Reply Last reply
    0
    • F Fl0rian

      Hi,

      Actually I test utilisation of time. I can see into the sketch :

      When time has been received, request update every hour

      Why requesting every hour the datetime to the controller ? Desynchronization ?

      Thanks

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

      @Fl0rian most Arduinos lack a real time clock, and rely on the signal generated by the oscillator. The frequency of the oscillator varies between different chips, supply voltage and temperature, so the Arduino's sense of time will not be exact.

      Due to this inexactness, the TimeAwareSensor example re-synchronizes with the controller once per hour.

      See http://jorisvr.nl/article/arduino-frequency if you want to dig deeper.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Fl0rian
        wrote on last edited by Fl0rian
        #3

        OK thanks for your fast response :)

        Do you know acceptable duration between 2 request ? 1 hour is the max ?

        And when I put in sleep mode the Arduino with 600000ms (sleep(600000)), the real duration is 10m30s and not 10min exactly. It's for the same reason ?

        mfalkviddM 1 Reply Last reply
        0
        • F Fl0rian

          OK thanks for your fast response :)

          Do you know acceptable duration between 2 request ? 1 hour is the max ?

          And when I put in sleep mode the Arduino with 600000ms (sleep(600000)), the real duration is 10m30s and not 10min exactly. It's for the same reason ?

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

          @Fl0rian The maximum depends on how much traffic there is on your network and how fast your controller can reply. You could probably ask at least a few times per second, which is much faster than would be useful anyway.

          Yes, the difference you see in sleep time is due to the same reason.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Fl0rian
            wrote on last edited by
            #5

            OK, so it's not easy to use datetime with node using sleep mode during much hours.
            For example, if I want the node sleeping from 22:00PM to 08:00AM, it doesn't work, or very approximately.

            mfalkviddM 1 Reply Last reply
            0
            • F Fl0rian

              OK, so it's not easy to use datetime with node using sleep mode during much hours.
              For example, if I want the node sleeping from 22:00PM to 08:00AM, it doesn't work, or very approximately.

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

              @Fl0rian exactly.

              To do that you would need a rtc, or use smartsleep, depending on your use case.

              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