automatic command from a program

BTCAD said:
Hi,
 
       I want to set the led1 to on or off from another program. The only thing that is missing is the password and the user in this line :
 
Yes, it's possible and I've posted working examples of this elsewhere on this forum. The protocol already supports what you're trying to do.
 
BTCAD said:
no it didnt work
 
Your total lack of explanation, additional details, symptoms, messages (especially error messages) does you a great dis-service.
Plenty of us "out here" have systems using it every minute of every day without error, so it is certainly POSSIBLE - if you don't mess it up.
I'm guessing you're doing something daft, but we can't see what it is because you've told us exactly NOTHING of any use.
 
try this,and a box will pop up for you to login
 http://192.168.X.X/api/settloutput.cgi?output=1&state=1
 
pittom said:
try this,and a box will pop up for you to login
 http://192.168.X.X/api/settloutput.cgi?output=1&state=1
 
He said he wanted to do it "from a program" not a browser but the problem is he did not say what type of program or what it is running on.  If that program has a way to execute http requests it should have a way to specify an authorization header and it should be in the documentation.
 
When LarsK posted his answer, he probably means http, but somehow typed hxxp.
BTCAD originally asked http, if change the hxxp to http in his program, it probably will work.
LarsK posted from his own program using his choice of programming language, that might require use hxxp instead of http.
 
Since somehow I can not paste on this forum, I would suggest to copy from LarsK's post and change the hxxp to http and try again. 
 
az1324 said:
He said he wanted to do it "from a program" not a browser but the problem is he did not say what type of program or what it is running on.  If that program has a way to execute http requests it should have a way to specify an authorization header and it should be in the documentation.
 
The problem is that we've been given exactly NO information about what's happening.
I intend to solve the problem by saying "Here's proof it works. If it doesn't work on your board, you're doing something wrong. Don't cry in our beer unless you bring more information to the table"
 
 

# cat webcontrol-demo.sh
#! /bin/sh

ip="192.168.1.15"
wget="/usr/local/bin/wget --user=admin --password=password --timeout=1.0 -t1 -O - -q "

echo "Before:"
$wget http://$ip/api/status.xml | grep "<op7"

echo; echo "Set output 7"
$wget "http://$ip/api/setttloutput.cgi?output=7&state=1" >/dev/null
$wget http://$ip/api/status.xml | grep "<op7"

echo; echo "Clear output 7"
$wget "http://$ip/api/setttloutput.cgi?output=7&state=0" >/dev/null
$wget http://$ip/api/status.xml | grep "<op7"
 
and the proof:
 
 

# ./webcontrol-demo.sh
Before:
<op7>0</op7>

Set output 7
<op7>1</op7>

Clear output 7
<op7>0</op7>
 
End of discussion.
 
okay so sorry for my bad, I tought that i was clear enough...
 
 
I use Blue iris, and when a camera is triggered the Blue Iris open IE and go to this adress  http://192.168.X.X/api/settloutput.cgi?output=1&state=1. It supposed to turn on a realy. 
 
But the web page show a pop up box that ask a login. So I asked you if I can add my password and my user into this : http://192.168.X.X/api/settloutput.cgi?output=1&state=1.......  I tried what you said earlier but your solution is not good the good one for my specific task.
 
 
I'm sure it works for you but for me it didn't work. 
 
Nahh... I typed "hxxp" since I wanted to show the link as text.
Old trick used on a lot of forums where linking is not allowed.
I took it for granted that everybody took the xx as tt.
My mistake. :pray:
 
LarsK said:
Nahh... I typed "hxxp" since I wanted to show the link as text.
Old trick used on a lot of forums where linking is not allowed.
I took it for granted that everybody took the xx as tt.
My mistake. :pray:
 
the typo was a missing t in setttloutput
 
And the string "/api/settloutput.cgi?output=1&state=1" was pasted from the first posting from BTCAD.
 
Back
Top