Getting emails from your raspberry pi doorbell camera

Post on 14-Feb-2017

126 views 0 download

Transcript of Getting emails from your raspberry pi doorbell camera

Emails from the Door Bell Camera

Sending emails from the Raspberry

PiRaspbian configuration

Installing and configuring SSMTP

Make sure your repositories are up-to-date:

sudo apt-get update

Install SSMTP and mail utilities:

sudo apt-get install ssmtp

sudo apt-get install mailutils

Edit the SSMTP configuration file:for Gmail

sudo nano /etc/ssmtp/ssmtp.conf

edit the ssmtp.conf

your GMail address

your GMail addressmatching password

add this 3 lines

Allowing less secure apps to access your accounthttps://support.google.com/accounts/answer/

6010255

2 ways to send an text email

echo "Hello world email body" | mail -s "Test Subject" recipientname@domain.com

mail -s "Message from your Door Bell" recipientname@domain.com < message.txt

body

body

Sending an attachment file

echo "Image attached" | mail -A Maja10.jpg -s “Door Bell" recipientname@domain.com

Building the projectfor

Emails from the

Door Bell Camera

Hardware setupDoor Bell

Raspicam Button Blue Jumper Wire -> Ground Orange Jumper Wire -> Pin 1

Starting Pointcamera with button

Standard image size

The code produces an image with the size of about 2.7MB

Gmail restriction for attachment: 25MB

Inside the C program using the mail command and system function you can

send the mail to the user.

system(“mail -A Maja10.jpg -s ‘Door Bell’ hello@gmail.com < message.txt”)

The final Code

The Email arrivesafter about a minute