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 734 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
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        19

        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