美文网首页
Raspberry Pi 自动抓拍

Raspberry Pi 自动抓拍

作者: 孟想 | 来源:发表于2021-04-26 23:12 被阅读0次
  1. 下载 Raspberry Pi OS images
  2. 安装 Raspberry Pi Imager
  3. 将 image 写入 SDCard


    image.png
  4. 接显示器和键盘,连接 WiFi,开启 SSH 和 VNC,以后就可以不用显示器和键盘了。
  5. 清华源
  6. 更新:sudo apt-get update & sudo apt-get upgrade
  7. 拍照并以当前时间命名照片:
raspistill -o /home/pi/cam/`date +%Y-%m-%d-%H%M%S`.jpg
ls cam
2021-04-26-123001.jpg
  1. 编写计划任务
crontab -e

0,15,30,45 * * * * raspistill -o /home/pi/cam/`date +%Y-%m-%d-%H%M%S`.jpg

居然没反应

  1. 改为脚本/home/pi/script/cam.sh
cat script/cam.sh
raspistill -o /home/pi/cam/`date +%Y-%m-%d-%H%M%S`.jpg

crontab -e
0,15,30,45 * * * * /home/pi/script/cam.sh
  1. 运行成功,每15分钟抓拍一张保存到cam文件夹

相关文章

网友评论

      本文标题:Raspberry Pi 自动抓拍

      本文链接:https://www.haomeiwen.com/subject/tvgerltx.html