基于树莓派实现的可转动的监控摄像头系统

折腾了2个晚上,搞定了基于树莓派的可转动的监控摄像头系统 ,功能包括基于mjpeg的视频监控,基于舵机的左右转动云台,基于php网页的远程监控视频查看和云台控制功能。


视频监控部分使用motion实现,需要无驱摄像头,其实一般的摄像头都行的。

云台使用辉盛9g舵机,驱动程序使用的是ServoBlaster,然后自己用php和jquery写了个控制网页,然后放到已经配置好的nginx+ php5-fpm服务器上。


网页功能包括舵机控制和mjpeg图片流的显示,这个有个缺陷,chrome以外的浏览器对mjpeg格式支持不好,后面视频监控这块需要用ffserver或live555之类的流媒体技术解决,但暂时没有搞定,以后有空再折腾,现在基本够用了。



代码下载: git clone https://github.com/offbye/rpiservocamra.git


安装说明,我在github上用英文写的,就不写中文的了。

To use the program you need to have a php web server, such as Apache+ php or nginx+php.


1 Install usb camra and motion on Raspberry PI
$ lsusb
$ sudo apt-get install  motion
$ motion&


Browse in Chrome Browser: http://yourserver:8081, you will see the camra mjpeg image.


2 Install 9g servo


1) Connent the servo to raspberry pi , there are 3 pins, connect the signal line to GPIO17, the other 2 pin is power, connent to 5v and GND, or use a extra 5V/500mA power supply(recommend).


2) install ServoBlaster
Please read ServoBlaster/README.txt for more information
$: cd ServoBlaster/
$: ls
$:  make servod
$:  sudo ./servod 
$: echo 1=160 > /dev/servoblaster


if the servo connected correctly, it will change position.


3 install Web Control


Copy web to your php web server. then you can browser it in Chorome browser
http://yourserver/web/cam.html

  • 0
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

offbye

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值