linux 树莓派 使用curl向阿里云服务器上传照片

首先,使用fswebcam 这个小工具是用来截取摄像头的图片的,具体指令

sudo fswebcam -d /dev/video0 -r 320x480 --bottom-banner --title "lide@xiaovdiy" /home/pi/t1est.jpg


确认存在USB video 存在。

然后,查看curl是否存在。

 curl -k  -T test.jpg sftp://user:xx123456@ipaddress/data/www/default/gps_car/Uploads/Camera/


上边的user为登陆用户名,:后边为密码。IPaddress为阿里云服务器地址。我的是sftp.

前边的-k  代表不响应ssl验证。

SSL相关,如果关闭安全选项,使用-k参数。

 -k, --insecure
          (SSL)  This  option  explicitly  allows  curl  to perform "insecure" SSL connections and
          transfers. All SSL connections are attempted to be made secure by using the CA  certifi‐
          cate  bundle installed by default. This makes all connections considered "insecure" fail
          unless -k, --insecure is used.

          See this online resource for further details: http://curl.haxx.se/docs/sslcerts.html

否则出现 curl: (51) SSL peer certificate or SSH remote key was not OK

sitemap