LinuxMCE Forums

General => Developers => Topic started by: slampt on August 24, 2009, 07:39:31 am

Title: [Solved] Dealextreme (cheap) IP Camera help
Post by: slampt on August 24, 2009, 07:39:31 am
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
Title: [SOLVED] Re: Dealextreme (cheap) IP Camera help
Post by: slampt on August 24, 2009, 10:36:32 am
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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: dlewis on August 24, 2009, 02:51:40 pm
Did you finish the template? If so, have one of the devs commit it.
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: slampt on August 24, 2009, 03:36:15 pm
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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: dlewis on August 24, 2009, 03:38:35 pm
please join #linuxmce-devel on freenode
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: slampt on August 24, 2009, 03:43:56 pm
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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: Kooma on December 29, 2009, 03:06:30 pm
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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: 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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: Kooma on December 29, 2009, 07:23:51 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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: slampt on December 31, 2009, 02:03:38 am
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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: slampt on December 31, 2009, 04:19:46 am
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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: slampt on January 02, 2010, 01:03:22 pm
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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: Kooma on January 02, 2010, 01:08:25 pm
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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: Kooma on January 11, 2010, 10:14:22 pm
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
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: Kooma on February 07, 2010, 04:19:56 pm
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!
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: slampt on February 10, 2010, 03:48:18 am
Sorry Kooma,

I have been rather busy so haven't had time to reply.
I basically created a GSD using one of existing templates as a guide.
I have tried submitting the Templates but have yet to hear from anyone about it being accepted or not.

If you get stuck let me know and I will try and write something up when I get home from work.

Cheers
Slampt
Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: bugui on July 01, 2011, 06:18:37 pm
Hello,
I follow the instructions at wiki (http://wiki.linuxmce.org/index.php/IPC-1002) to create a new template based on panasonic ip cam.
I can't get a picture form my IP Vilar camera (IPC-1002).
There is a part of the lmce log of this camera.

http://pastebin.lugmen.org.ar/6650

Is there someone that has this cam (IPC-1002) working?

HernĂ¡n


Title: Re: [Solved] Dealextreme (cheap) IP Camera help
Post by: bugui on May 21, 2012, 09:19:52 am
I get it works, you should use generic motion Ip camera template.
I leave my /etc/motion/thread1.conf should have this config.

dcerouter_1027137:/home/cameras/234# cat /etc/motion/thread1.conf
netcam_url http://192.168.80.201:80/cgi-bin/sf.cgi
netcam_userpass admin:1234

noise_level 32

text_left AltilloCam\nAltillo

target_dir /home/cameras/234

# webcam server settings
webcam_port 8001
webcam_localhost off
webcam_motion  on

# sending pluto tripped on/off events on motion start/end
on_event_start /usr/pluto/bin/MessageSend 127.0.0.1 234 -1001 2 9 25 1
on_event_end /usr/pluto/bin/MessageSend 127.0.0.1 234 -1001 2 9 25 0