-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Status not printed #308
Comments
Have you tried the actual battery command? The printing of battery status is for the long running commands like rtsp and mqtt not the one off ones like image. The idea being to not pollute the stdout with extra information not related to the command asked to perform. |
For short commands like image your expected to run battery command for status when you want it |
Okay, so that is definitely a change as it used to report that with images. And it appears that I cannot use both battery and image commands at the same time. This feels like a bad change to me. My use case is that I am capturing an image from my cameras every minute and superimpose on top of the image the current battery/temperature, like below image. Now the problem is that if it is separate command, each takes about 15 seconds to complete... which doubles the queries to the cameras. And surely that is going to be bad for battery life? My cameras are mounted to light posts, and get power to recharge each night for about 6 hours, then have to run 18 hours on battery... but if temperatures go below zero, then the battery does not charge. So I like to monitor this on my surveillance page (which updates once a minute). Can we either put it back to always report the status, or add an option to other commands? Thanks |
The config file allows for |
I believe it was in #54 (which was quite some time ago) where it was first changed. There are a few commands that print their information as xml into the stdout. It did not seem good practice to pollute any command's output with battery status in this way since it's unpredictable how it will change the output (before or after for example). I consider the old behaviour an unintended effect since I never planned for both of them to be printed I prefer proper separation of concerns for the commands. Perhaps if you want the same behaviour as before again you could consider adding it as an optional command line argument? I'll accept a PR along those lines to make it a proper controllable feature. |
Is this the commit that removed it, or should I be looking elsewhere? 17e8ab0 |
Answering my own question... yes. If I add back in the deletes from that commit, I get the battery status back. Now to think about how I make it an option. |
Try looking at #[arg(short, long, global = true, value_parser = PathBuf::from_str)]
pub config: Option<PathBuf>, maybe something like #[arg(short, long, global = true, action)]
pub battery_info: bool, |
Thanks for the pointer. I'm not familiar with rust so I ran into problems with adding a cmdline flag but got it working by adding a option to config.toml... #[serde(default = "default_false", alias = "battery", alias = "battery_info")]
pub(crate) print_battery_info: bool, and if options.print_battery_info {
if let Err(e) = me.monitor_battery(options.aux_printing).await {
warn!("Could not monitor battery: {:?}", e);
}
} The problem I ran into with adding a command line flag is that the global cmdline variable is declared in I'm not familiar enough with Rush so apologies if this is a really basic. Thanks. |
I see. Well the more direct method. Would be to add the option on to the commands flags for example |
Describe the bug
I have
print_format = "Xml"
in my toml file but nothing is printing out to stdout. I tried Human as well and it also fails. This used to work so something seems to have changed.To Reproduce
config file...
Command...
~/github/neolink/target/release/neolink image --use-stream --config=/home/david/neolink.toml --file-path=/home/david/image.jpeg camera
Expected behavior
It should report status including battery level and temperature.
Output
The text was updated successfully, but these errors were encountered: