Motion - Feature Request 2009x 07x 20x 100425

Feature Request: Simple Value request

Description

I'm missing an easy way to get current values of the settings.

In the earlyer versions I could do a query and simply strip the html tags but that is now broken ( http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2009x06x24x230604 )

If asking for detections status everything is allright, but config settings is now a days filled with a lot of, for the request, unusable stuff.

Maybe a configure setting would be the best solution, tex. --enable-simpleweb.

The help in the interface is, i would think, only used while setting up a system. when the system is set up alle the help code is only making motion bigger than needed. The configure option could help keeping the resources needed by the running motion to the minimum.

A simple way to request a value and getting only that is what i need, how to do it i'll let the developers figure out. smile

Best Regards, Klaus

-- TheOtherBug - 20 Jul 2009

Follow up

Comments

Here an example of a php script used to set/get the timelapse value, now broke by the extra output from the query:

#!/usr/bin/php -q
<?php
$srv = 'motion:password@127.0.0.1';
$cp = '8080';
ob_implicit_flush(true);
if(!$reply = @file_get_contents("http://$srv:$cp"))die("Could not connect! - is motion running ?\n");
if(sizeof($argv) < 2)die('Usage: '.substr(strrchr(trim($argv[0]),"/"),1).' <query | set Timelapse interval in Sec. 0-3600>'."\n");
$funkt = $argv[1];
if(is_numeric($funkt) && ($funkt <= 3600))
 file_get_contents("http://$srv:$cp/0/config/set?ffmpeg_timelapse=$funkt");
echo substr(strrchr(trim(strip_tags(@file_get_contents("http://$srv:$cp/0/config/get?query=ffmpeg_timelapse"))),' '),1)."\n";
exit;
?> 
/Klaus

-- TheOtherBug - 20 Jul 2009

- Maybe this can help : http://www.lavrsen.dk/foswiki/bin/view/Motion/SupportQuestion2009x04x12x141907

-- FlorinAnton - 20 Jul 2009


Thanks Anton

But no it's not the config values i need to retriewe, it's the current running values, i find it fair to request some way to get it without to much fiddle around.

I have over the eyears made some .php and .sh scripts used to control motion, more of these got broke by the extra output in the later version of the webgui.

tex. the script above used to output only the value of the ffmpeg_timelapse, now it just shows 'second'. frown, sad smile The script is used by a cron calculating sunrise/set and ajust the timelapse interval so the value is 150 in daylight and 1200 at night. The above script still works setting the value, but i can not get the actual setting.

Ofcurse i could find out where the needed value is in the query result and change my scripts to handle that, but that change only lasts to the helptext for some reason get changed.

I think there should be a way to get a simple answer replyed to a get value request, as it used to be - actually i need it much. smile

/Klaus

-- TheOtherBug - 20 Jul 2009
Topic revision: r3 - 20 Jul 2009, TheOtherBug
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.