/Pi_flag_raiser

Python scripts for raise a flag when new gmail mail is received

Primary LanguagePython

Pi_flag_raiser

Python scripts for raising a flag when new gmail mail is received.

Dependencies

Install python imap client:

sudo apt-get install -y python-pip
sudo pip install imapclient

Nb : Recently I wasn't able to use imapclient 1.0.0 anymore (pb similar to issue). I had to use imapclient 0.13:

sudo pip install imapclient==0.13

Install RPIO python lib for raspberry:

sudo apt-get install -y python2.7-dev
git clone https://github.com/metachris/RPIO.git
cd RPIO
sudo python setup.py install

Use

To start:

python main.py -id <identification> -p <password> --debug

For starting script just after network connexion, you can edit /etc/network/interfaces and add the following line with right path and ids:

post-up python /home/user/git_rep_directory/main.py -i identification -p password > /home/user/git_rep_directory/Log 2>&1 &

Last part will create a Log file in your git repository.

You can restart network interface with:

sudo /etc/init.d/networking restart

Links

Based on: Adafruit email notifier

Documentation: Imap client documentation RPIO lib documentation