与非网论坛
标题: 摄像头+yeelink实现监控 [打印本页]
作者: 霹雳之火 时间: 2014-9-3 20:40
标题: 摄像头+yeelink实现监控
本帖最后由 霹雳之火 于 2014-9-5 14:23 编辑
说明:不是可以看到实时监控录像,而是香蕉派可以隔断时间上传照片
0准备
usb摄像头
yeelink申请一个账号(大家都会)
网址:www.yeelink.net/
1 安装抓图软件fswebcam
pi@bananapi:~$ sudo apt-get installfswebcam
2 登录Yeelink, 在用户中心增加一个设备, 再为该设备增加个图像传感器.,如图所示,并注意API KEY和图像URL(后面会用到)
(, 下载次数: 183)
(, 下载次数: 147)
(, 下载次数: 166)
3 创建传图片的脚本文件
nano /home/pi/yeelink.sh
并在里面输入下面两行
- sudo fswebcam -d /dev/video0 -r 320x240 --bottom-banner --title "BananaPi @ Yeelink" --no-timestamp /home/pi/yeelink.jpg
- curl --request POST --data-binary @"/home/pi/yeelink.jpg" --header "U-ApiKey:xxxxxxxx" --url http://?????????
复制代码
sudo fswebcam -d /dev/video0 -r 320x240--bottom-banner --title "BananaPi@ Yeelink" --no-timestamp/home/pi/yeelink.jpg
curl --request POST --data-binary @"/home/pi/yeelink.jpg" --header "U-ApiKey: xxxxxxxxxxxxxxxxxxxx" --url
http://???????
将xxxxx替换成API KEY
将http://???????替换成你的图像URL
4 为脚本增加可执行权限
pi@bananapi:~$ chmod +x yeelink.sh
5 添加例行工作
pi@bananapi:~$ crontab –e
在最后一行加上
*/1 * * * * /home/pi/yeelink.sh
6 监控开始运行,上网页看看效果,每隔一分钟就会上传一张照片,从而实现监控
网址:http://www.yeelink.net/user/devices
(, 下载次数: 166)
作者: outstanding1573 时间: 2014-9-3 21:23
不错啊 更新好快啊 顶起

作者: 霹雳之火 时间: 2014-9-3 22:36
outstanding1573 发表于 2014-9-3 21:23 
不错啊 更新好快啊 顶起
哈哈,大家都挺快的
作者: 小菜儿 时间: 2014-9-3 23:03
这个不错,支持
作者: 霹雳之火 时间: 2014-9-4 09:21
小菜儿 发表于 2014-9-3 23:03 
这个不错,支持
谢谢版主支持

作者: brucehelen 时间: 2014-9-4 09:48
继续顶,做的非常好
作者: 霹雳之火 时间: 2014-9-4 15:34
brucehelen 发表于 2014-9-4 09:48 
继续顶,做的非常好
谢谢支持
作者: zyx呵呵 时间: 2014-9-5 09:35
楼主我的为什么没有图像呢?我按照你的教程来的~~可是就是没看到图像~~求指教~!多谢~!
作者: 霹雳之火 时间: 2014-9-5 09:47
本帖最后由 霹雳之火 于 2014-9-5 09:50 编辑
zyx呵呵 发表于 2014-9-5 09:35 
楼主我的为什么没有图像呢?我按照你的教程来的~~可是就是没看到图像~~求指教~!多谢~! ...
是在网页上看不到图像吗?直接运行脚本/home/pi/yeelink.sh看有没有,运行一次就会上传一张,不过有时间限制好像是10s
作者: zyx呵呵 时间: 2014-9-5 13:15
霹雳之火 发表于 2014-9-5 09:47 
是在网页上看不到图像吗?直接运行脚本/home/pi/yeelink.sh看有没有,运行一次就会上传一张,不过有时间限 ...
我感觉是我哪里没有弄对,而且你也没有提到的地方,1.添加例行工作:是不是直接输入那句指令就行了,不用按什么使他运行?(这个。。我是小白、、见谅~)还有就是我的建立设备显示异常,是哪有问题,还是没有连接好、、
作者: zyx呵呵 时间: 2014-9-5 13:21
霹雳之火 发表于 2014-9-5 09:47 
是在网页上看不到图像吗?直接运行脚本/home/pi/yeelink.sh看有没有,运行一次就会上传一张,不过有时间限 ...
这是我刚才运行的,,还是没有成功,,下面就是代码,,你可不可以帮我分析分析。。- bananapi@lemaker ~ $ /home/bananapi/yeelink.sh
- Usage: fswebcam [<options>] <filename> [[<options>] <filename> ... ]
- Options:
- -?, --help Display this help page and exit.
- -c, --config <filename> Load configuration from file.
- -q, --quiet Hides all messages except for errors.
- -v, --verbose Displays extra messages while capturing
- --version Displays the version and exits.
- -l, --loop <seconds> Run in loop mode.
- -b, --background Run in the background.
- -o, --output <filename> Output the log to a file.
- -d, --device <name> Sets the source to use.
- -i, --input <number/name> Selects the input to use.
- -t, --tuner <number> Selects the tuner to use.
- -f, --frequency <number> Selects the frequency use.
- -p, --palette <name> Selects the palette format to use.
- -D, --delay <number> Sets the pre-capture delay time. (seconds)
- -r, --resolution <size> Sets the capture resolution.
- --fps <framerate> Sets the capture frame rate.
- -F, --frames <number> Sets the number of frames to capture.
- -S, --skip <number> Sets the number of frames to skip.
- --dumpframe <filename> Dump a raw frame frame to file.
- -s, --set <name>=<value> Sets a control value.
- --revert Restores original captured image.
- --flip <direction> Flips the image. (h, v)
- --crop <size>[,<offset>] Crop a part of the image.
- --scale <size> Scales the image.
- --rotate <angle> Rotates the image in right angles.
- --deinterlace Reduces interlace artifacts.
- --invert Inverts the images colours.
- --greyscale Removes colour from the image.
- --swapchannels <c1c2> Swap channels c1 and c2.
- --no-banner Hides the banner.
- --top-banner Puts the banner at the top.
- --bottom-banner Puts the banner at the bottom. (Default)
- --banner-colour <colour> Sets the banner colour. (#AARRGGBB)
- --line-colour <colour> Sets the banner line colour.
- --text-colour <colour> Sets the text colour.
- --font <[name][:size]> Sets the font and/or size.
- --no-shadow Disables the text shadow.
- --shadow Enables the text shadow.
- --title <text> Sets the main title. (top left)
- --no-title Clears the main title.
- --subtitle <text> Sets the sub-title. (bottom left)
- --no-subtitle Clears the sub-title.
- --timestamp <format> Sets the timestamp format. (top right)
- --no-timestamp Clears the timestamp.
- --gmt Use GMT instead of local timezone.
- --info <text> Sets the info text. (bottom right)
- --no-info Clears the info text.
- --underlay <PNG image> Sets the underlay image.
- --no-underlay Clears the underlay.
- --overlay <PNG image> Sets the overlay image.
- --no-overlay Clears the overlay.
- --jpeg <factor> Outputs a JPEG image. (-1, 0 - 95)
- --png <factor> Outputs a PNG image. (-1, 0 - 10)
- --save <filename> Save image to file.
- --exec <command> Execute a command and wait for it to complete.
- Warning: Couldn't read data from file "/home/pi/yeelink.jpg", this makes an
- Warning: empty POST.
- curl: option --headerU-ApiKey:90e974947a3f27cc6d9a03f4c1467e85--url: is unknown
- curl: try 'curl --help' or 'curl --manual' for more information
- /home/bananapi/yeelink.sh: line 3: http://api.yeelink.net/v1.0/device/13934/sensor/23136/photos: No such file or directory
复制代码
作者: 霹雳之火 时间: 2014-9-5 13:50
本帖最后由 霹雳之火 于 2014-9-5 13:56 编辑
zyx呵呵 发表于 2014-9-5 13:15 
我感觉是我哪里没有弄对,而且你也没有提到的地方,1.添加例行工作:是不是直接输入那句指令就行了,不用 ...
是直接输入那句指令就行了,表示每隔1分钟会上传图片
新建一个设备,在这个设备下添加传感器,传感器选择图像传感器
sudo fswebcam -d /dev/video0 -r 320x240 --bottom-banner --title "BananapiPi @ Yeelink" --no-timestamp /home/pi/yeelink.jpg
curl --request POST --data-binary @"/home/pi/yeelink.jpg" --header "U-ApiKey: 这里填APIKEY" --url http:这个链接填你的URL
这个你设置对了吗?
(, 下载次数: 29)
作者: zyx呵呵 时间: 2014-9-5 13:55
霹雳之火 发表于 2014-9-5 13:50 
是直接输入那句指令就行了,表示每隔1分钟会上传图片
新建一个设备,在这个设备下添加传感器,传感器选择 ...
嗯~那我就是这样的、、不知道怎么回事了。。
作者: zyx呵呵 时间: 2014-9-5 14:55
顶~~好贴~楼主帮我弄了2个小时,,终于有图像了·~~万分感谢楼主~!
作者: 霹雳之火 时间: 2014-9-5 15:03
zyx呵呵 发表于 2014-9-5 14:55 
顶~~好贴~楼主帮我弄了2个小时,,终于有图像了·~~万分感谢楼主~!
不客气

作者: durui2017 时间: 2017-3-5 17:41
这是我刚才运行的,你可不可以帮我分析分析
pi@bpi-iot-ros-ai:~$ sudo apt-get install fswebcam
[sudo] pi 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
fswebcam 已经是最新版 (20140113-1)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 4 个软件包未被升级。
pi@bpi-iot-ros-ai:~$ nano /home/pi/yeelink.sh
pi@bpi-iot-ros-ai:~$ chmod +x yeelink.sh
pi@bpi-iot-ros-ai:~$ crontab -e
no crontab for pi - using an empty one
crontab: installing new crontab
pi@bpi-iot-ros-ai:~$
欢迎光临 与非网论坛 (https://www.eefocus.com/forum/) |
Powered by Discuz! X3.5 |