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. Development
  3. smartSleep possible bug and/or missing documentation (2.2.0)

smartSleep possible bug and/or missing documentation (2.2.0)

Scheduled Pinned Locked Moved Development
3 Posts 2 Posters 927 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.
  • M Offline
    M Offline
    mogul
    wrote on last edited by
    #1

    I am putting my node to sleep with smartSleep to let the controller request the node to redo its presentation.
    While experimenting I set the MY_SMART_SLEEP_WAIT_DURATION_MS to 2000 to let me fire the request by hand.
    I notice that the time smartSleep(5000) sleeps seems to be the value given plus the 2000, which totals at 7 seconds, and not the 5 seconds I expected. Is this a bug or have I misunderstood something?

    Second, looking at the communication on the other side of my ESP8266 based MQTT gateway I see the heartbeats as

    mygateway1-out/121/255/3/0/33 5000
    mygateway1-out/121/255/3/0/32 2000
    

    decoding the MQTT topic using https://www.mysensors.org/download/serial_api_2 I get:
    cmd 3 : Internal
    but the internal command table ends with number 28, not covering 32 and 33 I got.
    Anywhere else I should lookup those?

    mfalkviddM 1 Reply Last reply
    0
    • M mogul

      I am putting my node to sleep with smartSleep to let the controller request the node to redo its presentation.
      While experimenting I set the MY_SMART_SLEEP_WAIT_DURATION_MS to 2000 to let me fire the request by hand.
      I notice that the time smartSleep(5000) sleeps seems to be the value given plus the 2000, which totals at 7 seconds, and not the 5 seconds I expected. Is this a bug or have I misunderstood something?

      Second, looking at the communication on the other side of my ESP8266 based MQTT gateway I see the heartbeats as

      mygateway1-out/121/255/3/0/33 5000
      mygateway1-out/121/255/3/0/32 2000
      

      decoding the MQTT topic using https://www.mysensors.org/download/serial_api_2 I get:
      cmd 3 : Internal
      but the internal command table ends with number 28, not covering 32 and 33 I got.
      Anywhere else I should lookup those?

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

      @mogul

      #define 	MY_SMART_SLEEP_WAIT_DURATION_MS   (500ul)
      The wait period (in ms) before going to sleep when using smartSleep-functions.
      

      frrom https://www.mysensors.org/apidocs/group__SleepSettingGrpPub.html#gaf353bf3627ebd8f15e200b320e2e065d (I know we're not very good at advertising this documentation)

      If you set this to 2000, the node will wait 2 seconds before going to sleep, and then sleep for the amount if time you have requested, so the total time will be the sum.

      1 Reply Last reply
      0
      • mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by
        #3

        The internal commands can be found at https://github.com/mysensors/MySensors/blob/development/core/MyMessage.h#L165

        We should probably update the api page.

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        21

        Online

        12.1k

        Users

        11.2k

        Topics

        113.4k

        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