From ef325289eba875e6469e0accdd34b2e0b70f7cbd Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Mon, 12 Oct 2020 11:09:53 +0800 Subject: [PATCH 1/4] fix a doc error --- docs/software/device-api.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/software/device-api.md b/docs/software/device-api.md index 30a43213..031b586a 100644 --- a/docs/software/device-api.md +++ b/docs/software/device-api.md @@ -42,7 +42,6 @@ Expected sequence for initial download: - Read a RadioConfig from "radio" - used to get the channel and radio settings - Read a User from "user" - to get the username for this node - Read a MyNodeInfo from "mynode" to get information about this local device -- Write an empty record to "nodeinfo" to restart the nodeinfo reading state machine - Read a series of NodeInfo packets to build the phone's copy of the current NodeDB for the mesh - Read a endConfig packet that indicates that the entire state you need has been sent. - Read a series of MeshPackets until it returns empty to get any messages that arrived for this node while the phone was away From 5457541244cf1e1f5435fb2e2b6ee82e4ab88ef2 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Wed, 14 Oct 2020 08:45:29 +0800 Subject: [PATCH 2/4] fix #477: sleep behavior was broken in app due to device bug since 1.1.1 + // NOTE: The phone app needs to know the ls_secs value so it can properly expect sleep behavior. + // So even if we internally use 0 to represent 'use default' we still need to send the value we are + // using to the app (so that even old phone apps work with new device loads). --- src/mesh/PhoneAPI.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 9a3215af..c3ae6930 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -121,7 +121,14 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) case STATE_SEND_RADIO: fromRadioScratch.which_variant = FromRadio_radio_tag; + fromRadioScratch.variant.radio = radioConfig; + + // NOTE: The phone app needs to know the ls_secs value so it can properly expect sleep behavior. + // So even if we internally use 0 to represent 'use default' we still need to send the value we are + // using to the app (so that even old phone apps work with new device loads). + fromRadioScratch.variant.radio.preferences.ls_secs = getPref_ls_secs(); + state = STATE_SEND_NODEINFO; break; From 1ebd7b0c3e36869064a1ed9c6ef1f46c0bc3b213 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Wed, 14 Oct 2020 08:53:12 +0800 Subject: [PATCH 3/4] make lightsleep default time 5 minutes, with 1 minute in for BLE syncing --- src/mesh/NodeDB.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 20dc47cf..c98e050d 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -144,11 +144,18 @@ const char *getChannelName(); PREF_GET(send_owner_interval, 4) PREF_GET(position_broadcast_secs, 15 * 60) -PREF_GET(wait_bluetooth_secs, 120) + +// Each time we wake into the DARK state allow 1 minute to send and receive BLE packets to the phone +PREF_GET(wait_bluetooth_secs, 60) + PREF_GET(screen_on_secs, 60) PREF_GET(mesh_sds_timeout_secs, 2 * 60 * 60) PREF_GET(phone_sds_timeout_sec, 2 * 60 * 60) PREF_GET(sds_secs, 365 * 24 * 60 * 60) -PREF_GET(ls_secs, 60 * 60) + +// We default to sleeping (with bluetooth off for 5 minutes at a time). This seems to be a good tradeoff between +// latency for the user sending messages and power savings because of not having to run (expensive) ESP32 bluetooth +PREF_GET(ls_secs, 5 * 60) + PREF_GET(phone_timeout_secs, 15 * 60) PREF_GET(min_wake_secs, 10) From b41a32c6b68ec43b6cab122bd01a9c434a562969 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Wed, 14 Oct 2020 09:04:20 +0800 Subject: [PATCH 4/4] 1.1.5 --- bin/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/version.sh b/bin/version.sh index ef346111..ecc6ad74 100644 --- a/bin/version.sh +++ b/bin/version.sh @@ -1,3 +1,3 @@ -export VERSION=1.1.4 \ No newline at end of file +export VERSION=1.1.5 \ No newline at end of file