Page 1 of 1

http version problem

Posted: Fri Sep 21, 2007 5:04 pm
by alau
I installed a rpm base zoneminder 1.22 in a FC6 system. When I try to connect to a network camera (Arecont Vision) the camera always return a http 1.0 version not supported. I checked the setting of http version in the option section of ZM, http 1.1 was checked.
Does anyone know what's the problem?

Here is the tcpdump data
09:51:07.069557 IP 192.168.1.100.50312 > 192.168.1.11.http: P 1:164(163) ack 1 win 5840
0x0000: 4500 00cb 0914 4000 4006 ad59 c0a8 0164 E.....@.@..Y...d
0x0010: c0a8 010b c488 0050 2fdf 2b71 2679 771d .......P/.+q&yw.
0x0020: 5018 16d0 27e3 0000 4745 5420 2f47 4554 P...'...GET
0x0030: 2e2f 696d 6167 653f 7265 733d 6675 6c6c ./image?res=full
0x0040: 2678 303d 3025 2679 303d 3025 2678 313d &x0=0%&y0=0%&x1=
0x0050: 3130 3025 2679 313d 3130 3025 2671 7561 100%&y1=100%&qua
0x0060: 6c69 7479 3d31 3526 646f 7562 6c65 7363 lity=15&doublesc
0x0070: 616e 3d30 2048 5454 502f 312e 300a 5573 an=0.HTTP/1.0.Us
0x0080: 6572 2d41 6765 6e74 3a20 5a6f 6e65 4d69 er-Agent:.ZoneMi
0x0090: 6e64 6572 2f31 2e32 322e 330d 0a48 6f73 nder/1.22.3..Hos
0x00a0: 743a 2031 3932 2e31 3638 2e31 2e31 310d t:.192.168.1.11.
0x00b0: 0a43 6f6e 6e65 6374 696f 6e3a 204b 6565 .Connection:.Kee
0x00c0: 702d 416c 6976 650d 0a0d 0a p-Alive....
09:51:07.071914 IP 192.168.1.11.http > 192.168.1.100.50312: F 1:42(41) ack 164 win 714
0x0000: 4500 0051 0914 4000 4006 add3 c0a8 010b E..Q..@.@.......
0x0010: c0a8 0164 0050 c488 2679 771d 2fdf 2c14 ...d.P..&yw./.,.
0x0020: 5011 02ca a2cd 0000 4854 5450 2f31 2e30 P.......HTTP/1.0
0x0030: 2035 3035 2048 5454 5020 5665 7273 696f .505.HTTP.Versio
0x0040: 6e20 6e6f 7420 7375 7070 6f72 7465 640d n.not.supported.
0x0050: 0a .

Thanks in advance!
:(

Posted: Sun Sep 23, 2007 1:19 pm
by zoneminder
Did you restart ZM after checking http 1.1?

Posted: Mon Sep 24, 2007 5:16 pm
by alau
Yes, I restarted ZM.

Posted: Mon Sep 24, 2007 9:17 pm
by zoneminder
Which exact version of ZM are you running?

Also can you check that the value of the http version is in your database, use the following query from within the mysql client.

Code: Select all

 select * from Config where Name like "%http_version%";

Posted: Tue Sep 25, 2007 7:26 pm
by alau
Thanks for the reply,

Now ZM is issuing a http 1.1 request but the camera is still reply with version not supported.

12:19:26.565436 IP 192.168.1.100.41901 > 192.168.1.11.http: P 1:106(105) ack 1 win 5840
0x0000: 4500 0091 5225 4000 4006 6482 c0a8 0164 E...R%@.@.d....d
0x0010: c0a8 010b a3ad 0050 d696 b402 1805 8898 .......P........
0x0020: 5018 16d0 6571 0000 4745 5420 6c69 7665 P...eq..GET.live
0x0030: 7669 6465 6f2e 6874 6d6c 2048 5454 502f video.html.HTTP/
0x0040: 312e 310a 5573 6572 2d41 6765 6e74 3a20 1.1.User-Agent:.
0x0050: 5a6f 6e65 4d69 6e64 6572 2f31 2e32 322e ZoneMinder/1.22.
0x0060: 330d 0a48 6f73 743a 2031 3932 2e31 3638 3..Host:.192.168
0x0070: 2e31 2e31 310d 0a43 6f6e 6e65 6374 696f .1.11..Connectio
0x0080: 6e3a 204b 6565 702d 416c 6976 650d 0a0d n:.Keep-Alive...
0x0090: 0a .
12:19:26.566841 IP 192.168.1.11.http > 192.168.1.100.41901: F 1:42(41) ack 106 win 714
0x0000: 4500 0051 5225 4000 4006 64c2 c0a8 010b E..QR%@.@.d.....
0x0010: c0a8 0164 0050 a3ad 1805 8898 d696 b46b ...d.P.........k
0x0020: 5011 02ca 9192 0000 4854 5450 2f31 2e30 P.......HTTP/1.0
0x0030: 2035 3035 2048 5454 5020 5665 7273 696f .505.HTTP.Versio
0x0040: 6e20 6e6f 7420 7375 7070 6f72 7465 640d n.not.supported.
However, when I use a web browser to connect to the camera everything works fine. Does ayone hve any experience with this camera?
Arecont Vision MegaVideo® WEB camera

Thanks

:cry:

Posted: Tue Sep 25, 2007 9:03 pm
by zoneminder
There is a possibility that your camera is objecting to a missing line feed on the http version line, depending on the version. Look in zm_remote_camera.cpp for the line

Code: Select all

snprintf( request, sizeof(request), "GET %s HTTP/%s\r\n", path, config.http_version );
and check is has \r\n and not just \r or \n.

Posted: Wed Sep 26, 2007 3:07 pm
by alau
I installed the rpm version so I canot check the source code. Can I hardcode it into the source option in the configuration of a new monitor? ie something like remote host path - "/livevdeo.html%5Cr%5Cn"

Arecont Vision MegaVideo® WEB camera

Posted: Thu Oct 04, 2007 9:16 pm
by alau
I compile in from source and now the problem solved. However, I still cannot get any picture from the camera.

To get video from the camera I need to point the browser to http://192.168.1.11/livevideo.html and the browser display the live video.
The livevideo.html is a gzip file
unzippingit get the following
<html>
<head>
<META HTTP-EQUIV="Expires"CONTENT="0">
<META HTTP-EQUIV="Pragma"CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control"CONTENT="no-cache">

<SCRIPT>
var theDate=new Date();
var reload_timer;
var rtt; var rto=30;
var alpha=0.8;
var beta=2;
var ubound=20;
var lbound=0.2;
var srtt;
var previostime=theDate.getTime();
var firsttime=1; var access=1;
var ssn=theDate.getTime();
function startstop() { access=!access; }
function loading() {
var currtime;
theDate=new Date();
currtime=theDate.getTime();
rtt=(currtime-previostime)/1000;
if(firsttime) {srtt=rtt; firsttime=0;}
previostime=currtime; srtt=((alpha*srtt)+((1-alpha)*rtt));
rto=beta*srtt;
if(rto>ubound)rto=ubound;
if(rto<lbound)rto=lbound;
document.hiddenimage.src="/img.jpg?ssn="+ssn+"&id="+theDate.getTime();
}
function preload() { if(access)loading(); else clearInterval(reload_timer); }
function showimage() {
clearInterval(reload_timer);
document.visibleimage.src=document.hiddenimage.src;
document.visibleimage.width=document.body.clientWidth;
document.visibleimage.height=document.body.clientHeight;
reload_timer=setInterval("preload()",(rto*1000));
}
</SCRIPT>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id="id_static"style="position:absolute;display:none;left:0px;top:200px;width:100px;height:100px;z-index:1">
<img src="/img.jpg" name='hiddenimage'onLoad='showimage()'>
</div>
<img src="/img.jpg" name='visibleimage'onLoad='setTimeout(preload,0)'>
</body>

</html>

Is there anyway to make it work?

thanks,

Alex

Posted: Thu Oct 04, 2007 9:51 pm
by jameswilson
you need to know the jpeg url

maybe

<ip>/img.jpg

Posted: Fri Oct 05, 2007 2:04 am
by cordel
You do need the direct path to the image from the cam. ZM does not parse html.

Posted: Fri Oct 05, 2007 3:05 am
by alau
Oh...Thanks very much! :lol: