Author Topic: Webcam Dropbox Uploader - a plugin to store images to dropbox  (Read 64790 times)

Offline martin12345

  • Sr. Member
  • ****
  • Posts: 315
  • Karma: +46/-3
Webcam Dropbox Uploader - a plugin to store images to dropbox
« on: September 13, 2013, 05:05:55 am »
I wanted to store my webcam images periodically (like I used to be able to do with my Vera 2), so I wrote a plugin to send the images to Dropbox. After you link the app to your dropbox account, it will by default send images from all Cameras to dropbox every 10 minutes. You can change the frequency that it uploads, and you can change the length of time that images are stored in dropbox before they are removed. You can also make service calls to send images from one or all of the cameras at any time, so you can integrate it in to more complex scenes. The plugin is now in the app store, so feel free to give it a go and let me know how it works for you;

http://apps.mios.com/plugin.php?id=8741

Martin

Update 19/10/2015 : The URL for instructions had to change. You can find it here now;
http://www.milliesoft.co.uk/2013/09/10/dropbox-webcam-uploader/
« Last Edit: July 12, 2016, 04:19:16 pm by martin12345 »

Offline Piwtorak

  • Hero Member
  • *****
  • Posts: 988
  • Karma: +4/-0
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #1 on: September 13, 2013, 11:27:56 am »
Hello !
I have 5 cameras and is working fine for 3...2 are foscam and 1 panasonic.

but 2 foscam cameras the picture saved has only 1Kbyte and not open...the anothers has between 25 and 32 kbytes and are ok.

what can be wrong ?

thanks for good plug in...
Vera3 (1), Airport Extreme (2), Apple TV (3), Sqblaster (1), GE Switch (3), GE Dimmer (1), Leviton VRCSZ2 (2), GE 45601 (1), Intermatic HA03 (2), GE Zwave Outlet (1), Remote Control Curtain (1) and growing.

Offline martin12345

  • Sr. Member
  • ****
  • Posts: 315
  • Karma: +46/-3
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #2 on: September 13, 2013, 11:43:05 am »
The image URL for the webcam is built up as

http://{user}:{pass}@{ip}{URL}

or if there is no username and password just

http://{ip}{URL}

If your webcams don't work with those exact URLs (e.g. you don't have a slash at the end of ip or start of URL), perhaps that is the problem. Do let me know if that is the case.

Martin

Offline Piwtorak

  • Hero Member
  • *****
  • Posts: 988
  • Karma: +4/-0
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #3 on: September 13, 2013, 12:12:05 pm »
are you taking the user and password from settings in the camera ?


the cameras what not works has for image the url:


/snapshot.cgi

equal the anothers are runnning.
« Last Edit: September 13, 2013, 12:17:09 pm by Piwtorak »
Vera3 (1), Airport Extreme (2), Apple TV (3), Sqblaster (1), GE Switch (3), GE Dimmer (1), Leviton VRCSZ2 (2), GE 45601 (1), Intermatic HA03 (2), GE Zwave Outlet (1), Remote Control Curtain (1) and growing.

Offline martin12345

  • Sr. Member
  • ****
  • Posts: 315
  • Karma: +46/-3
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #4 on: September 13, 2013, 12:14:02 pm »
what user and password is you considering ?
The one you set against the webcam in the username and password field.

Offline Piwtorak

  • Hero Member
  • *****
  • Posts: 988
  • Karma: +4/-0
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #5 on: September 13, 2013, 12:20:04 pm »
the cameras are with the settings ok, user, password, url, mac address and ip.

and being displayed in my apps (homewave, sqremote, etc.)
Vera3 (1), Airport Extreme (2), Apple TV (3), Sqblaster (1), GE Switch (3), GE Dimmer (1), Leviton VRCSZ2 (2), GE 45601 (1), Intermatic HA03 (2), GE Zwave Outlet (1), Remote Control Curtain (1) and growing.

Offline martin12345

  • Sr. Member
  • ****
  • Posts: 315
  • Karma: +46/-3
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #6 on: September 13, 2013, 12:31:11 pm »
Did you try building the URL as described and seeing if it works?

If it does, try running the uploader for one failing webcam in isolation to see if the issue is to do with too many requests close to each other;

Code: [Select]
lul_settings={}
lul_settings["webcamNumber"]=YYY
luup.call_action("urn:milliesoft-com:serviceId:WebcamDropboxUploader1","SendSnapshot", lul_settings,XXX)
replacing XXX with the number of your Webcam Dropbox Uploader device, and YYY with the number of your webcam. You can paste that in Apps -> Develop Apps -> Test Luup Code (lua)  to quickly run it.

Martin

Offline Piwtorak

  • Hero Member
  • *****
  • Posts: 988
  • Karma: +4/-0
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #7 on: September 13, 2013, 03:31:42 pm »
with the code same behavior. picture with 1K and not open.
Vera3 (1), Airport Extreme (2), Apple TV (3), Sqblaster (1), GE Switch (3), GE Dimmer (1), Leviton VRCSZ2 (2), GE 45601 (1), Intermatic HA03 (2), GE Zwave Outlet (1), Remote Control Curtain (1) and growing.

Offline martin12345

  • Sr. Member
  • ****
  • Posts: 315
  • Karma: +46/-3
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #8 on: September 13, 2013, 03:36:23 pm »
Did you try building the URL as described and seeing if it works?

Offline Piwtorak

  • Hero Member
  • *****
  • Posts: 988
  • Karma: +4/-0
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #9 on: September 13, 2013, 03:57:29 pm »
I put this code:

lul_settings={}
lul_settings["webcamNumber"]=50
luup.call_action("urn:milliesoft-com:serviceId:WebcamDropboxUploader1","SendSnapshot", lul_settings,153)


50 is my cam
153 is my plugin.

Vera3 (1), Airport Extreme (2), Apple TV (3), Sqblaster (1), GE Switch (3), GE Dimmer (1), Leviton VRCSZ2 (2), GE 45601 (1), Intermatic HA03 (2), GE Zwave Outlet (1), Remote Control Curtain (1) and growing.

Offline martin12345

  • Sr. Member
  • ****
  • Posts: 315
  • Karma: +46/-3
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #10 on: September 13, 2013, 04:03:21 pm »
Thanks. I was referring to a step earlier than that though. The URL used for the webcam is as follows;

http://{user}:{pass}@{ip}{URL}

Did you try putting the exact values from your device in there and paste the URL in to a browser? If it doesn't work, I may not be doing everything right with the way I build the URL.

Online a-lurker

  • Hero Member
  • *****
  • Posts: 760
  • Karma: +42/-7
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #11 on: September 13, 2013, 09:37:30 pm »
Great plugin idea - I got it all going, authorized, etc and an image was successfully uploaded to Dropbox. I had to restart the LUUP engine for something else I was messing around with. At that point, the DropBox plugin then failed to start up. Checked the log and found this:

Code: [Select]
01 09/14/13 10:58:25.215 LuaInterface::CallFunction_Startup-1 device 87 function lug_startup failed /usr/lib/lua/socket/http.lua:116: bad argument #2 to 'connect' (number expected, got string) <0x2b963680>
01 09/14/13 10:58:25.216 LuImplementation::StartLua running startup code for 87 I_WebcamDropboxUploader1.xml failed <0x2b963680>

Interestingly - even though it says the start up failed, it does in fact upload an image at this point successfully but none there after. If I force it to do an upload, I get a "not ready" in the log and no image is uploaded.

Code: [Select]
08 09/14/13 11:28:19.703 JobHandler_LuaUPnP::HandleActionRequest device: 87 service: urn:milliesoft-com:serviceId:WebcamDropboxUploader1 action: SendAllSnapshots <0x30014680>
02 09/14/13 11:28:19.704 Device_LuaUPnP::HandleActionRequest 87 not ready 0xc823c8 <0x30014680>

I would have looked through the code but I think it's encrypted?  Second number may be the port number?
« Last Edit: September 13, 2013, 10:14:02 pm by a-lurker »

Offline martin12345

  • Sr. Member
  • ****
  • Posts: 315
  • Karma: +46/-3
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #12 on: September 14, 2013, 04:27:18 am »
Yes, the code is encrypted because it contains an app key and app key secret for connecting to dropbox. However, you can see the code without those values in them here;

http://forum.micasaverde.com/index.php/topic,16477.0.html

As for your error, the error message implies a problem making an http connection, which it does to pull the image from the webcam. If it works once, it should continue to work though.

Did you actually save the uploader settings before you restarted the engine? In advanced settings You should have AccessToken and AccessTokenSecret with string values, and optionally SendFrequency and DaysToKeep with numeric values. If you have anything other than numbers in the last two, that could cause a problem.

If worst comes to worst, uninstall and reinstall it.

Martin

Offline melberg65

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #13 on: September 14, 2013, 02:23:14 pm »
This is a fantastic App.  Thank you!!  I've loaded it into my UI5, and I've gotten it hooked up to my DropBox, and its uploading files.  But the files are 1K and they do not open. The Viewer says the files may be damaged or unsupported.

My camera is a FosCam that I bought from the MiCasaVerde site. 

I'm also trying to get a Generic IP dome camera connected.  so I'll want those stills to be uploaded to drop box as well.

Help?

thanks again!!

Offline Crismaison

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +2/-0
Re: Webcam Dropbox Uploader - a plugin to store images to dropbox
« Reply #14 on: September 14, 2013, 03:15:04 pm »
After installing and configuring I get a LUA startup error:

1   09/14/13 21:20:21.398   ctrl_chr[31;1mLuaInterface::CallFunction_Startup-1 device 259 function lug_startup failed /usr/lib/lua/socket/http.lua:116: bad argument #2 to 'connect' (number expected, got string)ctrl_chr[0m __LEAK__ this:8192 start:671744 to 0x1475000 <0x2c09d680>
« Last Edit: September 14, 2013, 03:21:37 pm by Crismaison »
Vera lite - Everspring smoke & flood detectors - Fibaro doorsensors - 2 Foscams - Greenwave 6 node smartplug - Several Switches -Netatmo - PLEG - Twilio - DropBoxuploader - FindmyIphone user