News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

[Solved] Dealextreme (cheap) IP Camera help

Started by slampt, August 24, 2009, 07:39:31 AM

Previous topic - Next topic

slampt

Hey Guys,

I have a cheap IP camera I got of DX, (IP400).
I am trying to write a template for it as the other templates for most of the cameras currently supported do not seem to work.
From what I can tell I believe it is to do with the reply the camera gives when I do a get.

When I tcpdump I get:
GET./image.jpg.HTTP/1.0..Accept:.*/*..Auth
comes back with
HTTP/1.1.200.OK.Connection:.Keep-alive.Con

With a working IP camera I get a different response.
HTTP/1.0.200.OK..Date:.Fri,.25.Nov.1983

The code I am playing with is from http://wiki.linuxmce.org/index.php/D-Link_DCS-5300G
I am hopeless with regex is it possibly something to do with the matching?
if (recv=~ /^HTTP[^\r\n]+200\sOK.+?\r\n\r\n(.+)$/m)

Thanks
Slampt

slampt

Ok,

For anyone who cares the regex for this is *drum role*

/^HTTP\/.*Cache-control:\sno-cache\n.(.*)/m

I will add this to the wiki if you guys like.
Cheers

Slampt

dlewis

Did you finish the template? If so, have one of the devs commit it.

slampt

Yeah it's done, I attempted to submit one a while ago for another DX PTZ camera, I was going to wait till I got a response about that.
I don't know if I am committing them correctly, I also have some IR codes for submission (which I need to figure out how to do).

Looking at the templates and reading the forums it has occurred to me that these wont actually use motion for motion detection/recording. Perhaps it is better for us to use the Generic Analogue template and specify the netcam_url?
Can someone verify this to be the better way to get record on motion working?

Also I was wondering if anyone has looked at making an interface to the images that get made in /home/cameras from the motion wrapper?

Cheers
Slampt

dlewis


slampt

I am in there, I have already asked these questions in the #linuxmce channel but I assume y'all are busy so I thought I should ask here as others may also be interested :P

Slampt

Kooma

Hey slampt,

how did you name the template for PTZ IP camera, I would like to study that? I suppose you're using the same camera I happen to have, "IPC-1002" from DX (since you started a wiki on that).

I'm trying to set this up, would be willing to add detailed info in wiki if I succeed with this...

-Kooma

krys

how bout a review of the camera quality and whether or not you are satisfied with it.
-Krys

Kooma

Quote from: krys on December 29, 2009, 05:45:57 PM
how bout a review of the camera quality and whether or not you are satisfied with it.
-Krys

Good value for money at least.. There's a link to the supplier pages with reviews and forum posts at http://wiki.linuxmce.org/index.php/IPC-1002.

If you'd like to see actual image quolity, let me know.

-Kooma

slampt

Ok I have added the code that "should" work to the wiki

http://wiki.linuxmce.org/index.php/IPC-1002

I haven't tested it yet because I don't have the cameras with me at the moment.  Will get them back next week some time.  I also have a handful of other stationary/dome style cameras I want to try and test too.

Slampt

slampt

Just an update,
I quickly tested the code, but for some reason the auth part isn't working.
If I telnet to the Camera and run it manually like so

telnet 192.168.80.218 80
GET /cgi-bin/action?action=snapshot HTTP/1.0
Accept: */*
Authorization: Basic "YWRtaW46YWRtaW4="

HTTP/1.0 200 OK
Date: Tue, 03 Apr 1984 01:53:38 GMT
Server: Boa/0.94.14rc18-ipcam
Accept-Ranges: bytes
Connection: close
Saved 33156 bytes to /tmp/s/snapshot.jpg.
Content-type: image/jpeg
Content-Length: 33156

etc

But if I try and view the image through the linuxmce web admin, tcpdump shows this.

14:18:50.480366 IP dcerouter.35688 > 192.168.80.218.www: P 1:103(102) ack 1 win 92
E....
@.@.F3..P...P..h.PU.:.|...P..\....GET /cgi-bin/action?action=snapshot
HTTP/1.0
Accept: */*
Authorization: Basic YWRtaW46YWRtaW4=


14:18:50.481030 IP 192.168.80.218.www > dcerouter.35688: . ack 103 win 2920
E..(p.@.@.....P...P..P.h|...U.;.P..hV.........
14:18:50.489427 IP 192.168.80.218.www > dcerouter.35682: . ack 2 win 2920
E..(..@.@.q...P...P..P.b{.x.Pr..P..h..........
14:18:50.489958 IP 192.168.80.218.www > dcerouter.35682: F 1:1(0) ack 2 win 2920
E..(..@.@.q...P...P..P.b{.x.Pr..P..h..........
14:18:50.489987 IP dcerouter.35682 > 192.168.80.218.www: . ack 2 win 92
E..(..@.@.....P...P..b.PPr..{.x.P..\....
14:18:50.491760 IP 192.168.80.218.www > dcerouter.35688: P 1:181(180) ack 103 win 2920
E...p.@.@..$..P...P..P.h|...U.;.P..h~F..<HTML><HEAD><TITLE>401 Unauthorized</TITLE></HEAD>
<BODY><H1>401 Unauthorized</H1>
Your client does not have permission to get URL /cgi-bin/action from this server.
</BODY></HTML>

As mentioned I have pasted the Code to the wiki, any help would be great.  I didn't have this problem when I first created the template, but for some reason I do now :(

Slampt

slampt

Ok,

I have just updated the wiki with the working ruby code, but Plugnplay still doesn't work.

I have also updated a section for another cheap DX camera (IP-400)

Cheers

Slampt

Kooma

Great, thanks for the effort slamp!
This should be obvious (at least by now after the time spent 'studying' LMCE) but: how can one use the Ruby code, i.e. what template should be used to begin with?
Can you still access the cam from WLAN?
-Kooma

Kooma

Hey slampt,
could please add some more info on how to apply your ruby code?
Do I first select an existing template (what #) and then fill in the code somewhere there?
Haven't done this before, therefore a bit lost with this... Yeah, I have spent -some- time reading this and that :-)
-Kooma

Kooma

Nobody wants to add more details in the wiki at http://wiki.linuxmce.org/index.php/IPC-1002 or here in this thread?
C'mon share the knowledge and help us newbies!