-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: option to automatically power off radio after inactivity #3414
Conversation
Maybe add on/off and then a configurable timer? |
Yes I agree the user interface would be better with with an on/off switch first and then the timer shown only if the feature is switched on, rather than just using 0 for "off". It would also be better if the option were next to the "Inactivity Alarm" setting, but that is currently under "Alarms" so not the logical place to look for a shutdown function. |
Hi @elecpower - have added some support in companion for this setting. The Windows-64 companion build workflow seems to have an issue around generate_datacopy.py / datacopy.inc but I don't think that's related to these changes.... |
Is ON/OFF check box added instead of minutes? |
Hi @Eldenroot, I guess we would need an ON/OFF checkbox and then the number of minutes if ON. It's not in the code now, if you are interested I can try it that way and see how it looks then. Will get back to you on that. If using a toggle, one question would then be why the inactivity alarm does not work in the same way (i.e. also have an ON/OFF toggle) as they are very similar functions. It could also be done that way of course. Perhaps I should rebase this now as well as there seem to be some conflicts. So I don't know if this feature is on any road map or has sufficient interest to be included, I just know that I find it useful (and regularly use it) and it has been requested at least once in the past. But of course that might not be enough, maybe most people do manage to switch their transmitters off :-). For me the TX16S just somehow looks like it's off most of the when the LCD is off. I've left it on a few times and moved away from it, not hearing the inactivity alarm, and I'd actually rather not have to manually switch it off a lot of the time when it can just do that itself. Paul |
Interest, definitely. And will probably be something to be included 2.10. Will just want to expand it to all radios, not just the TX16S. I wouldn't worry about rebasing it for a week or so (unless you want to), as I think there are some more PRs to go that will most likely cause minor conflicts (because they'll also be touching datastructs to save their own options). As far as a checkbox that controls the edit field, that makes sense, and for sure the inactivity timer could be done the same way (for consistency). |
Hi Peter, Ah OK, sounds good :-). I will update it in in a few days then and include the checkbox. Applying to all radios with a push button switch seems like an excellent idea. I only have the TX16S to test myself hence tried not to change anything else. However, it's pretty simple and should only need a few checks on other radios to get this right. Paul |
I assume this is to prevent draining radio's battery (particulary LiPo that can be destroyed once below 3.0V) |
That will add some complexity to an otherwise simple feature, but is something that should be considered as there is time to flesh this out. At present it is linked to transmitter inactivity - i.e. if idle for more than x time, and no telemetry, it's safe to turn off (if configured to do so). If it was linked to voltage, I would probably want a "battery critical" option in addition to the "battery low" audio/haptic warning we currently have (and must be set lower), so you get the nags about the battery voltage for a while before it would be allowed to also optionally shut off on a critical voltage level. i.e. I would expect something like the following (note I would allow critical voltage to trigger poweroff in the case of USB as you don't usually fly with USB connected - and if you do !? - don't turn the option on).
|
That's what I thought of. Killed radio lipo lastly. Finished dev late and forgot to switch off tx16s while volume was down not to disturb me while in dev mode :) |
Yeah, for dev work, unless you're on the move, running from battery is not a good idea. Better to have a power supply and then it doesn't matter how long you leave it turned on for 😆 |
Agree that battery voltage related options are possible enhancements here. Wanting this to happen based on battery voltage and wanting it to happen based on time are two different things though which would suit different people or different usage scenarios. Personally I like to use a prompt time-based shutdown to save as much power as possible (say after max 10 mins of inactivity). If I'm out flying I usually leave the TX on after a flight (waiting for others to fly perhaps) but of course without any models powered. Then if I don't get back to flying promptly or am talking to someone else or whatever, I just prefer it to take care of itself. And, yes I have left it on whilst working on things at home as well just by mistake! Luckily never taken it out to the field flat though.... |
Have rebased the code here since it was 900 odd commits behind with some conflicts. Still the same tx16s specific patch in this commit. The padding in the yaml generation is not quite right in this version though. To be corrected shortly. |
Just a thought reading this, should trainer not be checked too ? (Can't remember if traîner affect inactivity timer) |
@3djc, good point regarding the trainer, I will have a look at that.... |
Latest commit expands to all radios as mentioned by @pfeerick above. Still the simplest interface here, 0-255 mins shown. Main lack of clarity being what 0 means. Just replacing the 0 with "off" is one way to improve but many options with a GUI as always. |
@pault4r sorry for being late to the party: how does this interact with the regular inactivity timer? |
Hi @raphaelcoeffic, it is based on the regular inactivity timer (read only - no adjustment made to the timer). The user could have the inactivity alarm first and then automatic power off some time after that by using both features. Or have a silent power off. There are additional checks beyond the inactivity timer but the timer is the main thing. |
This is the same change as before, just rebased and with the commits organized in a clearer way |
781189a
to
c27c5a8
Compare
c27c5a8
to
2a93c79
Compare
2a93c79
to
1b22de1
Compare
1b22de1
to
14209fc
Compare
14209fc
to
812f0e0
Compare
power off radio after inactivity. String is added in English in translation files as a placeholder. Merge branch 'main_poweroff_2' into rebase_6
set the number of minutes of inactivity before an automatic power off. A value of zero will disable the feature.
pwrOffIfInactive
will control the inactivity based automatic power off.
These are the c++ changes, changes to the .ui file will be committed separatly as the .ui file has a greater potential for conflicts.
812f0e0
to
0ea3f53
Compare
This has been working well for some time now on TX16S, T12MAX and X9D+2019. Some future improvements could be (mostly UI):
|
An implementation of feature request #789 for the TX16S (see also opentx issue #6421). [Note - now expanded to all radios with power buttons, see below]
Radio will automatically shutdown after a configurable number of minutes of inactivity. Option is shown on the main "Radio Setup" screen with zero minutes used to disable the feature. Shutdown will not take place if telemetry is present or if the radio is connected via USB.
I like this as it is on my radio but it might need a little more thought and development if you guys have any interest in pulling this into your repo for general use. Happy to look at it further if that is the case.
Paul