[luci] [LuCI] #80: add luci-uvc library from fon-ng (patch included)

LuciTrac trac at luci.subsignal.org
Sat Aug 29 13:19:32 CEST 2009


#80: add luci-uvc library from fon-ng (patch included)
-------------------------------+--------------------------------------------
 Reporter:  reporter           |       Owner:     
     Type:  defect             |      Status:  new
 Priority:  major              |   Milestone:     
Component:  LuCI Applications  |    Keywords:     
-------------------------------+--------------------------------------------
 Here is a patch to add the luci-uvc library from fon-ng
 (http://trac.fonosfera.org/fon-ng/browser/trunk/luci/libs/uvc). No idea if
 this is the right way of doing it. The uvc library builds but on the
 router I get:
 {{{
 root at OpenWrt:~# lua test.lua
 lua: error loading module 'uvc' from file '/usr/lib/lua/uvc.so':
         File not found
 stack traceback:
         [C]: ?
         [C]: in function 'require'
         test.lua:3: in main chunk
         [C]: ?
 root at OpenWrt:~# ls -ahl /usr/lib/lua/uvc.so
 -rwxr-xr-x    1 root     root        11.7K Aug 28 20:11
 /usr/lib/lua/uvc.so
 root at OpenWrt:~# cat /root/test.lua
 #!/usr/bin/lua

 local uvc = require("uvc")
 local i = 0
 if uvc then
         while true do
                 local res
                 os.execute("sleep 1")
                 i = i + 1
                 if i % 2 == 1 then
                         res = uvc.grab()
                 else
                         res = uvc.dump("abc.jpg")
                 end
                 if res == false then
                         print("no cam attached")
                 elseif res == true then
                         print("got snapshot")
                 elseif type(res) == "string" then
                         print("got raw data")
                 else
                         print("Error, cam was removed")
                 end
         end
 end
 root at OpenWrt:~#
 }}}

-- 
Ticket URL: <http://luci.subsignal.org/trac/ticket/80>
LuCI <http://luci.subsignal.org/trac>
LuCI - Lua Configuration Interface


More information about the luci mailing list