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:
-
remove the handlechildren flag.
-
Add I_iCamViewPTZ.xml to the D_ICamView.xml device spec so that the parent has the implementation, like this:
I_ICamView.xml
I_iCamViewPTZ.xml
- 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.