0

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 don't have proper motion experience (not for years), but both A) and C) look feasible to me. I think the easiest way to figure it out would be to try! – Fred Mar 7 '14 at 8:00
0

I gave up trying to control motion using the software interface and wrote a rough script:

script to control motion using cron

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.