|
本文参考了wiki网站,并通过我亲自实验通过,觉得挺有用的,就写出来和大家共享。703n的外部硬件资源很少,因此能充分利用板上的资源就可以可以弥补美中的不足,废话不说,看下面:
这里要实现的功能是按下复位键,就触发事件,具体什么事件,可以由自己决定。
原理:The reset button is handled by the button-hotplug kernel driver,so whenever the reset button is pressed or released,a hotplug event is generated by the kernel.
步骤:
1. 安装软件"kmod-gpio-button-hotplug";
2. 登入703n,键入命令:
#mkdir -p /etc/hotplug.d/button //创建button文件
#cd /etc/hotplug.d/button
#vi buttons //编写触发事件的脚本
例如:buttons的内容可以如下,
- #/bin/sh
- /etc/init.d/wificar restart
复制代码
这样,可以在每次重插摄像头时,启动摄像头,免去了登入703n的麻烦。
3. 键入命令:
#chmod +x /etc/hotplug.d/button/buttons 4. 这时,去按复位键,再松开,便会触发去执行/etc/hotplug.d/buttons脚本,建议大家可以学学linux脚本,这样可以更快捷的使用OpenWrt. |
评分
-
查看全部评分
|