We have moved at community.getvera.com

Author Topic: Problem with UI5 and IP Cameras  (Read 18950 times)

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Problem with UI5 and IP Cameras
« on: December 10, 2011, 10:06:59 am »
I upgraded my Vera2 yesterday to UI5 - didn't read carefully before clicking the link or I would have waited until it was official!

It was *mostly* working well. My mochad plugin and the Denon plugin which I have been working on with dfad1469 and zoot1612 were both slightly modified by Micasaverde and put into the app store. I didn't try the Denon plugin but the mochad one wasn't working. I'll have to back port those changes to svn and maybe fix some existing bugs but glad that I have a head start on migrating the code to UI5.

My existing webcams were working, but I wanted to remove a webcam and add four new webcams. After I removed the webcam the new webcams did not work - it seems like my vera is missing D_DigitalSecurityCamera1.xml. It seems like vera might automatically remove "apps" that aren't needed anymore when you remove a device, perhaps this file was removed when I deleted the existing webcam?

I had a second problem - I couldn't add an IP camera if there was another webcam with the same IP address. I'll verify this is a problem once I get IP cameras working again. I have several "IP cameras" that I made myself, they are embedded boxes running linux with multiple cameras with different urls - but the same web server. I could work around this but would be nice to see that fixed.

I decided to start with a blank slate so I performed a factory reset and z-wave reset of my vera. Figured UI5 was a good time to upgrade to 3.20 and start from scratch. Now I have exactly one device, an IP camera, and it isn't working. Fortunately, for me vera is 100% for entertainment purposes and if it is down for a bit that is ok.  :)

It seems like vera is trying to download the needed files and can't:

02   12/10/11 6:41:19.928   JobHandler_LuaUPnP::FetchMissingFiles need to download plugin 5 <0x400>
02   12/10/11 6:41:19.930   JobHandler_LuaUPnP::m_sMissingFile_set plugin <0x400>
01   12/10/11 6:41:19.947   Device_LuaUPnP::LoadDeviceDoc can't load /etc/cmh-lu//D_DigitalSecurityCamera1.xml <0x400>
02   12/10/11 6:41:19.948   JobHandler_LuaUPnP::m_sMissingFile_set /etc/cmh-lu//D_DigitalSecurityCamera1.xml <0x400>
01   12/10/11 6:41:19.948   JobHandler_LuaUPnP::CreateDevice_LuaUPnP failed to load 3/D_DigitalSecurityCamera1.xml so device 3 is offline <0x400>
01   12/10/11 6:41:20.043   Device_LuaUPnP::CreateServices Aborting device 3 because the topmost device has no interface <0x400>
01   12/10/11 6:41:20.044   JobHandler_LuaUPnP::CreateAllServices failed to create 3 <0x400>
02   12/10/11 6:41:20.067   Device_Service::MatchupUpnpServices no upnp service for urn:micasaverde-com:serviceId:Camera1 <0x400>
01   12/10/11 6:41:20.069   Device_LuaUPnP::CreateImplementations Aborting 3 because it failed to load <0x400>
01   12/10/11 6:41:20.069   JobHandler_LuaUPnP::CreateAllImplementations failed to create 3 <0x400>
01   12/10/11 6:41:25.399   FileUtils::ReadURL 0/resp:404 size 1 https://cr1.mios.com/sync_camera?PK_AccessPoint=<SNIP>&HW_Key=<SNIP>&mac=&cat=2&device=3 <0x400>
02   12/10/11 6:41:25.402   IPCamera::SyncToCMS main response 404 url https://cr1.mios.com/sync_camera?PK_AccessPoint=<SNIP>&HW_Key=<SNIP>&mac=&cat=2&device=3 <0x400>
01   12/10/11 6:41:25.741   FileUtils::ReadURL 0/resp:404 size 1 https://cr2.mios.com/sync_camera?PK_AccessPoint=<SNIP>&HW_Key=<SNIP>&mac=&cat=2 <0x400>
02   12/10/11 6:41:25.847   JobHandler_LuaUPnP::StartUPnPServices starting with /etc/cmh-ludl/ / http://192.168.1.101:49451/luaupnp.xml <0x400>
09   12/10/11 6:41:25.886   JobHandler_LuaUPnP::Run device 3  room 0 type urn:schemas-upnp-org:device:DigitalSecurityCamera:1 id  parent 0/0x7788b8 upnp: 0 <0x400>
03   12/10/11 6:41:25.905   JobHandler_LuaUPnP::Run ready 3 devices installation <SNIP> missing /etc/cmh-lu//D_DigitalSecurityCamera1.xml version *1.5.201*  allow_evt: 1 allow_ud: 1 upnp 0 changed: 0 pMem 0x7c2000 start 7753728 diff: 380928 <0x400>
02   12/10/11 6:41:27.010   ZWaveJobHandler::SetDeviceStatus XXX2 0/0/0/0 __LEAK__ this:286720 start:286720 to 0x815000 <0x803>
01   12/10/11 6:41:27.208   JobHandler_LuaUPnP::DownloadPlugin 5 failed to convert error -4: ERROR: no version relased for this pluginIz __LEAK__ this:-278528 start:8192 to 0x7d1000 <0x402>
01   12/10/11 6:41:27.209   JobHandler_LuaUPnP::DownloadFiles new plugin 5 returned 0 <0x402>


EDIT: Fixed some embarrassing typos. I apologize, this was posted before my morning coffee!
« Last Edit: December 10, 2011, 10:13:49 am by radarengineer »

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: Problem with UI5 and IP Cameras
« Reply #1 on: December 10, 2011, 10:19:34 am »
Did you realize that there are double slashes in a couple of lines:
01   12/10/11 6:41:19.947   Device_LuaUPnP::LoadDeviceDoc can't load /etc/cmh-lu//D_DigitalSecurityCamera1.xml <0x400>

Maybe the Plugin Files need to be adjusted so that the path is correct again. Could that be? Are your files actually on the vera under luup files?
« Last Edit: December 10, 2011, 10:28:38 am by chixxi »
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Problem with UI5 and IP Cameras
« Reply #2 on: December 10, 2011, 10:42:15 am »
@chixxi, I did notice that, and I think it is just a typo in the error handling code? But thank you for taking a look!

"D_DigitalSecurityCamera1.xml" is not in "/etc/cmh-lu". In fact, here are all Camera related files on my Vera:

root@MiOS_<SNIP>:/# find . | grep Camera
./etc/cmh-lu/S_Camera1.xml.lzo
./www/cmh/skins/default/icons/Ip_Camera.png
./www/cmh/images/intro/IP_Camera-ON.png
./www/cmh/json_update/D_DigitalSecurityCamera1.json
./www/cmh/json_update/D_DigitalGenericCamera.json
./mios/etc/cmh-lu/S_Camera1.xml.lzo
./mios/www/cmh/images/intro/IP_Camera-ON.png
./mios/www/cmh/json_update/D_DigitalGenericCamera.json
./mios/www/cmh/json_update/D_DigitalSecurityCamera1.json
./mios/www/cmh/skins/default/icons/Ip_Camera.png
./overlay/etc/cmh-lu/S_Camera1.xml.lzo
./overlay/www/cmh/skins/default/icons/Ip_Camera.png
./overlay/www/cmh/images/intro/IP_Camera-ON.png
./overlay/www/cmh/json_update/D_DigitalSecurityCamera1.json
./overlay/www/cmh/json_update/D_DigitalGenericCamera.json

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Problem with UI5 and IP Cameras
« Reply #3 on: December 10, 2011, 05:25:33 pm »
So I decided to revert to UI4 until UI5 became official, and I noticed that it became official right after I reverted. So I'm back to UI5.

After the UI5 reflash instead of having no D_DigitalSecurityCamera1.xml files I had two. There was one in /etc/cmh-lu and another in /etc/cmh-ludl.

I was also getting a lot of messages in my LuaUPnP log about being unable to download plugin 5. After a little digging on apps.mios.com it became apparent this was the IP camera plugin: https://apps.mios.com/plugin.php?id=5

I backed up and then removed the five files that were present in /etc/cmh-ludl. All but the "S_DigitalSecurityCameraStillImage1.xml.lzo" were present in /etc/cmh-lu/ as well.

-rw-r--r--    1 root     root         1183 Dec 10 12:48 D_DigitalSecurityCamera1.json.lzo
-rw-r--r--    1 root     root          464 Dec 10 12:48 D_DigitalSecurityCamera1.xml.lzo
-rw-r--r--    1 root     root          797 Dec 10 12:48 S_DigitalSecurityCameraSettings1.xml.lzo
-rw-r--r--    1 root     root          838 Dec 10 12:48 S_DigitalSecurityCameraStillImage1.xml.lzo
-rw-r--r--    1 root     root          231 Dec 10 12:48 S_PanTiltZoom1.xml.lzo


After this things seemed to work better. I didn't have any more messages about not being able to upgrade plugin 5 and my cameras now have a little picture on the dashboard.

A few outstanding issues:

1. I still can't add a new camera that has the same ip address as an existing camera. I have to change the ip of the existing camera, add the new camera, and then change the ip of the first camera back.

2. When manually adding a camera using the wizard it says "Or, if your camera is not on the list, paste the URL which returns a JPG file in the box below:". I think this is really wants for IP address and not the URL. On the next page it asks the same dialog is repeated, however here I think it doesn't want the entire IP just the part that follows the IP.

Glad my cameras are working again  :)

guest13871

  • Guest
Re: Problem with UI5 and IP Cameras
« Reply #4 on: December 10, 2011, 06:52:25 pm »
So I decided to revert to UI4 until UI5 became official, and I noticed that it became official right after I reverted. So I'm back to UI5.

When did UI5 become official?  I don't see an upgrade when I check.  Did I miss something or is this a mistake?

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Problem with UI5 and IP Cameras
« Reply #5 on: December 10, 2011, 07:28:14 pm »
About five hours ago on Micasaverde's Facebook page (http://www.facebook.com/micasaverde) this was posted:

Quote
Vera2 owners, upgrade to UI5 here - http://cp.mios.com/firmware! Enjoy

Offline osmosis

  • Full Member
  • ***
  • Posts: 121
  • Karma: +3/-1
Re: Problem with UI5 and IP Cameras
« Reply #6 on: December 11, 2011, 09:05:06 am »
With a Foscam I have a picture, but can no longer get my pan and tilt to work. I have a picture locally, remotely and via iVera iPhone app. I had pan and tilt with UI4

Offline osmosis

  • Full Member
  • ***
  • Posts: 121
  • Karma: +3/-1
Re: Problem with UI5 and IP Cameras
« Reply #7 on: December 11, 2011, 09:22:40 am »
I also have multiple camera files. How do you access the directory to delete them

Thanks

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Problem with UI5 and IP Cameras
« Reply #8 on: December 11, 2011, 10:46:25 am »
@osmosis, I can tell you what I did but not if it is the right thing to do! I think in generally messing around with your vera on the command line is not a good idea - especially if you are not familiar with the linux command line. But that is your call.

You will notice I didn't actually delete the files, I just moved them to another directory is case this didn't work out. It is probably a good idea to grab a copy of "/etc" with scp, but I think that is what the Vera backup file is anyway.

You will need an ssh client. I use putty on windows (free) or the built in ssh on osx/linux. For windows the first line will be slightly different, you will need to read the putty help.

From a command line on your mac:

username$ ssh root@<vera_ip_address>

It will ask for a password which is the one on the bottom of the vera.

On the vera:

root@MiOS_<SNIP>:~# cd /etc/cmh-ludl
root@MiOS_<SNIP>:~# mkdir tmp
root@MiOS_<SNIP>:~# mv D_DigitalSecurityCamera1.json.lzo tmp
root@MiOS_<SNIP>:~# mv D_DigitalSecurityCamera1.xml.lzo tmp
root@MiOS_<SNIP>:~# mv S_DigitalSecurityCameraSettings1.xml.lzo tmp
root@MiOS_<SNIP>:~# mv S_DigitalSecurityCameraStillImage1.xml.lzo tmp
root@MiOS_<SNIP>:~# mv S_PanTiltZoom1.xml.lzo tmp







Offline osmosis

  • Full Member
  • ***
  • Posts: 121
  • Karma: +3/-1
Re: Problem with UI5 and IP Cameras
« Reply #9 on: December 11, 2011, 03:10:51 pm »
Now I can't delete the camera. I click on the trash can and it errors with command failedinvalidplugin

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Problem with UI5 and IP Cameras
« Reply #10 on: December 11, 2011, 04:18:35 pm »
You might want to try changing the device so Vera doesn't think it is a camera?

For instance, under advanced:

device_type: urn:schemas-upnp-org:device:DimmableLight:1
device_file: D_DimmableLight1.xml

no idea if that will work but it is what I would try.

Offline cedriclocqueneux

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Re: Problem with UI5 and IP Cameras
« Reply #11 on: December 12, 2011, 04:00:45 am »
Now I can't delete the camera. I click on the trash can and it errors with command failedinvalidplugin

I have the same problem since the upgrade :(

Offline mcvflorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1755
  • Karma: +11/-3
Re: Problem with UI5 and IP Cameras
« Reply #12 on: December 12, 2011, 06:38:03 am »
It was *mostly* working well. My mochad plugin and the Denon plugin which I have been working on with dfad1469 and zoot1612 were both slightly modified by Micasaverde and put into the app store.

I am responsible for updating the plugins to be compatible with UI5. I tested most of them and they should work. What issues did you find with those two plugins?

After I removed the webcam the new webcams did not work - it seems like my vera is missing D_DigitalSecurityCamera1.xml. It seems like vera might automatically remove "apps" that aren't needed anymore when you remove a device, perhaps this file was removed when I deleted the existing webcam?

Cameras don't require a plugin anymore, because the files have been included in the "core" MiOS files. They are in /etc/cmh-lu.

I had a second problem - I couldn't add an IP camera if there was another webcam with the same IP address.

I tested this and it works, but the cameras must be on different ports. Indeed, if you have 2 cameras with the same IP and on the same port, one of the camera devices is deleted.

Quote from: radarengineer
I was also getting a lot of messages in my LuaUPnP log about being unable to download plugin 5.

We will look into this.
« Last Edit: December 12, 2011, 06:43:16 am by mcvflorin »

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Problem with UI5 and IP Cameras
« Reply #13 on: December 12, 2011, 11:17:52 pm »
With the pre-228 UI5 plugins seemed to be working for me (I upgraded first with the vera3 page link that someone had posted, and then again when I realized that wasn't the official UI5 for Vera2). I didn't test them all but I did install the google weather plugin from the app store and it worked great. I should probably mention that at the time I already had a google weather device, so I ended up with two (one old one from the app install) but they both worked.

Now the google weather App doesn't work for me. It doesn't create any child devices or do anything. I can't seem to get any plugin to work. To be fair I haven't had much time the past few days so I haven't tried very hard.

With the mochad plugin I get pages of this in my log:

01   12/12/11 20:58:30.997   luup_io_write NULL port 0x7ec268 size 1 <0x402>
01   12/12/11 20:58:30.999   luup_io_write NULL port 0x7ec268 size 1 <0x402>
01   12/12/11 20:58:31.031   luup_io_write NULL port 0x7ec268 size 1 <0x402>
01   12/12/11 20:58:31.032   luup_io_write NULL port 0x7ec268 size 1 <0x402>
01   12/12/11 20:58:31.033   luup_io_write NULL port 0x7ec268 size 1 <0x402>


It seems like my "local ipPort = 1099" is being ignored in L_Mochad1.lua?

With the Denon plugin, in the GUI:

Denon Receiver (AVR) via RS232/Ethernet [11] : Lua Engine Failed to Load

And the log:

02   12/12/11 21:09:48.788   JobHandler_LuaUPnP::StartPlugins Energy STARTED <0x400>
01   12/12/11 21:09:48.854   LuaInterface::LoadCode: [string "local socket = require("socket")..."]:384: '=' expected near 'SInputSelection1_InputSelection1_Input1_run' <0x400>
01   12/12/11 21:09:49.042   Device_Interface::CreateLuaInterface 11 failed to start engine <0x400>
02   12/12/11 21:09:49.205   JobHandler_LuaUPnP::StartUPnPServices starting with /etc/cmh-ludl/ / http://192.168.1.101:49451/luaupnp.xml <0x400>
09   12/12/11 21:09:49.334   JobHandler_LuaUPnP::Run device 11 Denon Receiver (AVR) via RS232/Ethernet  room 0 type urn:schemas-denon-com:device:receiver:1 id  parent 0/0x7a1ae8 upnp: 0 <0x400>


The "local socket = require("socket")" is the first line in the Denon Lua file.

Offline osmosis

  • Full Member
  • ***
  • Posts: 121
  • Karma: +3/-1
Re: Problem with UI5 and IP Cameras
« Reply #14 on: December 13, 2011, 12:06:34 am »
After hours of not being able to remove a camera. I assigned a camera to a parent and was finally able to delete it. However I am back to square 0 as I now have no camera and it can no longer find the camera. The camera was running fine for 6 months with UI4 and now broken by the update. I have rebooted the vera, rebooted the camera. Restarted everything electronic in the house with no joy. I also have multiple copies of the same file name when I go to apps - develop LUUP files. Is there any way to remove the extra files? The only good thing is that I do not have to go to the Gym this week as I have gone up two flights of stairs, down two flights and then back up 4 flights more times than I can count.  My hope that - just one more restart - would fix it never materialized. The cam is a Foscam, which was using the modified XML file for pan and tilt, all of which worked fine.