Open a Terminal and execute following commands:
sudo pip3 install --upgrade google-api-python-client
git clone https://github.com/rainerum-robotics-rpi/gemellaggio-1718.git
cd gemellaggio-1718
To run the app simply type:
./app.py
If the application can not find a .json file you most likely have forgotten to copy the credentials key file within the credentials folder. Please add the keys as explained in the readme file of the credentials folder.
Python 3.x is used to program this application. Checkout the docs:
There exist two custom libraries that support your program. One is called rgem_gmail and the other one is called rgem_cam. Both are already inlcuded in the app.py file with the lines:
import rgem_gmail
import rgem_cam
Furthermore two other libraries are included with the lines:
from gpiozero import LED
from time import sleep
See also:
messages = rgem_gmail.NewMessages(address)
Checks out new messages sent to a certain address and marks them as read. The variable message contains a dictionary of received emails matching the specified address.rgem_gmail.SendMessage(sender, to, subject, msgHtml, msgPlain, [ pic ])
Sends an email with given text and file attachments from given sender address to given to destination address. The attachment is a list with one or more filenames.
pic = rgem_cam.TakePicture()
Takes a picture and saves it to with the filename as indicated by the return value variable pic.