Author Topic: [SOLVED] IP Camera in 1004  (Read 61996 times)

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
Re: IP Camera in 1004
« Reply #45 on: August 06, 2012, 06:03:13 pm »
A bit more log, a bit more details... ;)

I see that in the link, he puts 3x ///
Normal behavior? Or something wrong?
In the GUI i've put /snapshot.cgi (with only 1 /). I've tried also with and without user/password directly in the link.


sudo tail -f /var/log/pluto/192_Advanced_IP_Camera.log
Code: [Select]
2       08/06/12 18:01:00       192 (spawning-device)   Device requests restart... count=1/50 dev=192
1       08/06/12 18:01:08       192 (spawning-device)   Starting... 1
1       08/06/12 18:01:08       192 (spawning-device)   Found /usr/pluto/bin/Advanced_IP_Camera
10      08/06/12 18:01:08.860           Device: 192 starting.  Connecting to: localhost <0xb77126f0>
10      08/06/12 18:01:08.865           Setting timeout for socket 4 to 20 <0xb77126f0>
10      08/06/12 18:01:08.866           DCE Router asked us to wait--it's busy at the moment <0xb77126f0>
10      08/06/12 18:01:09.871           getConfig() Configuration = panUpCmd=/decoder_control.cgi?command=0&onestep=1&user=USER&pwd=PASSWORD
panDownCmd=/decoder_control.cgi?command=2&onestep=1&user=USER&pwd=PASSWORD
panRightCmd=/decoder_control.cgi?command=4&onestep=1&user=USER&pwd=PASSWORD
panLeftCmd=/decoder_control.cgi?command=6&onestep=1&user=USER&pwd=PASSWORD <0xb77126f0>
10      08/06/12 18:01:09.871           getConfig() key = panUpCmd, value = /decoder_control.cgi?command=0&onestep=1&user=USER&pwd=PASSWORD <0xb77126f0>
10      08/06/12 18:01:09.871           getConfig() key = panDownCmd, value = /decoder_control.cgi?command=2&onestep=1&user=USER&pwd=PASSWORD <0xb77126f0>
10      08/06/12 18:01:09.871           getConfig() key = panRightCmd, value = /decoder_control.cgi?command=4&onestep=1&user=USER&pwd=PASSWORD <0xb77126f0>
10      08/06/12 18:01:09.871           getConfig() key = panLeftCmd, value = /decoder_control.cgi?command=6&onestep=1&user=USER&pwd=PASSWORD <0xb77126f0>
10      08/06/12 18:01:09.872           getConfig() Children: <0xb77126f0>
05      08/06/12 18:01:09.872           m_vectEventMethod.size() = 5. Configured EventMethods: <0xb77126f0>
05      08/06/12 18:01:09.872           m_mapPK_Device_OutputDevice.size() = 0. Configured OutputDevices: <0xb77126f0>
10      08/06/12 18:01:09.873           Connect OK <0xb77126f0>
10      08/06/12 18:01:09.873           Requesthandler 0xa0448d0 (device: 192) runThread now running <0xb6d10b70>
10      08/06/12 18:01:14.148           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:14.148           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:15.200           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:15.200           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:16.244           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:16.244           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:17.288           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:17.288           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:18.332           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:18.332           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:19.380           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:19.380           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:20.423           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:20.423           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:21.468           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:21.468           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:22.514           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:22.514           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:23.558           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:23.558           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:23.941           Receive string: MESSAGE 109            <0xb6d10b70>
10      08/06/12 18:01:23.941           Received MESSAGE 109            0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:23.942           Received Message type 1 ID 84 from 0 to 192 (device: 192) resp 1 <0xb6d10b70>
10      08/06/12 18:01:23.942           CMD_Get_Video_Frame: sUrl: http://192.168.111.93:80///snapshot.cgi?user=USER&pwd=PASSWORD&rate=1 <0xb6d10b70>
10      08/06/12 18:01:23.951           CMD_Get_Video_Frame: http code: 404, response: <0xb6d10b70>
10      08/06/12 18:01:23.951           Socket::SendMessage type 4 id 0 from 192 to 0 <0xb6d10b70>
10      08/06/12 18:01:24.602           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:24.602           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:25.647           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:25.647           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:26.692           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:26.692           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:27.738           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:27.738           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:28.782           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:28.782           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:29.199           Receive string: MESSAGE 109            <0xb6d10b70>
10      08/06/12 18:01:29.199           Received MESSAGE 109            0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:29.199           Received Message type 1 ID 84 from 0 to 192 (device: 192) resp 1 <0xb6d10b70>
10      08/06/12 18:01:29.199           CMD_Get_Video_Frame: sUrl: http://192.168.111.93:80///snapshot.cgi?user=USER&pwd=PASSWORD&rate=1 <0xb6d10b70>
10      08/06/12 18:01:29.207           CMD_Get_Video_Frame: http code: 404, response: <0xb6d10b70>
10      08/06/12 18:01:29.207           Socket::SendMessage type 4 id 0 from 192 to 0 <0xb6d10b70>
10      08/06/12 18:01:29.826           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:29.826           Received  0xa0448d0 device: 192 <0xb6d10b70>
10      08/06/12 18:01:30.870           Receive string:  <0xb6d10b70>
10      08/06/12 18:01:30.870           Received  0xa0448d0 device: 192 <0xb6d10b70>
Version: linuxMCE 1404, running virtual on ESXi

Orbiters: ASUS eeePAD, Nexus 5, Huwai, web
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7912-7940-7960
Camera's: Foscam POE

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: IP Camera in 1004
« Reply #46 on: August 06, 2012, 07:07:15 pm »
I've seen the triple /// too, but it has not been a problem before.

I see that the URL request gets a 404 error, which means that the requested resource does not exist.  Are you sure that the url is correct?

br,
sambuca

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
Re: IP Camera in 1004
« Reply #47 on: August 06, 2012, 07:35:17 pm »
When i enter follow link in my browser, it works: http://192.168.111.93/snapshot.cgi?user=USER&pwd=PASSWORD&rate=1
or simply http://192.168.111.93/snapshot.cgi followed by 'USER' & 'PASSWORD'.
The same for /videostream.cgi

But when i insert  http://192.168.111.93:80///videostream.cgi, i'm recieving almost the same error coming from the IP camera:

Code: [Select]
404 Not Found

File not found.

Seems he doens't like the triple slash...
Version: linuxMCE 1404, running virtual on ESXi

Orbiters: ASUS eeePAD, Nexus 5, Huwai, web
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7912-7940-7960
Camera's: Foscam POE

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: IP Camera in 1004
« Reply #48 on: August 06, 2012, 08:18:54 pm »
Ok, I've made a new version that does not add extra slashes. You can download it from the same URL.

br,
sambuca

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
Re: IP Camera in 1004
« Reply #49 on: August 07, 2012, 08:22:39 am »
Ok, I've made a new version

In one word:   NICE

Works perfectly. Everything works:
  • Snapshots in LinuxMCE>Security>View Cameras
  • Videostream in an orbiter
  • Camera control in an orbiter

My settings asis:
  • Templateid: 2208, controlled by CORE
  • path: /snapshot.cgi
  • Floorplan: camera
  • Configuration:panUpCmd=/decoder_control.cgi?command=2&onestep=1
    panDownCmd=/decoder_control.cgi?command=0&onestep=1
    panRightCmd=/decoder_control.cgi?command=4&onestep=1
    panLeftCmd=/decoder_control.cgi?command=6&onestep=1
  • TCP port: 80
  • video settings: /videostream.cgi
  • AuthUser: USER
  • AuthPassword: PASSWORD
  • Video Support: checked
  • IP: 192.168.111.93

beside: for the controls, i had to switch UP and DOWN since my camera is upside down... ;)





Next is to change the orbiter layout (buttons assigment) a bit. I don't have zoom, and i would like to replace this with preselections views (fe 10ups, 15 rights) But i think this another topic/template/..., no?
Version: linuxMCE 1404, running virtual on ESXi

Orbiters: ASUS eeePAD, Nexus 5, Huwai, web
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7912-7940-7960
Camera's: Foscam POE

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: [SOLVED] IP Camera in 1004
« Reply #50 on: August 07, 2012, 08:54:17 am »
Glad you finally got it working  :)

It would be great if you create a new template for your camera so that it is plug and play.

Changing the Orbiter layout is definitely another topic yes..

br,
sambuca

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
Re: [SOLVED] IP Camera in 1004
« Reply #51 on: August 07, 2012, 09:18:06 am »

Glad to.
Is there somewhere a procedure how to create templates?


ps not sure why, but when i reboot the server, i've got the 'segmentation fault' again. Just a download of your file, chmod... solved it again?


Version: linuxMCE 1404, running virtual on ESXi

Orbiters: ASUS eeePAD, Nexus 5, Huwai, web
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7912-7940-7960
Camera's: Foscam POE

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: [SOLVED] IP Camera in 1004
« Reply #52 on: August 07, 2012, 09:36:03 am »
There should be some procedures in the wiki. Basically it goes like this:
Go to Advanced -> Configuration -> Device Templates, click Add device template. You need to specify your cameras manufacturer and device category first (category should be "IP Cameras < Surveillance cameras < Peripherals"). If you don't know the manufacturer, there is also a "Generic" manufacturer.

From there, you can follow the instructions on http://wiki.linuxmce.org/index.php/Advanced_IP_Camera to fill in the required information.

I will look at the segmentation fault, but I think it is happening when the program stops and shouldn't prevent the camera from working.

br,
sambuca

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
Re: [SOLVED] IP Camera in 1004
« Reply #53 on: August 07, 2012, 01:08:26 pm »
I think I've figured it out.
I've created a new template (id 2211 - Generic - IPCAM02), and it works at my end.

Are their extra steps i must do? Fe upload it somewhere in order to make it public?
Or isn't that the idea?


Version: linuxMCE 1404, running virtual on ESXi

Orbiters: ASUS eeePAD, Nexus 5, Huwai, web
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7912-7940-7960
Camera's: Foscam POE

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: [SOLVED] IP Camera in 1004
« Reply #54 on: August 07, 2012, 02:06:55 pm »
Yes, you need to upload it to sqlCVS. You can do this anonymously, and I will approve it after checking that it looks ok.

Everything you need related to sqlCVS is found in the web-admin, under Advanced -> sqlCVS.
First you should do a sqlCVS update, check all under DCE, and click next. This will pop up a new window (watch out for popup blockers...) and will take a while to complete.
When this completes, open your IPCAM02 template and make sure everything is ok (no device data is missing or added by mistake by the update). I don't think it should, but better safe than sorry. Also note that your template might have gotten a new template number, you need this later.

Next, do a sqlCVS diff. Check all under DCE and click next.
This is where it gets interesting...  ;) This will, after a short while, display all changes in your installation compared to the standard one.

You will probably have several changes that are unrelated to the device template, and selecting those will in the worst case break existing templates (like the changes you did to the original Advanced IP Camera template).
What you see is a list of items, with NEW/MOD/DEL in front of them. In your case you created a new template, so only NEW items should be selected, deselect all others.

Now, look more closely at the selected items... You should see a column with PK_ or FK_DeviceTemplate for each item. In this column there should be the same number as your device template. If you have any other numbers, it may be other device templates you created but did not upload. So deselect everything not containing the IPCAM02 device template ID.

Create a new ticket in trac, and use the ticket ID as a reference in the text input at the bottom of the web-admin screen, along with perhaps a short description. Click "Commit". This will also take a short while. When that is done, let me know and I will take it from there.

br,
sambuca

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
Re: [SOLVED] IP Camera in 1004
« Reply #55 on: August 07, 2012, 02:42:59 pm »
I'm getting an error on the DIFF...

Code: [Select]
01 08/07/12 14:39:44.791 gethostbyname2 for 'schema.linuxmce.org', failed, Last Error Code 3, Device: 1 <0xb779b6d0>

I'm seeing another topic with this kind of error. Will first try that...  :-[
Version: linuxMCE 1404, running virtual on ESXi

Orbiters: ASUS eeePAD, Nexus 5, Huwai, web
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7912-7940-7960
Camera's: Foscam POE

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
Re: [SOLVED] IP Camera in 1004
« Reply #56 on: August 07, 2012, 05:44:50 pm »
Hmmm, my first template, i'm a bit curious... ;)

Ticketnr 1534, device template is uploaded...



ps this template should work also for the FOSCAM IPCAM generation. In my eyes, this is almost 99,99% the same device. Except the name and maybe firmware...
Version: linuxMCE 1404, running virtual on ESXi

Orbiters: ASUS eeePAD, Nexus 5, Huwai, web
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7912-7940-7960
Camera's: Foscam POE

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: [SOLVED] IP Camera in 1004
« Reply #57 on: August 07, 2012, 08:18:09 pm »
Your template has been approved, thanks for your work.

Please update sqlCVS and check that the template still is OK. There was some inconsistency after approving it, but I took care of it. It was not anything you did wrong ;)

You could also add a DHCP range for the cameras to make them plug-and-play.

It seems the camera is also capable of motion detection, and I think it is possible to add that to the template if your interested in helping a bit.

br,
sambuca

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
Re: [SOLVED] IP Camera in 1004
« Reply #58 on: August 08, 2012, 07:37:33 am »
You could also add a DHCP range for the cameras to make them plug-and-play.
I'm not sure where i can find the MAC-range for these devices. Since it are 'nameless brands'.
These are the 4 MAC's i'm having:
  • 00:0d:c5:d0:47:ea
  • 00:0d:c5:d0:47:ee
  • 00:0d:c5:d0:47:e1
  • 00:0d:c5:d0:47:ff

It seems the camera is also capable of motion detection....... if your interested in helping
I'm very intrested in this. I was thinking to add motion wrapper for this.
But if there's another method, i'm open to that.
I'm pro centralizing everything. I test the camera motion detection already as stand-alone. But hated it a bit that the mails/files were treated as something seperated. So if it could be integrated in LinuxMCE, great...


I'm also looking for a kind of 'fixed movement'. I've got 2 camera's that should cover 2 angles. So i'm thinking to create a small script that 'center' the camera, and then move the 10x up, 6x left (or something like that). I don't know if there's a part in linuxmce that i could/should use?


ps your help on 'creating and uploading templates' was easy to follow! Short and direct...
Maybe a dedicated wiki for this? Could help everybody who wants to create/share templates?
« Last Edit: August 08, 2012, 07:41:11 am by brononius »
Version: linuxMCE 1404, running virtual on ESXi

Orbiters: ASUS eeePAD, Nexus 5, Huwai, web
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7912-7940-7960
Camera's: Foscam POE

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: [SOLVED] IP Camera in 1004
« Reply #59 on: August 08, 2012, 08:40:42 am »
There is no 100% sure method of finding mac ranges, but the consensus seem to be that the first 3 or 4 bytes is used as a range. So in you case it would be from 00:0d:c5:d0:00:00 to 00:0d:c5:d0:FF:FF. This can always be changed later on if needed.

To do a quick test, can you open your browser to this address on your camera. You probably need the same user/password format on the url as other commands:
Code: [Select]
http://x.x.x.x/get_status.cgi?user=USER&pwd=PASSWORDand post the output from that.

I suppose it should be possible to do that with some timed event and such, if not too advanced. There is not built-in support for such a thing iirc.
And I don't know how well this will work with built-in motion detection. Ideally cameras should compensate for camera movement, but ymmv. That would be true when using a motion wrapper too, it does not know that the camera moves rather than there is motion in the frame.

Glad you liked my short guide :) I think there should already be wiki articles on this, but maybe they can be improved on.

br,
sambuca