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 QuickCam Pro 9000 2MP Webcam Carl Zeiss Optics w Dukane Stand
Logitech QuickCam Pro 9000 2MP Webcam Carl Zeiss Optics w Dukane Stand $29.95
End Date: Wednesday Sep-13-2017 14:51:10 PDT
Buy It Now for only: $29.95
Lot of 5 Logitech Pro 9000 Webcams
Lot of 5 Logitech Pro 9000 Webcams $49.99
End Date: Sunday Sep-10-2017 18:00:13 PDT
Buy It Now for only: $49.99
USED Logitech WebCam Pro 9000 V U0009 Microsoft Lifecam Studio Webcam
USED Logitech WebCam Pro 9000 V U0009  Microsoft Lifecam Studio Webcam $18.75
End Date: Friday Sep-8-2017 15:38:34 PDT
Buy It Now for only: $18.75
Logitech QuickCam Pro 9000 Web Cam Auto Focus CARL ZEISS Optics Lens NEW
Logitech QuickCam Pro 9000 Web Cam Auto Focus CARL ZEISS Optics Lens NEW $29.00
End Date: Sunday Aug-20-2017 9:23:02 PDT
Buy It Now for only: $29.00
LOT OF 10 Logitech Webcam Pro 9000 860 000210 V UBM46 860 000228
LOT OF 10 Logitech Webcam Pro 9000 860 000210  V UBM46 860 000228 $89.24
End Date: Saturday Sep-16-2017 9:57:35 PDT
Buy It Now for only: $89.24
Logitech QuickCam Pro 9000 Web Cam Carl Zeiss Optics Autofocus HD
Logitech QuickCam Pro 9000 Web Cam Carl Zeiss Optics Autofocus HD $39.99
End Date: Friday Sep-15-2017 5:34:11 PDT
Buy It Now for only: $39.99
Logitech QuickCam Pro 9000 Webcam Web Camera V U0009 w 2MP Autofocus Glass Lens
Logitech QuickCam Pro 9000 Webcam Web Camera V U0009 w 2MP Autofocus Glass Lens $7.99
End Date: Saturday Sep-2-2017 22:31:07 PDT
Buy It Now for only: $7.99
Logitech QuickCam Pro 9000 Webcam Auto Focus Carl Zeiss Optics
Logitech QuickCam Pro 9000 Webcam Auto Focus Carl Zeiss Optics $19.00
End Date: Tuesday Sep-5-2017 19:46:23 PDT
Buy It Now for only: $19.00
LOGITECH QUICKCAM PRO 9000 2MP Web Cam Carl Zeiss Optics with Autofocus V UBM46
LOGITECH QUICKCAM PRO 9000 2MP Web Cam Carl Zeiss Optics with Autofocus V UBM46 $29.95
End Date: Wednesday Sep-13-2017 20:13:37 PDT
Buy It Now for only: $29.95
Logitech Pro 9000 Webcam V UBM46 Computer Camera USB
Logitech Pro 9000 Webcam V UBM46 Computer Camera USB $14.99
End Date: Tuesday Aug-22-2017 17:27:29 PDT
Buy It Now for only: $14.99

« Previous12345678

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>