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

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
Re: [SOLVED] IP Camera in 1004
« Reply #60 on: August 08, 2012, 08:45:51 am »
The result of /get_status.cgi?user=USER&pwd=PASSWORD

Code: [Select]
var id='000DC5D047FF';
var sys_ver='11.14.1.46';
var app_ver='2.4.8.12';
var alias='videre';
var now=1344408264;
var tz=-7200;
var alarm_status=0;
var ddns_status=0;
var ddns_host='';
var oray_type=0;
var upnp_status=1;
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 #61 on: August 08, 2012, 09:28:18 am »
The result of /get_status.cgi?user=USER&pwd=PASSWORD

Code: [Select]
var id='000DC5D047FF';
var sys_ver='11.14.1.46';
var app_ver='2.4.8.12';
var alias='videre';
var now=1344408264;
var tz=-7200;
var alarm_status=0;
var ddns_status=0;
var ddns_host='';
var oray_type=0;
var upnp_status=1;


ps For the moment i'm looking at zoneminder that looks very good...
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 #62 on: August 08, 2012, 11:42:23 am »
Ok, that is the result I was expecting. Now I wonder if the camera shuts down the connection immediately, or if it sends more data along as things change (D-Link camera does this). Don't know if this is easy to test with a browser, but you could use wget on the command line: wget <url> and see if it finishes, or just keeps going (stop with CTRL+C in that case).

It's quite easy to a motion detection to this template, but depending on how the camera uses the connection, I might have to make a small code change first.

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 #63 on: August 08, 2012, 12:40:58 pm »
A bit strange, it seems to disconnect, but after an enter, it really stops...

Code: [Select]
DCEROUTER$ sudo wget http://192.168.111.93/get_status.cgi?user=USER&pwd=PASSWORD
[2] 1543
brononius@dcerouter:/var/www/intern$
[2]+  Stopped                 sudo wget http://192.168.111.93/get_status.cgi?user=USER


ps, if you want, i can give you console access to my server...
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 #64 on: August 08, 2012, 12:54:09 pm »
Right, because of the & on the URL, it doesn't work. Try this:
Code: [Select]
wget "http://192.168.111.93/get_status.cgi?user=USER&pwd=PASSWORD"
It shouldn't be much more questions now, but thanks for the offer.

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 #65 on: August 08, 2012, 02:13:38 pm »
No prob for me. What works easiest for you... ;)

sudo wget "http://192.168.111.93/get_status.cgi?user=USER&pwd=PASSWORD"  -O test.txt
Code: [Select]
--2012-08-08 14:11:13--  http://192.168.111.93/get_status.cgi?user=USER&pwd=PASSWORD
Connecting to 192.168.111.93:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 220 [text/plain]
Saving to: `test.txt'

100%[===================================================================================================================>] 220         --.-K/s   in 0.001s 

2012-08-08 14:11:13 (405 KB/s) - `test.txt' saved [220/220]

more test.txt
Code: [Select]
var id='000DC5D047FF';
var sys_ver='11.14.1.46';
var app_ver='2.4.8.12';
var alias='videre';
var now=1344427874;
var tz=-7200;
var alarm_status=0;
var ddns_status=0;
var ddns_host='';
var oray_type=0;
var upnp_status=1;
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 #66 on: August 08, 2012, 02:36:55 pm »
Ok, I got what I need. I will do some tests for myself and post here when ready :)

br,
sambuca

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: [SOLVED] IP Camera in 1004
« Reply #67 on: August 08, 2012, 09:55:47 pm »
I have updated the template a bit, and added motion detection capabilities. The necessary code hasn't been released yet, but you can download the recent binary from the same url as before. You would have to update sqlCVS too, and only new devices will be set up with the new template data.

So: update sqlCVS, download new binary - place it in /usr/pluto/bin, create a new device with the template, reload. (and cross fingers ;) )

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 #68 on: August 09, 2012, 09:59:00 am »
So i've did:
  • sudo apt-get upgrade (i needed this for another tool, zoneminder, should be in linuxMCE, great tool so far  ;D
  • Downloaded; sudo wget http://hob.dyndns.org/lmce/Advanced_IP_Camera
  • Copied; sudo cp Advanced_IP_Camera /usr/pluto/bin/Advanced_IP_Camera
  • Rights; sudo chmod 777 /usr/pluto/bin/Advanced_IP_Camera
  • sqlCVS update (selected all core)
  • Reloaded LinuxMCE

Not sure what happened, but all my camera's were gone under 'surveillance cameras'.
So i've recreated a camera with template id 2211 (IPCAM02), but couldn't get an image.

sudo /usr/pluto/bin/Advanced_IP_Camera -d 209
Code: [Select]
Advanced_IP_Camera, v.<=version=>
Visit www.plutohome.com for source code and license information

05 08/09/12 9:51:33.512 Connect() failed, Error Code 111 (Connection refused)) <0xb77d96f0>
05 08/09/12 9:51:34.513 Connect() failed, Error Code 111 (Connection refused)) <0xb77d96f0>
05 08/09/12 9:51:35.519 Socket::ReceiveData 0x8814498 failed, bytes left 0 start: 10000 1: 0 1b: 0 2: 0 2b: 0 m_Socket: 3 Event Dev #209 <0xb77d96f0>
05 08/09/12 9:51:35.519 Socket::ReceiveString2 ReceiveData failed m_Socket: -1 Event Dev #209 <0xb77d96f0>
01 08/09/12 9:51:35.519 DCE Router cannot give us config: ReceiveData failed <0xb77d96f0>
01 08/09/12 9:51:35.519 Connect() Failed <0xb77d96f0>
Segmentation fault

A complete reboot of the machine gives me the same result.

ps how can i test the motion detection function? Where can i see 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

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: [SOLVED] IP Camera in 1004
« Reply #69 on: August 09, 2012, 10:08:58 am »
Are you using device template #2211? that is wrong on my install. The IPCAM02 template should now have ID 2213. If you used 2211 previously, that is probably why your devices disappeared, the template ID was probably changed when you did an sqlCVS update.

The error in the log suggests that there is something wrong with the device, and that it cannot load its device data. Make sure you are using the correct template, and you should check that the template look correct too.

The motion detection can be see in the DCERouter.log as an event sent from the cameras motion detector. The new template should automatically create a motion detector child under the camera device.

The current template will poll the camera every 10 seconds for any changes in motion detection status, so event might not be instant.

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 #70 on: August 09, 2012, 12:28:46 pm »
huh, slik... ?

It was the correct template (2213). Just a typo from me.

I've just removed the device, restarted the computer and wanted to add the camera.
But apparantly linuxMCE isn't running anymore?!

In my logs:
/var/log/pluto/DCERouter.log
Code: [Select]
Thu Aug  9 12:27:21 CEST 2012 Starting
01 08/09/12 12:27:21.492 Got a device 205 with wrong device template 2356 <0xb77b08e0>
01 08/09/12 12:27:21.492 Got a device 206 with wrong device template 2356 <0xb77b08e0>
01 08/09/12 12:27:21.492 Got a device 207 with wrong device template 2356 <0xb77b08e0>
01 08/09/12 12:27:21.492 Got a device 208 with wrong device template 2356 <0xb77b08e0>
05 08/09/12 12:27:22.120 Loaded plug-in device: 3 master device: 10 -- ./File_Grids_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.120 Loaded plug-in device: 4 master device: 27 -- ./General_Info_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.121 Loaded plug-in device: 5 master device: 31 -- ./Climate_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.121 Loaded plug-in device: 6 master device: 9 -- ./Datagrid_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.121 Loaded plug-in device: 7 master device: 39 -- ./Infrared_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.121 Loaded plug-in device: 8 master device: 32 -- ./Lighting_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.122 Loaded plug-in device: 9 master device: 12 -- ./Orbiter_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.123 Loaded plug-in device: 10 master device: 2 -- ./Media_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.123 Loaded plug-in device: 11 master device: 34 -- ./Telecom_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.123 Loaded plug-in device: 12 master device: 52 -- ./Event_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.124 Loaded plug-in device: 13 master device: 33 -- ./Security_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.124 Loaded plug-in device: 14 master device: 1809 -- ./Plug_And_Play_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.126 Loaded plug-in device: 24 master device: 6 -- ./Xine_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.127 Loaded plug-in device: 28 master device: 2123 -- ./Picture_Plugin.so <0xb77b08e0>
05 08/09/12 12:27:22.127 Loaded plug-in device: 31 master device: 36 -- ./MythTV_PlugIn.so <0xb77b08e0>
05 08/09/12 12:27:22.173 Plugin 3 activated <0xb77b08e0>
05 08/09/12 12:27:22.217 Plugin 4 activated <0xb77b08e0>
05 08/09/12 12:27:22.262 Plugin 5 activated <0xb77b08e0>
05 08/09/12 12:27:22.309 Plugin 6 activated <0xb77b08e0>
05 08/09/12 12:27:22.353 Plugin 7 activated <0xb77b08e0>
05 08/09/12 12:27:22.398 Plugin 8 activated <0xb77b08e0>
05 08/09/12 12:27:22.489 Plugin 9 activated <0xb77b08e0>
Return code: 139
3 08/09/12 12:27:22 DCERouter (server) Device died... count=169/200 dev=DCERouter

Not sure if it's caused by the template, or by the 'apt-get upgrade'. But it's a fact that the old camera's are still configured somewhere.
Can/may I simply remove them from my database?


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 #71 on: August 09, 2012, 01:03:55 pm »
Something seems to crash the DCERouter.. Don't think it is the template. Did you upgrade everything or just some packages? If you got conflicting versions of LinuxMCE libraries and binaries, this can happen.

You can delete the old camera devices from your database using the mysql tool.
sudo mysql pluto_main
delete from DeviceData where FK_Device=xx;
delete from Device where PK_Device=xx;


br,
sambuca

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: [SOLVED] IP Camera in 1004
« Reply #72 on: August 09, 2012, 02:26:30 pm »
There is no FK_Device in DeviceData

Deleting a device is not straightforward. You have leftovers in Device_DeviceData, Device_Command, Device_CommandGroup and maybe something else.

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: [SOLVED] IP Camera in 1004
« Reply #73 on: August 09, 2012, 02:37:26 pm »
posde, you're right, that should have read Device_DeviceData.

brononius, check first that you don't find the devices under Advanced -> Configuration -> Devices. If you find them there, delete them there.

But for the reasons posde mention, if you need to change it in the database, a better solution could be to update the FK_DeviceTemplate of the Devices:
sudo mysql pluto_main
update Device set FK_DeviceTemplate = 2213 where PK_Device = xx;

and do the last one for each of you old device IDs.

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 #74 on: August 09, 2012, 03:05:18 pm »
brononius, check first that you don't find the devices under Advanced -> Configuration -> Devices. If you find them there, delete them there.
They are there, but i can't click them. :$

update the FK_DeviceTemplate of the Devices:
sudo mysql pluto_main
update Device set FK_DeviceTemplate = 2213 where PK_Device = xx;
I've done this. And alle devices are back in, and clickable.
Can/should i simply remove them from here? or....
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