Does Vera supports USB Mass Storage?
Yes, it does. For example, when we’re doing debugging and want large, verbose logs we plug a USB drive into Vera’s spare port and make the log directory a symlinc to that drive. Vera has a full openwrt installation, so you could add an ftp server and other stuff like that to serve files from the usb drive. There are UPNP stacks available you can run on it too, although our stock firmware doesn’t include them since our goal with Vera is greater ease of use instead of more features so it’s really easy for a non-techie consumer. But it’s an open platform so the tech guys can do all sorts of things with it.
How much space (flash/RAM) is available for optware on the device?
If I’m not mistaken the original device had 4Mb/32Mb, but I have no idea how demanding is Vera resource wise…
BTW, speaking of USB - does Vera supports USB webcams?
There’s about 14MB of RAM free. We use it for a RAM drive that’s mounted as /tmp, and to store the logs, which are in /tmp/logs/cmh. You can edit the conf file /etc/cmh/cmh.conf to change the frequency of log rotation and their verbosity.
We didn’t add any functionality for USB webcams, so it won’t be integrated into Vera. There might be some open source stuff for openwrt that works. If you can figure out how to add a webcam and have an internal URL resolve to a jpg file with the current frame you could add the camera manually on the devices tab, put the URL in, and then you could view it on the phone app and within Vera.
325xi here is some info on a supported usb webcam under openwrt:
Webcam with the Linux UVC driver
Below works to configure and use a Logitech Quickcam Pro for Notebooks (2007) webcam. Tested with trunk.
ipkg install kmod-video-uvc kmod-usb2 uvc-streamer
A UCI configuration file and init script for the uvc-streamer:
/etc/config/uvc-streamer
config uvc-streamer
option device ‘/dev/video0’
option resolution ‘640x480’
option framespersecond ‘5’
option port ‘8080’
option enabled ‘1’
/etc/init.d/uvc-streamer
#!/bin/sh /etc/rc.common
Copyright (C) 2007 OpenWrt.org
START=50
SSD=start-stop-daemon
NAME=uvc_stream
PIDF=/var/run/$NAME.pid
PROG=/sbin/$NAME
append_bool() {
local section=“$1”
local option=“$2”
local value=“$3”
local _val
config_get_bool _val “$section” “$option” ‘0’
[ “$_val” -gt 0 ] && append args “$3”
}
append_string() {
local section=“$1”
local option=“$2”
local value=“$3”
local _val
config_get _val “$section” “$option”
[ -n “$_val” ] && append args “$3 $_val”
}
start_service() {
local section=“$1”
args=“”
append_string “$section” device “-d”
append_string “$section” resolution “-r”
append_bool “$section” framespersecond “-f”
append_string “$section” port “-p”
config_get_bool “enabled” “$section” “enabled” ‘1’
[ “$enabled” -gt 0 ] && $SSD -S -p $PIDF -q -x $PROG – -b $args
}
stop_service() {
killall $NAME 2>&1 > /dev/null
# FIXME: Fix Busybox start-stop-daemon to work with multiple PIDs
# $SSD -K -p $PIDF -q
}
start() {
config_load “uvc-streamer”
config_foreach start_service “uvc-streamer”
}
stop() {
config_load “uvc-streamer”
config_foreach stop_service “uvc-streamer”
}
Make the init script executable
chmod a+x /etc/init.d/uvc-streamer
Make changes to the config file if needed.
Start uvc-streamer
/etc/init.d/uvc-streamer start
To activate uvc-streamer on next boot
/etc/init.d/uvc-streamer enable
Now open the URL http://192.168.1.1:8080/ in the Firefox browser or VLC and watch the MJPEG stream. Also seewebcampage in the wiki if your webcam needs other drivers.
Can this be done on Vera at all?
root@HomeControl:~# ipkg install kmod-video-uvc kmod-usb2 uvc-streamer
Nothing to be done
An error ocurred, return value: 4.
Collected errors:
Cannot find package kmod-video-uvc.
Check the spelling or perhaps run ‘ipkg update’
Cannot find package kmod-usb2.
Check the spelling or perhaps run ‘ipkg update’
Cannot find package uvc-streamer.
Check the spelling or perhaps run ‘ipkg update’
Theoretically yes, practically I’ve tried with two usb cameras (philips spca5xxx and another older one) but I didn’t managed to make them work acceptable. Also it seems that it takes some CPU processing the images.
Note: ipkg install doesn;t work, you’ll need to download the package from http://downloads.openwrt.org and unpack it with tar, then copy the binaries where do you want, else you can try using opkg and install packages on an usb drive directly.
Well if it doesn’t work well anyways…
Said that, may be you know some alternative - small inexpensive devices that can be flashed with Linux based opt- or firmware, and act as USB webcam server, to be used with Vera?
Too bad SLUG isn’t there anymore… Sheevaplug would be ideal match, but at $100 it’s a bit too expensive for the purpose…
I’ve attached a USB drive and it’s mounted… I’ve tried several syntax variations on the “ln -s” command to redirect /var/log/cmh to /mnt with no luck.
Any suggestions?
I want to create a symlinc and start writing the log files in the /var/log/cmh directory to the USB drive so that I can increase the log file size of the LuaUPnP.log file.
Thanks
For those who care to do this…
I finally got this working the way I wanted. I edited the /etc/init.d/custom-user-startup script. The following is what mine looks like:
#!/bin/sh /etc/rc.common
START=90
place your own startup commands here
REMEMBER: You MUST place an ‘&’ after launching programs you
that are to continue running in the background.
i.e.
BAD: upnpd
GOOD: upnpd &
Failure to do this will result in the startup process halting
on this file and the diagnostic light remaining on (at least
for WRT54G(s) models).
Mount the USB Key
mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt &
#Move the /tmp/log/cmh directory out of the way
mv /tmp/log/cmh /tmp/log/cmh.old &
Re-direct /tmp/log/cmh to /mnt (the USB Drive)
ln -s /mnt /tmp/log/cmh &
Note: I had to format the USB key as “ext2” file system prior to this command actually working. Many other people had tried to re-direct symlinks to a USB drive using the default FAT file system and received an error message (as I did early on in this process). I found a Unix forum where they explained that this was a “known” limitation and suggested formatting the USB drive with ext2 or ext3.