DiVis DVR IP Cameras with POST authentication

I have a Divis DVR system that I want to read IP cameras from. The Divis DVR software presents camera’s at the /special/Cam1.jpg path but requires POST / Form based authentication. I am thinking I will need to write a luup plugin to handle this. Is there any way to do this with the generic ip camera built in device? It appears that it only works with GET authentication, but I wanted to check and see before I start working on a plugin.

I took a crack at building Luup code to make this work. Unfortunately I am having some problems with my implementation code. My thoughts were to setup a timer that executes every 30 seconds to authenticate through the POST command which I tested to work. For some reason the Luup engine is not accepting the implementation file. The code seems good. I’m hoping someone on the forum can help.

17058 root 1644 S grep -F Divis
17058 root 1644 S grep -F Divis
17058 root 1644 S grep -F Divis
01 04/07/16 20:03:06.509 LuImplementation::Parse can’t parse xml /etc/cmh-ludl//I_DivisDVRCamera.xml <0x77e41000>
01 04/07/16 20:03:06.509 JobHandler_LuaUPnP::ParseAllImplementations failed to parse I_DivisDVRCamera.xml <0x77e41000>
09 04/07/16 20:03:10.342 JobHandler_LuaUPnP::Run device 92 Divis Cam 1 room 0 type urn:schemas-upnp-org:device:DigitalSecurityCamera:2 cat 6:-1 id parent 0/0xb317c8 upnp: 0 plugin:0 pnp:0 mac: ip:192.168.12.10 <0x77e41000>

I got this working. My issue ended up being that the xml file had BOM which was causing issues.

To install you simply add a generic IP camera and point it to the correct camera number at /special/Camx.jpg . Then simply make sure the username and password is correct. Add the attached implementation file through the develop app luup files page and then change the implementation file for each created camera to the attached filename.

A couple points of feedback on my plugin which i hope to resolve.

  1. The DVR server tends to have high CPU usage from the recurring post’s. I suspect this is a bug in the webserver, but its worth mentioning nonetheless.
  2. There is no way to disable post auth as far as I can tell. I reached out to Divis but was never given an answer.
  3. The cameras are frequently shown temporarily as a missing device. I suspect there is a way to resolve this through reducing the checking, but i havent figured it out yet.

If anyone has feedback on any of these point’s i would love to hear from you.