Was able to easily add my linux “motion” webcam to ST using this device type - working (with the edit posted above for the image name) on my Android phone. Thanks. Now to add a few Android stick - based cams
I finally got the URL to get my new HD (1920x1080) Samsung camera to operate with a derivation of this device type that supports digest authentication.
However, most of the time I don’t get a full image. In that case, the next time I press the Take button, I will never get an image. If I then go off the device screen and back in, it will work the next time. So it basically works, then does not work, then works again, etc. (works = takes a photo and displays it in the carousel). A couple times I got full photos and then the device type works as expected.
When I look in the logs, I don’t see the parse() function called when it does not work, and I do see the parse() function called when it does work.
Is there some kind of size limit or timeout that applies to this? When I invoke the URL in the browser, the camera generally responds within a second or so. I also do not have this issue on the other cameras set up with the same device type. They are 640x480. I haven’t found a way to get smaller snapshots from the HD camera yet, although I did read earlier in this thread where even larger images do work.
Has anyone seen this before?
Yeah, there are a couple undocumented timeouts that can cause issues.
Here is why images in ST just sucks via cameras and local hubaction.
The request from the app has to go up to the cloud.
Cloud sends request to hub to request local hubaction.
hub waits for a response.
Hub gets response, has to relay response (in this case, bytestream of the image) back up to cloud. (hub has tiny amount of memory to process bytestream)
Cloud has to store bytestream into Amazon S3 and get key and bucket.
Cloud fires parse function
Cloud relays key / bucket back down to mobile app.
Mobile app uses key / bucket to access image in Amazon S3.
If the hub loses packets, or S3 times out, the image will not display, parse won’t fire, etc.
Wifi camera’s are notorious for interupting the static image with the next static image. They were never really meant for still frame grabbing.
Hopefully this will get better with hub v2 and ST’s video services.
Thanks for the reply. I guessed as much about the timeouts.
I’ve got a request out to Samsung Techwin to see if they can provide me with the HTTP request parameters to set the image size. I’m not holding my breath, though…
I don’t need a 1920x1080 picture for the camera, and reducing the size seems to make the device much more reliable.
Hey @pstuart - I have been using your generic camera device for past few months with great success! Past 1week my camera is no longer viewable in the generic camera app. Has something changed with the code? I use a Mobotix camera… can still access image capture via all settings I have entered in the app.
Edit Also wanted to note, I used to have a custom image saved for the button in my ‘Things’ and that no longer appears, the default dropcam looking icon is now there
Yeah st broke it again. Please open a support ticket with st
So here’s the weird thing… I have 3 hubs on my account all setup the same way. The sercom camera off the NJ hub has been working FLAWLESSLY since day one (and it is still working today). Yet the same camera, running the same code in VT is NOT working.
The VT hub is the same version of hub, setup with the same router/firewall, same Sercom camera, same device code from Patrick (thanks again by the way). Manually go to the IP/port/image and it shows the pic as it should.
When I look at the ST log for the VT hub camera, it says the ‘take’ command was sent, but I never see a reply.
Any thoughts ?
The camera is a sercom (I think it is a sercom 8021) :
IP 10.0.1.13
Port 80
No authentication required.
Image path is: /img/snapshot.cgi?size=3
THANKS
When I use the IDE to test with the NJ camera ( the one that WORKS ) I see one additional like in the debug output that I don’t see on the VT camera (which isn’t working):
debug: Parsing 'index:01, mac (my MAC & port) device-conn-temp: key…
That line does NOT show up on the VT camera (which isn’t working).
That means that the response from the camera is not sent to the device type code. Please check your IP address and device network id in the IDE to make sure that they match. The DNI should be set to the IP address : port in hex.
Even with the DNI set correctly, I still sometimes don’t see a response from my HD camera. As mentioned in an earlier post, I guess it runs into some timeout issue due to the bigger image size.
You can try and delete the device and add it again, but I have run into ghost devices that way.
I have found the camera integration to be an ongoing project, with various random issues cropping up every now and again.
I’ve created this a few times and a few ways. For some reason it’s not executing part of the code to push out the key…
The network device (in hex) looks likes it matches the IP. See device config details below:
Name VT_Sercom821_Test
Label VT-Indoor Camera
Type Sercom821 Camera Device
Version Published
Device Network Id 0a00010d:0050
Status INACTIVE
Hub VT
Last Activity At 2015-06-07 12:58 PM EDT
Date Created 2015-06-07 12:18 PM EDT
Last Updated 2015-06-07 12:58 PM EDT
Data No data found for device
Current States No states found
Preferences (edit)
Camera IP Address: 10.0.1.13
Camera Port: 80
Camera Path to Image: /img/snapshot.cgi?size=3
Does Camera require User Auth?: false
Does Camera use a Post or Get, normally Get?: GET
Camera User:
Camera Password:
If it’s the SmartCAM HD, here’s the path that should allow you to adjust the resolution:
/cgi-bin/video.cgi?msubmenu=jpg&resolution=3
The 3 will get you 1280x720. Try other resolutions to find one you like (in the range of 0-12, I think).
Also works with mjpg instead of jpg if you want video instead of a snapshot
It is a SNH-E6413BN from Costco. The URL you posted, does not work for this camera. There is very little information available for this camera. The path to get a picture is:
/stw-cgi/video.cgi?msubmenu=snapshot&action=view
It doesn’t support resolution, size or profile parameters with the above URL, but I am willing to try any other suggestions.
Great work on the device code! After tinkering for quite some time I found my camera file path and when i hit take I get something that says camera image is smartthings-smartsense-camera: c0a8…:1f44_… (some more letters/numbers).jpg when I plug it into https://graph.api.smartthings.com/api/s3/smartthings-smartsense-camera/[image]
I get the actual image, but as far as seeing it in the app I cannot. Is there currently a way to get it to work?
Thanks
Evan
Make sure you are using the latest code, the most recent app version seems to have issues with : in image names.
Added a fix to a recent unannounced change to eval true/false as a bool instead of a string. Go figure.
Hey, so I updated to your newest one and now I get the following:
10:49:18 PM: debug GET /cgi-bin/viewer/video.jpg?streamid=1 HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.1.103:8004
10:49:18 PM: debug The method is GET
10:49:18 PM: debug The Header is [HOST:192.168.1.103:8004]
10:49:18 PM: debug Uses which method: Get
10:49:18 PM: debug Requires Auth: false
10:49:18 PM: debug path is: /cgi-bin/viewer/video.jpg?streamid=1
10:49:18 PM: debug The device id configured is: c0a80167:1f44
10:49:18 PM: debug 1f44
10:49:18 PM: debug IP address entered is 192.168.1.103 and the converted hex code is c0a80167
Patrick -
Your latest code still does not work for either of my cameras (used to work until recently). The live log stops at the GET command:
6:26:28 AM: debug GET /cgi-bin/video.cgi?msubmenu=jpg&resolution=6 HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.1.10:80
Authorization: Basic YWRtaW46VGhlQmlnQWw=
6:26:28 AM: debug The method is GET
6:26:28 AM: debug The Header is [HOST:192.168.1.10:80, Authorization:Basic YWRtaW46VGhlQmlnQWw=]
6:26:28 AM: debug Uses which method: GET
6:26:28 AM: debug Requires Auth: true
6:26:28 AM: debug path is: /cgi-bin/video.cgi?msubmenu=jpg&resolution=6
6:26:28 AM: debug The device id configured is: c0a8010a:0050
6:26:28 AM: debug 0050
6:26:28 AM: debug IP address entered is 192.168.1.10 and the converted hex code is c0a8010a
Additionally, your refresh button calls poll(), which doesn’t exist in your SmartApp…
Seems that perhaps parse() isn’t getting invoked (or something).
This isn’t part of a SmartApp. Nothing in my code even has a refresh or poll action. This is inherent in ST deviceTypes.
I fixed the issue with the parse not getting the s3 code. Again the naming of the image now can’t have : and the deviceID has it in, go figure.
The latest code from my github should now work.
My (Mobotix Q25) is now back up and running!!! (Again, has always worked with this flawlessly until recently).
If anyone is having issues with ‘Take’ button freezing blue or image not appearing I would suggest you double check and ensure the image you are trying to pull is a low size. With my camera I can change the path and get different image sizes and JPEG quality. For me the app stopped functioning above 1024x768 and 60% JPEG Quality. (Tried 1280x960, 1920x1080, and 2048x1536 but in each instance the take Button remained Blue & no image would ever appear).
Thanks for the code update @pstuart and thanks for your ongoing efforts in trying to get generic cameras up and running in ST (know it isn’t easy with all the different variables between cameras and services between to snap image, import and exporting image).
Okay so I finally have 4 cameras working, they are connected to an NVR two work using the local IP address and the other 2 I had to forward their port and use my WAN IP address to get them to work. No idea why it won’t work on local, but I feel it is the camera itself. Anyway great job @pstuart I love the integration. On a side note I can’t get 2560X1920 to work, but I assume that it is due to the size of the image as others have had issues but i do get 1920X1080.