Shared Memory Issue

Support and queries relating to all previous versions of ZoneMinder
cparker
Posts: 27
Joined: Wed Oct 11, 2006 9:43 pm
Location: Massachusetts, US
Contact:

Shared Memory Issue

Post by cparker »

I've gotten a GadSpot GS800. I've gotten ZoneMinder uninstalled and reinstalled, everything works great except for actually seeing an image, just like before. When I look in /var/log/messages, I still see this:
Nov 3 19:04:00 localhost zmwatch[12564]: INF [Restarting capture daemon for camera9, shared memory not valid]
...even though I've changed the shared memory settings. I've even quadrupled the amount of RAM in this machine (to a whopping 256MB!).
# sysctl -p
kernel.shmmax = 134217728
kernel.shmall = 134217728
I still have about 500 MB of swap space available. It's not even being touched! top shows me this:
Mem: 256964k total, 70568k used, 186396k free, 4552k buffers
Swap: 489972k total, 0k used, 489972k free, 31892k cached
I still get this error in my Apache logs:
[Fri Nov 03 19:02:13 2006] [error] [client 192.168.1.197] Premature end of script headers: zms, referer: http://192.168.1.2/zm/index.php?view=wa ... 0&control=
So, what gives? I don't have time to wipe this drive and put one of those "ready made distros" on there just yet. Although if I can't get this resolved with Debian Sarge (STABLE), I'm going to try Fedora Core 6 (FLAKEY).
Christopher C. Parker
Free Software Foundation Associate Member #795
You, too, can join the FSF as an Associate Member!
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

That is not really a shared memory error.
If you don't have the settings in your camera set to match what you have zm configured for (how ever you should decide to do that, whether through the camera web page or via the URL path string or what ever method that camera provides) you will not get a captured image. If no image is captured then there will be nothing in shared memory. Thus the error you have since nothing is there in memory.

Check your settings, most likely you have overlooked something in your settings for that camera.

Regards,
Corey
cparker
Posts: 27
Joined: Wed Oct 11, 2006 9:43 pm
Location: Massachusetts, US
Contact:

Post by cparker »

Are you sure?

I double-checked my settings. They are identical. I've set the camera to a very low resolution to avoid any potential memory issues. The camera's resolution is 160 x 120. I have three options for "Resolution": VGA, CIF, QCIF. In ZoneMinder, I've set the host name to the IP address of the camera. The camera provides a still from the camera at /snapshot.html. Yes, .html. I checked the source of the file, and it's a JPEG. I don't know why there's an HTML extension on a JPEG file.

The camera also provides options for image quality (Low/Medium/High) and "frequence". I don't know what the hell a "frequence" is, but it gives 50, 60, and "Out Door" as options.

I still get a red X when I view the ZM page in IE and a broken image icon in Mozilla-based browsers. And when I attempt to view the image directly, I still get a 500 Internal Server Error.
Christopher C. Parker
Free Software Foundation Associate Member #795
You, too, can join the FSF as an Associate Member!
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

there are other posts on here about missing headers in certain cams that wget and ff can handle but zm currently cannot. If you want to prove its your cam or zm, if you make your cam public ill test it on my server and see what happens
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
cparker
Posts: 27
Joined: Wed Oct 11, 2006 9:43 pm
Location: Massachusetts, US
Contact:

Post by cparker »

Just in case...
# zmu -m 1 -q -v
Monitor 1(camera9)
Id : 1
Name : camera9
Type : Remote
Host : 192.168.10.9
Port : 80
Path : /snapshot.html
Width : 160
Height : 120
Palette : 4
Colours : 3
Event Prefix : Event-
Label Format : %%s - %y/%m/%d %H:%M:%S
Label Coord : 0,0
Image Buffer Count : 40
Warmup Count : 25
Pre Event Count : 10
Post Event Count : 10
Alarm Frame Count : 1
Section Length : 600
Maximum FPS : 62.00
Alarm Maximum FPS : 62.00
Reference Blend %ge : 7
Track Motion : 0
Function: 2 - Monitor Only
Zones : 1
Id : 1
Label : All
Type: 1 - Active
Shape : 4 points
0: 0,0
1: 159,0
2: 159,119
3: 0,119
Alarm RGB : ff0000
Check Method: 3 - Blobs
Min Pixel Threshold : 25
Max Pixel Threshold : 0
Min Alarm Pixels : 576
Max Alarm Pixels : 14400
Filter Box : 3,3
Min Filter Pixels : 576
Max Filter Pixels : 14400
Min Blob Pixels : 384
Max Blob Pixels : 0
Min Blobs : 1
Max Blobs : 0
Christopher C. Parker
Free Software Foundation Associate Member #795
You, too, can join the FSF as an Associate Member!
cparker
Posts: 27
Joined: Wed Oct 11, 2006 9:43 pm
Location: Massachusetts, US
Contact:

Post by cparker »

jameswilson wrote:there are other posts on here about missing headers in certain cams that wget and ff can handle but zm currently cannot. If you want to prove its your cam or zm, if you make your cam public ill test it on my server and see what happens
Now that you mention it, I think I remember reading something about the model I got not outputting correct headers... Let me look for it...
Gadspot NC800 has a buggy firmware becasue the HTTP HEADERS are wrong :


HTTP/1.1 200 OK^M
connection: close^M
CONTENE-LENGTH: 9406^M
^M
ff d8 ff e0 ...
...
ff d9
a typo in Content-legth and malformed should be Content-legth: and Content-Type: is missing.

The problem can be solved using a script to fix those headers , this script does the work
from http://www.lavrsen.dk/twiki/bin/view/Mo ... treamDumps

Could that be my problem? If so, how would I be able to incorporate that script's functionality into ZoneMinder?
Christopher C. Parker
Free Software Foundation Associate Member #795
You, too, can join the FSF as an Associate Member!
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

your well out of my area of knowledge here mate im afraid. You need a guru for that one lol
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

cparker wrote:
# zmu -m 1 -q -v
Monitor 1(camera9)
Id : 1
Name : camera9
Type : Remote
Host : 192.168.10.9
Port : 80
Path : /snapshot.html
Width : 160
Height : 120
Palette : 4
Colours : 3
Not a valid path

Regards,
Corey
cparker
Posts: 27
Joined: Wed Oct 11, 2006 9:43 pm
Location: Massachusetts, US
Contact:

Post by cparker »

I thought the path was everything to the right of the hostname. Is it not?

EDIT: I know the path says "snapshot.html", but it's not an HTML file. It's a JPEG.
Christopher C. Parker
Free Software Foundation Associate Member #795
You, too, can join the FSF as an Associate Member!
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

You will find the info you need here.

something like:
path = /GetData.cgi
or
path = /Jpeg/CamImg.jpg

zmc does not and can not parse HTML data only jpeg and mjpeg so anything with an HTML extension will not work.
Regards,
Corey
Image
Image
3939663646337

It's better to keep your mouth shut and appear stupid than open it and remove all doubt.
-Mark Twain
cparker
Posts: 27
Joined: Wed Oct 11, 2006 9:43 pm
Location: Massachusetts, US
Contact:

Post by cparker »

For the third time: The file has a ".html" extension, but it is not an HTML file. It is the JPEG image snapshot. The programmer who set up the NC800 Web Interface was on crack when they put it together. Who knows? All I can say is that it is a JPEG image and not an HTML file. Opening the file "snapshot.html" in a text editor shows the raw "source" of a JPEG image, not an HTML page.

That script I referenced corroborates this fact.

That API reference is for the GS1000. I don't have the GS1000. I have the GS800/NC800.[/url]
Christopher C. Parker
Free Software Foundation Associate Member #795
You, too, can join the FSF as an Associate Member!
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

I do think this is a headers issue. I have never tried but should work in theory using wget to get the image then using zm in file mode to get the image. The framework would stink but if it worked at least youd have something. And it would prove there is something wrong in the jpeg somewhere. I beleive Phil is looking into something regarding missing '/r' somewhere in stream.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
cparker
Posts: 27
Joined: Wed Oct 11, 2006 9:43 pm
Location: Massachusetts, US
Contact:

Post by cparker »

Ok.... here's the URL to the snapshot (I changed the extension from .html to .jpg).

http://drdandvm.dyndns.org:8080/snapshot.jpg

I changed the monitor to "File" and pointed it to this file (/var/www/snapshot.jpg) and I'm still getting a broken image. Perhaps someone else would have better luck?

If I can get this to work, I'll just set up a bloody cron job and do it this way until I can get a more permanent solution working.
Christopher C. Parker
Free Software Foundation Associate Member #795
You, too, can join the FSF as an Associate Member!
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

well i have setup your cam on my server and it works
so i suggest there is something wrong with your zm install mate

mon settings

host drdandvm.dyndns.org
port 8080
path etc etc

But it appears every so ofter your cam stops responding, that might be due to internet issues or it might be because you cam desont like succesive jpg requests

James
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

FYI I'm sure that user Gadspot UK here on the forum will be interested to know he was on Crack :lol:

Code: Select all

[root@builder64 cordel]# wget --save-headers --server-response http://drdandvm.dyndns.org:8080/snapshot.jpg
--10:31:49--  http://drdandvm.dyndns.org:8080/snapshot.jpg
           => `snapshot.jpg'
Resolving drdandvm.dyndns.org... 72.168.170.26
Connecting to drdandvm.dyndns.org|72.168.170.26|:8080... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Sat, 04 Nov 2006 18:31:50 GMT
  Server: Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-16 mod_perl/1.999.21 Perl/v5.8.4
  Last-Modified: Sat, 04 Nov 2006 16:14:52 GMT
  ETag: "bae0d-7956-270b1700"
  Accept-Ranges: bytes
  Content-Length: 31062
  Keep-Alive: timeout=15, max=100
  Connection: Keep-Alive
  Content-Type: image/jpeg
Length: 31,062 (30K) [image/jpeg]

100%[=============================================================================================================>] 31,062        27.51K/s

10:31:53 (27.44 KB/s) - `snapshot.jpg' saved [31062/31062]
Image
Locked