HG255D OpenWrt下301摄像头折腾
时间:2014-5-21 13:26 热度:4433° 评论:0 条

| 本帖最后由 eaglefly 于 2013-4-16 20:19 编辑 X宝一个HG255d,已刷OpenWrt Attitude Adjustment 12.09-rc1 就想把闲置破摄像头废物利用起来 插上摄像头 root@HG255D:/# lsusb Bus 001 Device 002: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 Webcam 认出摄像头 root@HG255D:/# dmesg | grep usb 没看到有input, 说明驱动没装 1. 安装驱动: root@HG255D: opkg update root@HG255D: opkg install kmod-video-gspca-zc3xx 提示内核版本不对,google了很多办法,比如降内核,太麻烦,灵机一动,手动改依赖版本: 先找到自身内核版本: root@HG255D:/# opkg files kernel Package kernel (3.3.8-1-9c1082de6aac3209e490273505f237bc) is installed on root and has the following file 然后在 root@HG255D:/# vi /tmp/opkg-lists/attitude_adjustment 找到kmod-video-gspca-zc3xx, 把Depends: kernel (=3.3.8-1-243e356d4c2adb7129f20fcae9ea219a) 改成Depends: kernel (=3.3.8-1-9c1082de6aac3209e490273505f237bc) 然后再 root@HG255D: opkg install kmod-video-gspca-zc3xx 就能安装成功了 2. 改mjpg-streamer 配置文件,否则起不来 root@HG255D:/# vi /etc/config/mjpg-streamer config mjpg-streamer 'core' option device '/dev/video0' option resolution '640x480' option fps '5' option www '/www/webcam' option port '8080' option enabled 'true' option PassWordLogin '1' option username 'xxxx' option password 'yyyy' 关键是要把 option enabled 改为'true' 3. 改mjpg-streamer脚本,使能用户密码 root@HG255D:/# vi /etc/init.d/mjpg-streamer 改start_instace()如下,主要加了用户密码的参数 --c start_instance() { local s="$1" section_enabled "$s" || return 1 config_get device "$s" 'device' config_get resolution "$s" 'resolution' config_get fps "$s" 'fps' config_get www "$s" 'www' config_get port "$s" 'port' config_get user "$s" 'username' config_get passwd "$s" 'password' [ -c "$device" ] || { error "device '$device' does not exist" return 1 } service_start /usr/bin/mjpg_streamer --input "input_uvc.so \ --device $device --fps $fps --resolution $resolution" \ --output "output_http.so --www $www --port $port --c $user:$passwd" } 4.启动开工: root@HG255D:/# cd /etc/init.d root@HG255D:/etc/init.d# ./mjpg-streamer enable root@HG255D:/etc/init.d# ./mjpg-streamer start |


捐赠支持:如果觉得这篇文章对您有帮助,请“扫一扫”鼓励作者!
相关文章本文作者:沁雨寒 文章标题: HG255D OpenWrt下301摄像头折腾
本文地址:https://blog.sxx1314.com/router-test/24.html
版权声明:若无注明,本文皆为“unix 软硬件 技术宅 ”原创,转载请保留文章出处。百度已收录
本文地址:https://blog.sxx1314.com/router-test/24.html
版权声明:若无注明,本文皆为“unix 软硬件 技术宅 ”原创,转载请保留文章出处。百度已收录















