Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Raspberry Pi is wired up as a dedicated email notifier - once in 60 secs.

Raspberry Pi is wired up as a dedicated email notifier - once in 60 secs.

Ratings: (0)|Views: 74|Likes:
Published by S Bera
Raspberry Pi is wired up and programmed as an email notifier of your Gmails. Every time it detects an email it notifies by lighting different LEDS or running different switches.
Raspberry Pi is wired up and programmed as an email notifier of your Gmails. Every time it detects an email it notifies by lighting different LEDS or running different switches.

More info:

Published by: S Bera on Jul 10, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

03/03/2015

pdf

text

original

 
Raspberry Pi as an email notifier
How about making Raspberry Pi a dance attendance to your gmail inbox ? Every time amail appears in the gmail inbox , it raises an alarm or a GREEN E! glows up showing thetime "or an email received# $ame way a RE! E! glows when there is no email in theinbox# $ince Raspi is a per"ect slave , it will be doing this %ob once in every &' seconds without"ail# (ell, here it is# )irst get these so"twares installed on your Raspi# sudo apt*get update sudo apt*get install python*deb sudo apt*get install python*pip sudo pip install "eedparser )or installing the "eedperser it may take repeated attempts as the server seem to be +uiteunavailable these days but it gets installed eventually#ircuit diagram-.he relay drive with $/0'' with &volt relay is optional#
 
Python script-***** nano email#py *******
123usr3bin3env pythonimport RPi#GP45 as GP45,"eedparser, timeGP45#setwarnings6)alse7 1ignoring the alarms!E89G : 09$ERN;<E : =myid= 1 %ust the part be"ore the > sign, add yours hereP;$$(5R! : =mypassword= myo""set : ' 1 no o" unread message to detect mydelay : &' 1 check mail every &' secondsGP45#setmode6GP45#8<7GREEN : 0RE! : @AGP45#setup6GREEN, GP45#59.7GP45#setup6RE!, GP45#59.7GP45#output6GREEN,)alse7 1 reset to o"" GP45#output6RE!,)alse7 1 reset to o"" while .rue- newmails : int6"eedparser#parse6=https-33= B 9$ERN;<E B =-= B P;$$(5R!B=>mail#google#com3gmail3"eed3atom=7C="eed=DC="ullcount=D7 i" !E89G- print =8ingo 2 ou have=, newmails, =new emails2= i" newmails F myo""set- GP45#output6GREEN, .rue7 GP45#output6RE!, )alse7 time#sleep6'#7 GP45#output6GREEN,)alse7 else- GP45#output6GREEN, )alse7 GP45#output6RE!, .rue7 time#sleep6'#7 GP45#output6RE!,)alse7time#sleep6mydelay7
********  ************************Run it and see how it noti"ies all your emails###Python has a very nasty line indenting problem# 4" the subse+uent lines are not properlyindented the scripts does not work properly# .here"ore, "ollow the line indenting properly better still use a python 4!E like 4!E where it is taken care automatically# However, i" youcopy my script as it is it will work anyway#$ave the script in email#py and then put the "ollowing line in the 3etc3rc#local "ile and youIredone # Every time the Raspi boots , it will check J noti"ies your email without "ail#sudo nano 3etc3rc#localsudo python 3your*directory3email#py
 
)or making in PHP , "irst install the "ollowing so"twares# sudo apt*get update sudo apt*get install php sudo apt*get install php*imapEnsure that the PHP is working# Now copy the "ollowing script in a suitable php program#KF nano email#php
<?phprequire_once('GPIO.php'); $green=18;$red=23;$gp1 = ne GPIO();$gp1!"#eup($green%&ou&);$gp2 = ne GPIO();$gp2!"#eup($red%&ou&);$gp1!"oupu($green%);$gp2!"oupu($red%);$i*+o, = ip_open(&-ip.goog*ei*.co//30##*IO4&% &5ourid6goog*ei*.co&% &5ourp##ord&); 7or(;;)-  #*eep(1);$i* = ip_#erch($i*+o,% &9::&);$i = ;i7($i*) -  7orech($i* # $ei*_nu+er) - $i = $i1;  i7($i") -  prin7(&ingo  5ou'e $i :i*# >n&);$gp1!"oupu($green%1);$gp2!"oupu($red%); i7($i==) -  prin7(&9orr5 ude  5ou'e $i :i* >n&);$gp1!"oupu($green%);$gp2!"oupu($red%1);   00 ip_#e7*g_7u**($i*+o,% $i*@A% &>>9een >>B*gged&);ip_c*o#e($i*+o,);?"
<y prototype- )or simplicity 4Ive omitted the LM' 5hms resistors#

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->