Webcam 0.1.1 Released

Posted on
Fri Mar 09, 2018 9:26 pm
jheddings offline
User avatar
Posts: 108
Joined: Dec 01, 2013
Location: Denver, CO

Webcam 0.1.1 Released

Please note that this is an initial release and is missing robust error handling. If you run into trouble, turn on debug logging to help diagnose the issue. I'll add better error messages and more actions over time. Comments and feedback are welcome!

Release notes for this version:

  • Supports saving a local file
  • Supports uploading to FTP server

Visit the Plugin Store for more detail.

Posted on
Sat Mar 10, 2018 8:46 am
Different Computers online
User avatar
Posts: 1846
Joined: Jan 02, 2016
Location: East Coast

Re: Webcam 0.1.1 Released

This looks very promising!

Do I understand correctly that it can retrieve an image from a camera and save it locally?

Is it entirely camera agnostic? By that, I mean is there a type of retrieval URL it can't handle? I realize you can't grab images from cams that don't serve them up, but can it handle both of the following examples?

http://192.168.255.255/jpg/1/image.jpg

http://192.168.255.255/img/snapshot.cgi?size=3

Note the authentication: http://192.168.0.231/tmpfs/auto.jpg?usr ... vryGoodPWD

SmartThings refugee, so happy to be on Indigo. 10.13.6 on an i5 MBP w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKit Bridge, MatplotLib, Plex, uniFAP, Wunderground, Nanoleaf, LED Simple Effects, Airfoil Pro, Grafana.

Posted on
Sat Mar 10, 2018 10:05 am
jheddings offline
User avatar
Posts: 108
Joined: Dec 01, 2013
Location: Denver, CO

Re: Webcam 0.1.1 Released

The plugin doesn't care how the camera serves up the image or even the type of image (jpg, etc). The only requirement is that you have a URL to a static image for the plugin to save. Just be sure when you provide the path to the save filename, you include the full path including both the directory and the file extension. This is the case for both local & FTP actions.

The authentication example will work, as long as it does not require an active HTTP session. e.g. the plugin does not know how to read the credentials from a URL and do something special to log you in. If your camera supports passing username and password as part of the query string, this plugin should have no trouble downloading the image. Of course, I'd like to know if you run into problems to see if we can sort them out.

If you have ideas on other features you'd like to see, please let me know!

Posted on
Thu May 10, 2018 6:36 am
aderrington offline
Posts: 105
Joined: Feb 03, 2015

Re: Webcam 0.1.1 Released

Hi,

I'm trying to use your plugin to retrieve an image from a Hikvision camera, However i'm getting several errors:

Code: Select all
   Webcam Error                    Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 42, in doSaveLocalFile
  File "plugin.py", line 91, in _getImageData
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1227, in http_open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1166, in do_open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 751, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 793, in _get_hostport
InvalidURL: nonnumeric port: 'password123@192.168.0.38'


The url that i can use in chrome is: http://admin:password123@192.168.0.38/S ... /2/picture

I can see that the plug in thinks that the url is trying to change the default port.
Is there anything you can do or recommend to get it working?

Thanks,
Andrew

Posted on
Tue May 15, 2018 10:00 am
jheddings offline
User avatar
Posts: 108
Joined: Dec 01, 2013
Location: Denver, CO

Re: Webcam 0.1.1 Released

Yikes! Yeah, the Python URL handler doesn't support credentials on the URL like a browser does. I need to add fields for authentication to get your setup going. Let me take a look and see what I can do to whip something up.

Posted on
Sat Jun 30, 2018 9:48 pm
jheddings offline
User avatar
Posts: 108
Joined: Dec 01, 2013
Location: Denver, CO

Re: Webcam 0.1.1 Released

Hi Andrew-

Sorry it took me so long to get around to this... I finally got a working version of this plugin that support basic authentication. For your example, take the username and password out of the URL and use the new fields in the action dialog to enter your credentials.

Check out version 0.2.1 or later in the plugin store.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest