smartSleep possible bug and/or missing documentation (2.2.0)
mogul last edited by
I am putting my node to sleep with
smartSleepto let the controller request the node to redo its presentation.
While experimenting I set the
MY_SMART_SLEEP_WAIT_DURATION_MSto 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?
#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.
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.