diff --git a/doc/motionplus_config.html b/doc/motionplus_config.html
index 282cda6..9cb61b2 100644
--- a/doc/motionplus_config.html
+++ b/doc/motionplus_config.html
@@ -1297,6 +1297,14 @@
netcam_params
+
+ interrupt
+ The duration in seconds permitted for reading an image from the netcam source. For the initial connection
+ to the camera, the maximum duration is set equal to three times the interrupt specified. The default
+ number of seconds is 20.
+
+
+
params_file
diff --git a/src/netcam.cpp b/src/netcam.cpp
index e281d01..907d77b 100644
--- a/src/netcam.cpp
+++ b/src/netcam.cpp
@@ -1340,7 +1340,7 @@ int cls_netcam::read_image()
interrupted=false;
clock_gettime(CLOCK_MONOTONIC, &ist_tm);
- idur = 10;
+ idur = cfg_idur;
status = NETCAM_READINGIMAGE;
img_recv->used = 0;
@@ -1543,8 +1543,6 @@ void cls_netcam::set_options()
std::to_string(cfg_height);
util_parms_add_default(params,"video_size", tmp);
- idur = 55;
-
} else if (service == "file") {
MOTPLS_LOG(INF, TYPE_NETCAM, NO_ERRNO
,_("%s:Setting up movie file")
@@ -1689,6 +1687,7 @@ void cls_netcam::set_parms ()
filenbr = 0;
filelist.clear();
filedir = "";
+ cfg_idur = 20;
for (it = params->params_array.begin();
it != params->params_array.end(); it++) {
@@ -1702,6 +1701,9 @@ void cls_netcam::set_parms ()
capture_rate = mtoi(it->param_value);
}
}
+ if (it->param_name == "interrupt") {
+ cfg_idur = mtoi(it->param_value);
+ }
}
/* If this is the norm and we have a highres, then disable passthru on the norm */
@@ -1720,7 +1722,6 @@ void cls_netcam::set_parms ()
clock_gettime(CLOCK_MONOTONIC, &ist_tm);
clock_gettime(CLOCK_MONOTONIC, &icur_tm);
- idur = 5;
interrupted = false;
set_path();
@@ -1784,7 +1785,7 @@ int cls_netcam::open_context()
clock_gettime(CLOCK_MONOTONIC, &ist_tm);
- idur = 20;
+ idur = cfg_idur * 3; /*3 is arbritrary multiplier to give connect more time than other steps*/
set_options();
diff --git a/src/netcam.hpp b/src/netcam.hpp
index c5b1058..7c1630b 100644
--- a/src/netcam.hpp
+++ b/src/netcam.hpp
@@ -154,6 +154,7 @@ class cls_netcam {
int cfg_width;
int cfg_height;
int cfg_framerate;
+ int cfg_idur;
std::string cfg_params;
std::vector filelist;