We have moved at community.getvera.com

Author Topic: "Delivery failed" message  (Read 11232 times)

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
"Delivery failed" message
« on: July 12, 2009, 03:55:32 pm »
I'm getting Delivery failed message when I'm trying to use controls of any "hand made" Luup device.
It isn't reflected in the log at all - if I click on On/Off, or Left/Right button not a single line get added in the log.

IS there any way to see what's the cause of this error?
« Last Edit: July 12, 2009, 03:57:44 pm by 325xi »

Offline micasaverde

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +15/-1
Re: "Delivery failed" message
« Reply #1 on: July 13, 2009, 10:58:00 am »
How are you sending the messages?  Within Luup, or on the lu_action URL, or in the UI?

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: "Delivery failed" message
« Reply #2 on: July 13, 2009, 11:59:00 am »
From UI - just click on the buttons of the device

I don't necessarily expect it to work - but I think we should see some hints of failure reasons in the log
« Last Edit: July 13, 2009, 12:04:10 pm by 325xi »

Offline micasaverde

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +15/-1
Re: "Delivery failed" message
« Reply #3 on: July 15, 2009, 12:42:16 am »
Can you: a) turn on verbose logging, b) tail the logs grep '^08' which will show you all the incoming actions, c) submit a trouble ticket letting me know the exact time of the action in question?  It has to state in the logs why the action failed.  I can look in your logs and explain what it means.

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: "Delivery failed" message
« Reply #4 on: July 15, 2009, 11:20:24 am »
Done. grep '^08' shows nothing when I click on UI controls of my devices

Submitted ticket:  855, access is open

Offline micasaverde

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +15/-1
Re: "Delivery failed" message
« Reply #5 on: July 16, 2009, 11:45:49 pm »
325xi.  I'm sorry, but the trouble ticket doesn't include the Luup plugins you wrote (just the logs), and the trouble ticket didn't mention the access code for your system (it's the 6 digits following your serial number).  Without that I couldn't login.  I just released firmware 789 which updates the trouble ticket so now any trouble tickets will include your Lua, UPNP and Luup plugins files.  You can upgrade and do another trouble ticket, or email me the remote access code, or email me your xml & lua files for me to test it locally.

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: "Delivery failed" message
« Reply #6 on: July 17, 2009, 12:25:55 am »
Just tried again with the new FW. Delete works now - thanks.

Still getting Delivery failed...

Successfully submited ticket:  860

Offline micasaverde

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +15/-1
Re: "Delivery failed" message
« Reply #7 on: July 17, 2009, 10:44:08 pm »
I found the problem.  There are 2 things, actually.

You created a parent device which is a 'camera controller', like a DVR, that has multiple cameras within it.  The parent device has an implementation file I_ICamView.xml, and the children, the cameras have one too: I_iCamViewPTZ.xml

In the implementation file for the parent device which manages the cameras you didn't specify the UPNP device file for the children.  This is how the line should read:

    lu_chdev_append(lul_device,child_devices,1,"Camera #1","urn:schemas-upnp-org:device:DigitalSecurityCamera:1","D_DigitalSecurityCamera1.xml","I_iCamViewPTZ.xml","urn:micasaverde-com:serviceId:Camera1,URL=pda.cgi?page=image&cam=1",true)

Without the "D_DigitalSecurityCamera1.xml", the devices were created, but without any UPNP definition.  Because incoming actions come in via UPNP, every device has to have a valid UPNP device file and service or it won't be able to receive actions.

The second is that in the parent device's UPNP device file you have this:

   <handleChildren>1</handleChildren>

I included that in my examples because in mine I put the actions for the children within the parent's implementation file.  So I wanted all actions to a child device to go through the parent's implementation file.  In your case, that's not happening.  The parent implementation, which is the 'dvr' device that manages the cameras, specifies one implementation file:  I_ICamView.xml.  That implementation file has no pan/tilt/zoom action handling.  The cameras, the child devices, have their own implementation file, I_iCamViewPTZ.xml.  But because of that 'handlechildren' flag, the actions are passed off to the parent's implementation.

So you have 3 options:

1) remove the handlechildren flag. 

2) Add I_iCamViewPTZ.xml to the D_ICamView.xml device spec so that the parent has the implementation, like this:

   <implemenationList>
      <implementationFile>I_ICamView.xml</implementationFile>
      <implementationFile>I_iCamViewPTZ.xml</implementationFile>
  </implemenationList>

3) The third option, which is my personal taste, is to just get rid of I_iCamViewPTZ.xml and put the lua script for PTZ inside I_ICamView.xml and leave the handleChildren flag.  The advantage of this is just that you have everything related to the iCamView in only 1 implementation file, and since there's not a lot of code (just some PTZ functions) I figure it's not necessary to break it into multiple files.  *CAVEAT* is that I'm assuming every camera will implement PTZ the same way with the same code.  If that's not the case, if the iCamView has different types of cameras which do PTZ differently, then you should do option #1 like you intended because with option #2 or #3, any incoming action "MoveRight" to either type of camera will go to a single "MoveRight" action handler within the parent device.  You'd need to put an 'if' block in the MoveRight to see which type of camera it is and handle it appropriately.  In that case, it would probably would be cleaner to have separate implementation files for each method of PTZ implementation, and in the ch_dev_append loop, just specify the correct one for each type of camera.

If you delete the iCamView device in your Luup UI, then fix those 2 issues, and then re-add it, then all is fine.  The reason you have to delete and re-add it is because with the 790 release, if you previously specified with ch_dev_append the same device type, but without a device file, and now you add the device file, it doesn't realize it needs to update teh device.  I just committed a fix for this, but in the meantime, just delete and re-add the device after you fix the issue.

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: "Delivery failed" message
« Reply #8 on: July 18, 2009, 01:05:19 am »
Great - it works now - I really appreciate your help.

Couple of questions though:

- absence of device file seems to be the cause of the error message - is it possible to add some logging to ensure this kind of error will be traceable?

- I tried to replace <job> with <run> ( normally response time of the server is very good), but with <run> I started to get another message: "Undefined:", the action worked though - again I couldn't find anything in the log that would hint on the message cause.

- is there easy way to add more buttons on UI for extended functionality?

- in "Full Size" view the minimal refresh time is 5s. Is it possible to reduce it?

Offline micasaverde

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +15/-1
Re: "Delivery failed" message
« Reply #9 on: July 18, 2009, 12:38:40 pm »
Quote
absence of device file seems to be the cause of the error message - is it possible to add some logging to ensure this kind of error will be traceable?

Done.  There's now a warning (log level 2): Device_LuaUPnP::LoadDeviceDoc no device doc for x

Quote
I tried to replace <job> with <run> ( normally response time of the server is very good), but with <run> I started to get another message: "Undefined:", the action worked though - again I couldn't find anything in the log that would hint on the message cause.

I can reproduce the problem.  Unfortunately it's in the javascript on the web ui, and our javascript programmer just left today for a 2 week vacation.  You can ignore the dialog box, the command is working.  I'll ask him to fix it when he's back.

Quote
is there easy way to add more buttons on UI for extended functionality?

We've been trying to think of a good way to address this.  One thought that came to mind was being able to put a URL in the device specification for "setup" and "control", which would be something you register a handler for.  The "setup" would be for the devices page, the "control" for the dashboard.  The problem there is that whatever you do would be specific for our existing Vera UI, and if, for example, someone had an iPhone app, the control wouldn't work because it's non-html.  But there's not an easy universal way to describe a widget.  So we're still debating how to address this.

Quote
in "Full Size" view the minimal refresh time is 5s. Is it possible to reduce it?

That's a java script question.  I'm sure there is, but I don't know it.  Going back to the prior question, a way to embed live video is very high on our priority list.  The challenge we've got is that many of the cameras don't use a standard browser-compliant way of providing live video.  They instead require an active-X control that only works in IE on Windows.  What about your cameras?  Any ideas?


Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: "Delivery failed" message
« Reply #10 on: July 18, 2009, 01:53:03 pm »
Quote
is there easy way to add more buttons on UI for extended functionality?

We've been trying to think of a good way to address this.  One thought that came to mind was being able to put a URL in the device specification for "setup" and "control", which would be something you register a handler for.  The "setup" would be for the devices page, the "control" for the dashboard.  The problem there is that whatever you do would be specific for our existing Vera UI, and if, for example, someone had an iPhone app, the control wouldn't work because it's non-html.  But there's not an easy universal way to describe a widget.  So we're still debating how to address this.

IMHO, you could think of providing both ways: the hard way, and the easy way. What you're talking about is full complete solution, the "hard" way - my guess it's could take a time.
But there's a simple way that would most likely satisfy average needs. Add a new XML tag to describe basic custom controls: a button, check box, radio box, may be slider, etc. All user should be able to do is to provide name, mouse hover text, min/max values if relevant, and action name. All the rest is controlled by the engine - look-n-feel, location, etc. And you provide user with a function to retrieve the selected value and/or just trigger the action. This is easy to implement, it won't break your UI, and it will give the required degree of flexibility to the developers.

Quote
in "Full Size" view the minimal refresh time is 5s. Is it possible to reduce it?

That's a java script question.  I'm sure there is, but I don't know it.  Going back to the prior question, a way to embed live video is very high on our priority list.  The challenge we've got is that many of the cameras don't use a standard browser-compliant way of providing live video.  They instead require an active-X control that only works in IE on Windows.  What about your cameras?  Any ideas?

iCamView is not an exception, but at least it provides both ActiveX and Java applet options. The latter could possibly be embed on the UI.



Offline micasaverde

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +15/-1
Re: "Delivery failed" message
« Reply #11 on: July 22, 2009, 09:59:14 pm »
325xi.. I hear you about the XML tag to describe button, check box, radio box, etc.  But, if we create our own parsing/markup language with our own tokens for that, like:

I want to control <drop-down choices="blinds", "lights"> whenever it is <check box option="raining"> ...

Well in that case essentially we've duplicated HTML, and while maybe it could be a bit more optimized, I think that since so many people know HTML we'd be better of to just embed HTML widgets instead of creating our own markup language to do the same thing.  But, you do really need to have some sort of javascript capabilities.  For example, look at the configuration widget for cameras.  It says things like:

Turn on the following lights:
[ ] light #1
[ ] light #2
etc.

and these sensors:
[ ] sensor #1
etc.

That's more than just a markup, you need to be able to iterate the list of devices, filter out the lights and sensors, and build check boxes.  Then you need to be able to compose them into the configuration data.  For example, with the cameras we save the list of lights to turn as a comma delimited text string.  But that means that a java script function needs to evaluate which lights are checked and concatenate the device id's into a string.  So what I want to do is have the same thing for the html widgets as for the Lua, where we have shared functions in the java script to read device config, set variables, call actions, etc.  I think we can still keep it simple.  But I need to work with our javascript dev, and he's on vacation right now till 3 Aug.

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: "Delivery failed" message
« Reply #12 on: June 21, 2010, 06:46:34 pm »
Is the below still true?  I am trying to create child devices that use their own implementation files.  Anytime I do this though, I hang on "Running Lua Startup."  If I load the same implementation file to a parent device, it works fine.  I've tried removing the handlechildren tag, and still no go.



So you have 3 options:

1) remove the handlechildren flag. 

2) Add I_iCamViewPTZ.xml to the D_ICamView.xml device spec so that the parent has the implementation, like this:

   <implemenationList>
      <implementationFile>I_ICamView.xml</implementationFile>
      <implementationFile>I_iCamViewPTZ.xml</implementationFile>
  </implemenationList>

3) The third option, which is my personal taste, is to just get rid of I_iCamViewPTZ.xml and put the lua script for PTZ inside I_ICamView.xml and leave the handleChildren flag.  The advantage of this is just that you have everything related to the iCamView in only 1 implementation file, and since there's not a lot of code (just some PTZ functions) I figure it's not necessary to break it into multiple files.  *CAVEAT* is that I'm assuming every camera will implement PTZ the same way with the same code.  If that's not the case, if the iCamView has different types of cameras which do PTZ differently, then you should do option #1 like you intended because with option #2 or #3, any incoming action "MoveRight" to either type of camera will go to a single "MoveRight" action handler within the parent device.  You'd need to put an 'if' block in the MoveRight to see which type of camera it is and handle it appropriately.  In that case, it would probably would be cleaner to have separate implementation files for each method of PTZ implementation, and in the ch_dev_append loop, just specify the correct one for each type of camera.


Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

guest4690

  • Guest
Re: "Delivery failed" message
« Reply #13 on: June 22, 2010, 12:27:39 am »
Is the below still true?  I am trying to create child devices that use their own implementation files.  Anytime I do this though, I hang on "Running Lua Startup."  If I load the same implementation file to a parent device, it works fine.  I've tried removing the handlechildren tag, and still no go.

I guess it (roughly) is.  Can you share some logfiles?

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: "Delivery failed" message
« Reply #14 on: June 23, 2010, 05:30:03 pm »
It's funny... the other day i was getting a missing fileset error in the log for the child devices' imp file.  Now, I am not getting that error, but still hanging on lua startup.  I couldn't find the relevent portion of the log file, so I attached the whole thing.  It's not pretty since I have other issues related to this plugin that I haven't sorted out yet - service related.  Anyway, the parent device is device #64 (ActiveRFID) and I have 2 child devices (RFIDTransmitter) at 65 and 66.
Thanks Javier...
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002