Author Topic: [Solved] Dealextreme (cheap) IP Camera help  (Read 21457 times)

slampt

  • Veteran
  • ***
  • Posts: 102
    • View Profile
[Solved] Dealextreme (cheap) IP Camera help
« 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
« Last Edit: August 24, 2009, 10:36:48 am by slampt »

slampt

  • Veteran
  • ***
  • Posts: 102
    • View Profile
[SOLVED] Re: Dealextreme (cheap) IP Camera help
« Reply #1 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

dlewis

  • Guru
  • ****
  • Posts: 401
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #2 on: August 24, 2009, 02:51:40 pm »
Did you finish the template? If so, have one of the devs commit it.

slampt

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #3 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

dlewis

  • Guru
  • ****
  • Posts: 401
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #4 on: August 24, 2009, 03:38:35 pm »
please join #linuxmce-devel on freenode

slampt

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #5 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

Kooma

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #6 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

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #7 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

Kooma

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #8 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

slampt

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #9 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

slampt

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #10 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

slampt

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #11 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

Kooma

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #12 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

Kooma

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #13 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

Kooma

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: [Solved] Dealextreme (cheap) IP Camera help
« Reply #14 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!