Generic Camera Device using local connection (new version now available)

I’m not sure if that is entirely true. I have multiple devicetypes published that people have installed as recently as last week that automatically assign the proper DNI.

They break it, they fix it, then brake it again. Eventually I got tired just keeping up with this bee-es. :smile:

My IP is as follows.

192.168.0.6:99

[quote=“deano12, post:287, topic:3269”]
192.168.0.6:99
[/quote]Your network id would be this
C0A80006:0063

Hmm rather annoying - Changed it to the above (which was the same as the previous it turns out) but still nothing.

I like the get picture button and it just sits at “Taking” and doesn’t do anything else.

Really annoying, but I really do think it is the camera.

Edit: These are the Live Log… Log’s
ee16a56c-977d-473d-b095-b3878165c1d0 4:20:18 PM: debug GET /snapshot.cgi?user=#####&pwd=######### HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.0.6:99

ee16a56c-977d-473d-b095-b3878165c1d0 4:20:18 PM: debug The method is GET
ee16a56c-977d-473d-b095-b3878165c1d0 4:20:18 PM: debug The Header is [HOST:192.168.0.6:99]
ee16a56c-977d-473d-b095-b3878165c1d0 4:20:18 PM: debug Uses which method: GET
ee16a56c-977d-473d-b095-b3878165c1d0 4:20:18 PM: debug Requires Auth: false
ee16a56c-977d-473d-b095-b3878165c1d0 4:20:18 PM: debug path is: /snapshot.cgi?user=#####&pwd=#########
ee16a56c-977d-473d-b095-b3878165c1d0 4:20:18 PM: debug The device id configured is: c0a80006:0063
ee16a56c-977d-473d-b095-b3878165c1d0 4:20:18 PM: debug 0063
ee16a56c-977d-473d-b095-b3878165c1d0 4:20:18 PM: debug IP address entered is 192.168.0.6 and the converted hex code is c0a80006

The camera returns a photo on http://192.168.0.6:99/snapshot.cgi?user######=&pwd=########

port 99 seems odd to me.

Also, keep in mind, the s3 image function is flaky at best. It is fraught with lag and issues. Nothing I can do about that in code.

Can I ask what you think is odd about the port?

Also when you refer to “s3” the only s3 reference I know of is a Samsung Galaxy S3 phone? Is this what you mean?

It refers to the ‘cloud’, specifically the Amazon Simple Storage Service (S3).

Thanks for this awesome device type! This has been super helpful. I had to make a small tweak to get the image capture working though. Hopefully some other community members find this helpful in getting the image capture working.

  • Image capture fix. I’m not sure why, but when the device network ID has lowercase characters in the hex value, it doesn’t want to work. Converting it to all uppercase makes the image capture work flawlessly for me. Not sure why, but read it somewhere else in a post here, but can’t seem to find that post. Edits on lines 95 and 96:
def hosthex = convertIPtoHex(host).toUpperCase()
def porthex = convertPortToHex(CameraPort).toUpperCase()

Thanks. I’ll update the git

that is awesome, I can now use my cameras from my zoneminder install correctly now. I modified the code slightly as each of the cameras uses the same ip and port, after a successful capture my code sets the network id to a random UUID, this allows me to have multiple cameras. admittedly they cannot be triggered all at the same time. but with the uppercase switch this change is flawless. brilliant troubleshooting and find

Was anyone able to get their Hikvision cameras working? I saw some talk earlier in the thread about getting stuck at taking, but didn’t see anything else afterwards. I’ve tried just about every combination but cannot get it to work. @pstuart - have you had any luck testing Hikvision cameras? I am able to use the link and get an image off the camera, but the code is getting hung up somewhere. Any ideas?

No hikvision camera return an image size too large for st to process.

What about getting it to work with Blueiris? I can scale the images with a specific url path. I have it scaled to a 24KB file size (768x1024 - quality 10%), but the “Taking” button still gets stuck.

Did you set the DNI to the blueiris server ip:port or mac?

Patrick,

I just setup your device type on my three dlink cameras. I was able to get it to work, but I ran into an odd problem (seems to be a SmartThings issue, not a problem with your code). With any required preferences (and all fields filled) I would get an error, “please fill out all required fields”. I made all preferences not required (required: false) and got it working.

I was a little confused about whether I needed to make the “Network ID” anything in particular (hex ip and post), but it seems that it can be anything.

Thanks!
Eric

Network Id or DNI will be set automatically based on IP and port.

Yeah agreed on the required stuff.

You can fix that more easily by changing the lower-case x to an upper-case x in the conversion methods…
String hexport = port.toString().format( ‘%04X’, port.toInteger() )
rather than
String hexport = port.toString().format( ‘%04x’, port.toInteger() )

What are the limitation ST has set for image size/quality?

No one really knows.