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

Patrick,

I just pulled down your version:Generic Camera Device v1.0.07102014
but I’m still not getting the picture to take.

I also took Jotto’s advice and pulled down the size (size=1 ) on my Sercom but no success.

Here’s the log from the test I did in the IDE, and the specific config below that. Any ideas ?

4:30:58 PM EDT: debug GET /img/snapshot.cgi?size=1 HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 10.0.1.13:80

4:30:58 PM EDT: debug The method is GET
4:30:58 PM EDT: debug The Header is [HOST:10.0.1.13:80]
4:30:58 PM EDT: debug Uses which method: GET
4:30:58 PM EDT: debug Requires Auth: false
4:30:58 PM EDT: debug path is: /img/snapshot.cgi?size=1
4:30:58 PM EDT: debug The device id configured is: 0a00010d:0050
4:30:58 PM EDT: debug 0050
4:30:58 PM EDT: debug IP address entered is 10.0.1.13 and the converted hex code is 0a00010d


Camera IP Address: 10.0.1.13
Camera Port: 80
Camera Path to Image: /img/snapshot.cgi?size=1
Does Camera require User Auth?: False
Does Camera use a Post or Get, normally Get?: GET
Camera User:
Camera Password:

It has to do with the timeout on the hubaction, not necessarily the size of image.

The samsung cameras appear to be really slow in rendering the image or they aren’t returning a valid image type vs sending text/html or base64 encoded image.

I don’t have one to test with, so can’t really help much.

@gorgas99 I assume you are getting an image if you paste http://10.0.1.13:80/img/snapshot.cgi?size=1 without it popping up an authorization window?

It appears the response from the device isn’t getting parsed, so really can’t do much then doublecheck all the settings and confirm the hub is on the same network?

1 Like

Yep working for me again :slight_smile: Thanks!

Hub is on the same network & subnet. Yes hitting the URL via a browser works without issue. What BAFFLES me is that the same camera on my NJ hub works fine…

I’m willing to donate some postage and a test camera to ‘the cause’.

Hey all,
I just recently got started with smartthings, so I’m new to the platform, as well as the groovy language.

I’m trying to get this device type working for a D-Link DCS-930L I had lying around.

When I invoke the take method it seems that the hub is sending a properly formatted request to the camera, and then sending a response to my device type, however it seems that the response event description is different than the parse method expects. The description has no value for bucket or key.

The exact description I’m recieving is:
index:01, mac:B0C554104C8D, ip:C0A801BE, port:0050, requestId:30f43224-d9d9-4011-9136-a3f3540c3d71

Any ideas?

What path and method did you use in the device prefs?

My preferences are as follows:
Name Type Value CameraAuth bool true CameraIP string 192.168.1.190 CameraPassword string CameraPath string /image/jpeg.cgi CameraPort string 80 CameraPostGet string get CameraUser string admin

Hey Stuart, your code is no longer available on github. Did you pull it on purpose?

Nope, just reorganizing my git to hook up to the IDE

Its now at https://github.com/pstuart/smartthings-ps/blob/master/devicetypes/generic_camera.groovy

Just one folder deeper.

Patrick figured this out… It has nothing to do with the code or ST.

It turns out my DSL was fragmenting (the MTU was wrong) so it wasn’t sending the PIC fast enough.

I changed the DSL router to bridging mode and it started working !

THANK YOU SO MUCH PATRICK !!!

1 Like

@pstuart I just got my DCS-942L working with this code and wanted to use it as a base in order to add some desired functionality. Is it possible to add a toggle that changes the motion detection state on the camera? The URLs that it needs to pass are as follows :

ON: http://username:pass@IP:port/config/motion.cgi?enable=yes&pir=yes
OFF: http://username:pass@IP:port/config/motion.cgi?enable=no&pir=no

I tried merging your code with some code I found for the DCS-930 but haven’t had any luck so far. Any help is greatly appreciated.

Basic question: do I need to have port forwarding setup in my router for this to work, or should I be able to have local network access to the camera? I’ve got a Foscam-type camera (Hootoo brand), but can’t get this code or the Smartthings Foscam code to work.

Local. Never port forward.

Ok, that’s what I thought. Guess I need to do some troubleshooting. Can’t figure out why it won’t work.

Just set this up with some cheap wanscams and it works perfectly, awesome job and thank you!

Hey guys I have several Hikvision cams and am trying to set this up.

I can see an image perfectly when I go this url

http://user:pass@xxx.xxx.xxx.xxx:80/Streaming/Channels/1/picture

However for some reason I cant get the image to show up on the device. Here is the log…
70d33323-f4bc-4b35-9d1e-4b25145f1bdd 3:26:19 PM: debug GET /Streaming/channels/1/picture HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.2.204:80
Authorization: Basic *************************

70d33323-f4bc-4b35-9d1e-4b25145f1bdd 3:26:19 PM: debug The method is GET
70d33323-f4bc-4b35-9d1e-4b25145f1bdd 3:26:19 PM: debug The Header is [HOST:192.168.2.204:80, Authorization:Basic *********************
70d33323-f4bc-4b35-9d1e-4b25145f1bdd 3:26:19 PM: debug Uses which method: GET
70d33323-f4bc-4b35-9d1e-4b25145f1bdd 3:26:19 PM: debug Requires Auth: true
70d33323-f4bc-4b35-9d1e-4b25145f1bdd 3:26:19 PM: debug path is: /Streaming/channels/1/picture
70d33323-f4bc-4b35-9d1e-4b25145f1bdd 3:26:19 PM: debug The device id configured is: c0a802cc:089a
70d33323-f4bc-4b35-9d1e-4b25145f1bdd 3:26:19 PM: debug 089a
70d33323-f4bc-4b35-9d1e-4b25145f1bdd 3:26:19 PM: debug IP address entered is 192.168.2.204 and the converted hex code is c0a802cc

Hi,

I just got this working with a Dlink 932L. Would it be possible to add a functionality to send the picture over email?

Thanks!

You can’t send it to your email directly that I know of but you can enable motion detection on the camera itself and then have it email you pictures or video when it detects motion. You’d have to set that up using the local settings on the camera itself.

Then you can modify my D-Link DCS-942L device type to pass the correct URI to enable/disable motion detection through smartthings: [OBSOLETE] D-Link DCS-942L Day/Night IP Camera DeviceType - Full Feature Support (Now With Video Streaming!)

Thanks Ben,

That code looks mutually exclusive to Patrick’s code? As in I should remove Patrick’s Generic Camera Device Type?

i’ll give it a try later.