Skip to main content
added 772 characters in body
Source Link
reggie
  • 1.1k
  • 4
  • 14
  • 30

I have Motion installed on my PI and having difficulty trying to control the threshold via the command line.

Motion's wiki suggests that this type of control can be done using cron like this:

0`0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/nullnull`

So i tried this on the command line:

 /usr/bin/wget http://localhost:8091/0/config/set?threshold=4000 > /dev/null

and goth this:

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

I tried this on my laptop's browser connected to the same network:

  http://192.168.1.51:8091/0/config/set?threshold=2000&username=myusername&password=mypassword

and it appeared to work without having to enter my username and password manually.

so i then tried on the command line:

sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000&username=myusername&password=mypassword >/dev/null

and got :

Connecting to 192.168.1.51:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

[1]-  Exit 6                  sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000
[2]+  Done                    username=myusername
  1. Did this not work because of having control_authentication set up?

  2. Is it possible to control motion in this way with authentication set up if so how?

  3. Am I approaching this in the correct way?

I have Motion installed on my PI and having difficulty trying to control the threshold via the command line.

Motion's wiki suggests that this type of control can be done using cron like this:

0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null

So i tried this on the command line:

 /usr/bin/wget http://localhost:8091/0/config/set?threshold=4000 > /dev/null

and goth this:

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

I tried this on my laptop's browser connected to the same network:

  http://192.168.1.51:8091/0/config/set?threshold=2000&username=myusername&password=mypassword

and it appeared to work without having to enter my username and password manually.

so i then tried on the command line:

sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000&username=myusername&password=mypassword >/dev/null

and got :

Connecting to 192.168.1.51:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

[1]-  Exit 6                  sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000
[2]+  Done                    username=myusername
  1. Did this not work because of having control_authentication set up?

  2. Is it possible to control motion in this way with authentication set up if so how?

  3. Am I approaching this in the correct way?

I have Motion installed on my PI and having difficulty trying to control the threshold via the command line.

Motion's wiki suggests that this type of control can be done using cron like this:

`0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null`

So i tried this on the command line:

 /usr/bin/wget http://localhost:8091/0/config/set?threshold=4000 > /dev/null

and goth this:

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

I tried this on my laptop's browser connected to the same network:

  http://192.168.1.51:8091/0/config/set?threshold=2000&username=myusername&password=mypassword

and it appeared to work without having to enter my username and password manually.

so i then tried on the command line:

sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000&username=myusername&password=mypassword >/dev/null

and got :

Connecting to 192.168.1.51:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

[1]-  Exit 6                  sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000
[2]+  Done                    username=myusername
  1. Did this not work because of having control_authentication set up?

  2. Is it possible to control motion in this way with authentication set up if so how?

  3. Am I approaching this in the correct way?

added 772 characters in body
Source Link
reggie
  • 1.1k
  • 4
  • 14
  • 30

I have Motion installed on my PI and having difficulty trying to control the threshold via the command line.

Motion's wiki suggests that this type of control can be done using cron like this:

0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null

So i tried this on the command line:

 /usr/bin/wget http://localhost:8091/0/config/set?threshold=4000 > /dev/null

and goth this:

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

I tried this on my laptop's browser connected to the same network:

  http://192.168.1.51:8091/0/config/set?threshold=2000&username=myusername&password=mypassword

and it appeared to work without having to enter my username and password manually.

so i then tried on the command line:

sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000&username=myusername&password=mypassword >/dev/null

and got :

Connecting to 192.168.1.51:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

[1]-  Exit 6                  sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000
[2]+  Done                    username=myusername
  1. Did this not work because of having control_authentication set up?

  2. Is it possible to control motion in this way with authentication set up if so how?

  3. Am I approaching this in the correct way?

I have Motion installed on my PI and having difficulty trying to control the threshold via the command line.

Motion's wiki suggests that this type of control can be done using cron like this:

0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null

So i tried this on the command line:

 /usr/bin/wget http://localhost:8091/0/config/set?threshold=4000 > /dev/null

and goth this:

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.
  1. Did this not work because of having control_authentication set up?

  2. Is it possible to control motion in this way with authentication set up if so how?

  3. Am I approaching this in the correct way?

I have Motion installed on my PI and having difficulty trying to control the threshold via the command line.

Motion's wiki suggests that this type of control can be done using cron like this:

0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null

So i tried this on the command line:

 /usr/bin/wget http://localhost:8091/0/config/set?threshold=4000 > /dev/null

and goth this:

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

I tried this on my laptop's browser connected to the same network:

  http://192.168.1.51:8091/0/config/set?threshold=2000&username=myusername&password=mypassword

and it appeared to work without having to enter my username and password manually.

so i then tried on the command line:

sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000&username=myusername&password=mypassword >/dev/null

and got :

Connecting to 192.168.1.51:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

[1]-  Exit 6                  sudo /usr/bin/wget http://192.168.1.51:8091/0/config/set?threshold=4000
[2]+  Done                    username=myusername
  1. Did this not work because of having control_authentication set up?

  2. Is it possible to control motion in this way with authentication set up if so how?

  3. Am I approaching this in the correct way?

deleted 725 characters in body
Source Link
reggie
  • 1.1k
  • 4
  • 14
  • 30

I have motionMotion installed on my pi,PI and wondered if it was possible to write a python script to change the detection sensitivityhaving difficulty trying to different values for day and night?

The value i'm interested in is called threshold in the motion.conf file.

Would I:

A) editcontrol the motion.conf file, save it and restart motion

B) sendthreshold via the Motion mmaltest a command somehow, maybe passing parameters and getting past the authentication automaticallyline.

c) control motion start via cron which iv'e seenMotion's herewiki suggests that this type of control can be done using cron like this:

0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null

so wouldSo i tried this work for threshold threshold inon the cron?command line:

0 9 * * * root /usr/bin/lwp-requestwget http://localhost:80808091/0/config/set?thresholdthreshold=4000 1000> /dev/null

----------------------------------------------------------------------------edit below

I tried this:

http://localhost:8091/0/config/set?threshold=4000 from the command line and i getgoth this:

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

How can i include the username and password in the query string? Iv'e tried:

/usr/bin/wget http:/usr/bin/wget http://localhost:8091/0/config/set?threshold=4000&username=myun&password=mypw

but that didn't work.

but i can plug this:

the_pi_ip_address:8091/0/config/set?threshold=4000

into my browser with the username and password saved and it changes the threshold on my PI.

  1. Did this not work because of having control_authentication set up?

  2. Is it possible to control motion in this way with authentication set up if so how?

  3. Am I approaching this in the correct way?

I have motion installed on my pi, and wondered if it was possible to write a python script to change the detection sensitivity to different values for day and night?

The value i'm interested in is called threshold in the motion.conf file.

Would I:

A) edit the motion.conf file, save it and restart motion

B) send the Motion mmaltest a command somehow, maybe passing parameters and getting past the authentication automatically

c) control motion start via cron which iv'e seen here

0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null

so would this work for threshold threshold in the cron?

0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/config/set?threshold 1000

----------------------------------------------------------------------------edit below

I tried this:

http://localhost:8091/0/config/set?threshold=4000 from the command line and i get:

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

How can i include the username and password in the query string? Iv'e tried:

/usr/bin/wget http:/usr/bin/wget http://localhost:8091/0/config/set?threshold=4000&username=myun&password=mypw

but that didn't work.

but i can plug this:

the_pi_ip_address:8091/0/config/set?threshold=4000

into my browser with the username and password saved and it changes the threshold on my PI.

I have Motion installed on my PI and having difficulty trying to control the threshold via the command line.

Motion's wiki suggests that this type of control can be done using cron like this:

0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null

So i tried this on the command line:

 /usr/bin/wget http://localhost:8091/0/config/set?threshold=4000 > /dev/null

and goth this:

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.
  1. Did this not work because of having control_authentication set up?

  2. Is it possible to control motion in this way with authentication set up if so how?

  3. Am I approaching this in the correct way?

deleted 2 characters in body
Source Link
reggie
  • 1.1k
  • 4
  • 14
  • 30
Loading
deleted 2 characters in body
Source Link
reggie
  • 1.1k
  • 4
  • 14
  • 30
Loading
added 3 characters in body
Source Link
reggie
  • 1.1k
  • 4
  • 14
  • 30
Loading
added 159 characters in body
Source Link
reggie
  • 1.1k
  • 4
  • 14
  • 30
Loading
added 488 characters in body
Source Link
reggie
  • 1.1k
  • 4
  • 14
  • 30
Loading
Source Link
reggie
  • 1.1k
  • 4
  • 14
  • 30
Loading