Capture and FTP upload a webcam image

To install web cam capture software on the Raspberry Pi

sudo apt-get install fswebcam

To test

fswebcam -d /dev/video0 -r 720x480 webcam.jpeg

Python Code to take picture and upload to web

#!/usr/bin/env python

import os
import ftplib

os.system("fswebcam -d /dev/video0 -r 384x288 /var/www/webcam.jpeg")

print ("Starting FTP")
session = ftplib.FTP('ftp.com','ftp@ftp.com','asdfasdfasdfasdf')
file = open('/var/www/webcam.jpeg','rb') # file to send
session.storbinary('STOR webcam.jpeg', file) # send the file
file.close() # close file and FTP
session.quit()
print ("Finished FTP")
Logitech Pro 9000 HD Webcam
Logitech Pro 9000 HD Webcam $10.00
End Date: Tuesday Jun-26-2018 15:46:05 PDT
Buy It Now for only: $20.00
Logitech QuickCam Pro 9000 Web Cam Carl Zeiss Tessar 20 37
Logitech QuickCam Pro 9000 Web Cam Carl Zeiss Tessar 20 37 $15.00
End Date: Tuesday Jul-3-2018 13:11:59 PDT
Buy It Now for only: $15.00
Logitech Quickcam Pro 9000 USB Autofocus WEBCAM 2 MP
Logitech Quickcam Pro 9000 USB Autofocus WEBCAM 2 MP $20.00
End Date: Thursday Jul-19-2018 10:18:48 PDT
Buy It Now for only: $20.00
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $15.00
End Date: Tuesday Jul-10-2018 6:33:09 PDT
Buy It Now for only: $15.00
NEW Logitech Pro 9000 Webcam w 2 MP Optical Resolution Carl Zeiss Lens Optics
NEW Logitech Pro 9000 Webcam w 2 MP Optical Resolution Carl Zeiss Lens Optics $25.55
End Date: Sunday Jul-22-2018 11:41:58 PDT
Buy It Now for only: $25.55
Logitech WebCam Pro 9000 For Business V U0009 960 000561 3
Logitech WebCam Pro 9000 For Business V U0009 960 000561 3 $2.49
End Date: Saturday Jun-30-2018 9:09:43 PDT
Buy It Now for only: $12.99
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $80.00
End Date: Monday Jul-23-2018 13:29:14 PDT
Buy It Now for only: $80.00
Logitech Pro 9000 Webcam with 2 Megapixel Optical Resolution Free Shipping
Logitech Pro 9000 Webcam with 2 Megapixel Optical Resolution Free Shipping $25.00
End Date: Thursday Jul-12-2018 22:38:17 PDT
Buy It Now for only: $25.00
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $10.00
End Date: Sunday Jun-24-2018 10:17:17 PDT
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $18.70
End Date: Saturday Jul-7-2018 2:47:12 PDT
Buy It Now for only: $18.70

« Previous12345...910

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>