most users are not using the phone app now, don't enter SDS state because of no phone comms

This commit is contained in:
geeksville 2020-03-04 18:59:10 -08:00
parent 651b13b3e5
commit c66e24aa4d
3 changed files with 6 additions and 4 deletions

View File

@ -53,7 +53,8 @@ off during light sleep, but there is a TODO item to fix this.
* While in ON: If it has been more than screen_on_secs since a press, lower to DARK
* While in DARK: If time since last contact by our phone exceeds phone_timeout_secs (15 minutes), we transition down into NB mode
* While in DARK or NB: If nothing above is forcing us to stay in a higher mode (wait_bluetooth_secs, min_wake_secs) we will lower down to LS state
* While in LS: If either phone_sds_timeout_secs (default 2 hr) or mesh_sds_timeout_secs (default 2 hr) are exceeded we will lower into SDS mode for sds_secs (default 1 yr) (or a button press).
* While in LS: If either phone_sds_timeout_secs (default 2 hr) or mesh_sds_timeout_secs (default 2 hr) are exceeded we will lower into SDS mode for sds_secs (default 1 yr) (or a button press). (Note: phone_sds_timeout_secs is currently disabled for now, because most users
are using without a phone)
* Any time we enter LS mode: We stay in that until an interrupt, button press or other state transition. Every ls_secs (default 1 hr) and let the arduino loop() run one iteration (FIXME, not sure if we need this at all), and then immediately reenter lightsleep mode on the CPU.
TODO: Eventually these scheduled intervals should be synchronized to the GPS clock, so that we can consider leaving the lora receiver off to save even more power.

View File

@ -5,5 +5,5 @@ release. It is used by the android app for forcing software updates. Do not ed
Generated by bin/buildall.sh -->
<resources>
<string name="cur_firmware_version">0.0.9</string>
<string name="cur_firmware_version">0.1.0</string>
</resources>

View File

@ -26,7 +26,7 @@ static void sdsEnter()
static void lsEnter()
{
screen.setOn(false);
while (!service.radio.rf95.canSleep())
delay(10); // Kinda yucky - wait until radio says say we can shutdown (finished in process sends/receives)
@ -158,7 +158,8 @@ void PowerFSM_setup()
powerFSM.add_timed_transition(&stateDARK, &stateLS, radioConfig.preferences.wait_bluetooth_secs * 1000, NULL, "Bluetooth timeout");
powerFSM.add_timed_transition(&stateLS, &stateSDS, radioConfig.preferences.mesh_sds_timeout_secs * 1000, NULL, "mesh timeout");
powerFSM.add_timed_transition(&stateLS, &stateSDS, radioConfig.preferences.phone_sds_timeout_sec * 1000, NULL, "phone timeout");
// removing for now, because some users don't even have phones
// powerFSM.add_timed_transition(&stateLS, &stateSDS, radioConfig.preferences.phone_sds_timeout_sec * 1000, NULL, "phone timeout");
powerFSM.run_machine(); // run one interation of the state machine, so we run our on enter tasks for the initial DARK state
}