Storing Video to External Storage such as a USB Drive

I’m looking to store images locally directly on Vera.

Is it possible to have video stored to an external USB drive (AKA USB Key)? If so, does anyone have a link or recommendations on doing so?

I’m not sure if write privileges to the filesystem are provided to Luup scene/or Luup plug-in code, but if it is you could use os.execute(cmd) to run shell commands.

I assume you are talking about downloading the image from an IP camera to the usb drive, so assuming you have the drive mounted as “/mnt/usb” and the IP camera’s current image is downloadable from “” you could should be able to use something like the following as a Luup scene and then schedule or trigger to run as needed:

os.execute(“curl -o /mnt/usb/ “… os.time() …”.jpg”)

I understand it isn’t the most elegant solution, and I haven’t debugged or tested that code, but it should download the current image from the camera and give it a file name that is the current time in seconds, so as long as you don’t trigger it more than once a second that should be fine. If this would be of interest to you as a solution give it a shot and let me know if you need help debugging it.

Instead of that, you could use luacurl ([url=][/url]) luasocket ([url=][/url]), or luup.wget ([url=][/url])

As for storing in a USB drive, it does work; but you have to manually mount it, typcally something like:

mount /dev/discs/disc0/part1 /mnt/

Of course, you could add an entry to /etc/fstab to make it automount at startup

@javier: Are those modules included with Vera? I went with os.execute because I have more experience with *nix and the “standard” executables included in distros then I do with Lua. I am interested in learning more Lua, is there there a list of if the Lua modules that are included with the Vera?

Hum… that calls for a wiki page. Here’s a quick list:

[ul][li]LuaSocket ([url=][/url])[/li]
[li]LuaFilesystem ([url=][/url])[/li]
[li]LuaCurl ([url=][/url])[/li]
[li]LuaExpat ([url=][/url])[/li]
[li]LuaSec ([url=][/url])[/li]
[li]LuaProfiler ([url=][/url])[/li][/ul]

… and of course, you could simply upload any lua-only module. For example that’s how I’ve ported LuaXPath and plan to add a few extra utilities to make it simpler to use.

@javier, do you now include all of the components of LuaSocket? Last time I checked the SMTP module was missing (for example):

and yes, you could do with a Wiki page for the libs that are included, and what bits aren’t (if like the above example)

You’re right, only the core and mime parts are included; the higer-level modules are missing (http.lua, url.lua, tp.lua, ftp.lua, smtp.lua). Of course, being just Lua files, you could simply upload them yourself.

thanks for the feedback, everyone! It looks like I have some playing around to do. :slight_smile:

is it possible to write this capacity (local image storage) to a plugin so us common mortals can use it?

sure. any ideas about how would you like to use it?

Here’s a thought for the plugin and goal:

  1. Plug-in a USB drive into the back of the Vera.
  2. This storage is automatically allocated for using the web interface to install packages (ipkg)
    … and …
  3. automatically used to store images from IP video cameras for later retrieval.

To do a lot of this by hand you have to manipulate a lot of things (i.e. fstab, fix jffs, etc.). Is there someway a plugin could automate the processing of all of this?

sure. any ideas about how would you like to use it?

javier : Just to store images from a motion activated camera

Yes, but it would tricky to do so and still allow for user configuration files (ie, fstab) to be manually edited for other reasons.

Or what about simply doing a wiki for right now so us novices can figure it out? :slight_smile:

Can anyone assist with steps of configuring a USB drive to be the extra storage in order to store video locally, install updates to the firewall, etc.? I’m having a hard time trying to figure it out.