Go Down

Topic: OT: ip-cam HTML <FORM> (Read 1 time) previous topic - next topic

amjx

Hi all

I have an Elro C903IP ip-cam and it works fine, but it looks like most of the functions you can control from the user interface (flip, mirror, resolution, brightness and other) only works under Windows/ActiveX.

But I can send commands to the cam from the address bar in my browser that I can not find in the user interface after I heve logged in, even as admin.
For example the "command" http://ipaddress/get_status.cgi produces the following response:

Code: [Select]
var id='1234567890AB'; (redacted)
var sys_ver='1.2.3.4'; (redacted)
var app_ver='1.2.3.4'; (redacted)
var alias='';
var now=7009;
var tz=-7200;
var alarm_status=0;
var ddns_status=42;
var ddns_host='/vipddns/upgengxin.asp';
var oray_type=0;
var upnp_status=1;
var p2p_status=0;
var p2p_local_port=12345; (redacted)
var msn_status=0;
var wifi_status=0;
var temperature=0.0;
var humidity=0;
var tridro_error='';


And I have found a nice sheet with lots of commands - thank you google. So now im working on making a html page with the commands/controls on it.

In the sheet it says the i can change the resolution (parameter 0) betveen 320x240 (value 8 ) and 640x480 (value 32) by sending the "command" http://ipaddress/camera_control.cgi?param=&value= so I made a form that I thought would work but it does not.

Code: [Select]
<form name="res" action="http://192.168.1.77/camera_control.cgi?param=0&value=" method="post">
<input type="radio" value="8"> Low res.<br>
<input type="radio" value="32"> Hi res. <br>
<input type="submit" value="Submit">
</form>



How do I get the form to change the value to what I want it to be and send it to the cam? I have tried to give the two radio buttons manes and then vriting the name in the url in the form like http://ipaddress/camera_control.cgi?param=0&value=VAR

I know it works if i type it in like:
http://ipaddress/camera_control.cgi?param=0&value=8
http://ipaddress/camera_control.cgi?param=0&value=32

Any ideas are greatly apreciated
amjx

ps. Here is the complete html file as it looks like now (including 1 embedded video and 3 links that has little to do with the form)
Code: [Select]
<html>
<head>
<title>test</title>
</head>
<body>
<a href="http://192.168.1.77/index.htm">Index</a> Go to cam main/login page.<br>
<a href="http://192.168.1.77/get_status.cgi">Status</a> Get cam status.<br>
<a href="http://192.168.1.77/get_camera_params.cgi?user=myUsername&pwd=myPassword">Params</a> Get cam params.<br><br>

<embed src="http://192.168.1.77/videostream.cgi?resolution=8&rate=13" width="360" height="240"><br>

<form name="res" action="http://192.168.1.77/camera_control.cgi?param=&value=" method="post">
<input type="radio" value="8"> Low res.<br>
<input type="radio" value="32"> Hi res. <br>
<input type="submit" value="Submit">
</form>

</body>
</html>

cr0sh

Change in the form variable:

method="post"

to

method="get"

Try that first...
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

amjx

Get instead of post gets the same result.

I have also tried with javascript that opens a new window and sends the command and it does not work either.

But it works if i type the commands in the browsers address bar,,, i dont get it.... Back to reading :)

cr0sh


Get instead of post gets the same result.


Weird - I would've expected it to work. Have you tried firing the commands at it using CURL?
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

amjx

#4
Jun 09, 2013, 11:37 pm Last Edit: Jun 09, 2013, 11:38 pm by amjx Reason: 1


Get instead of post gets the same result.


Weird - I would've expected it to work. Have you tried firing the commands at it using CURL?


You are probably right. I think im some how messing things up and only sending the value instead of both the parameter and the value. So maybe it fails with both post and get.

I have not tried CURL but i will have to check it out.

But right now im seeing code and urls all over so i think i have to look in to this again tomorrow :)

amjx

It was suppose to be get, and the parameter was missing.
Here is the code that works:
Code: [Select]
<form name="change_res" action="http://192.168.1.77/camera_control.cgi?param=&value=" method="get">
<input type="hidden" name="param" value="resolution" />
<input type="radio" name="value" value="8" /> Low res<br/>
<input type="radio" name="value" value="32" /> Hi res<br/>
<input type="submit" value="Submit" />
</form>


Thanks for guiding me in the right direction :)

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy