2 x Raspberry Pi 3 Model B 1 x Picamera 1 x PIR motion sensor 1 x RGB LED 1 x Breadborad 1 x Powerbank for the Raspberry Pi in the postbox 3 x femmale-to-female cable 2 x male-to-female cable 3 x male-to-male cable Resistor(s) for LED
- first set up your Google Cloud Vision API and get your key. You can use this tutorial:
https://www.dexterindustries.com/howto/use-google-cloud-vision-on-the-raspberry-pi/ - then create a file named "credentials" containing sender_email, sender_password, receiver_email like below:
sender@example.com password1234 receiver@example.com
- run pir.py on the 1st Raspberry Pi
$ python3 pir.py
- run camera_2.py using Flask on the 1st Raspberry Pi
$ export FLASK_APP = camera_2.py $ pyhton3 camera2.py
- Start Google Cloud Vision by exporting your key on the 2nd Raspberry Pi
$ export GOOGLE_APPLICATION_CREDENTIALS=your_google_vision_key.json
- run ocr.py using Flask on the 2nd Raspberry Pi
$ export FLASK_APP = ocr.py $ flask run
pir.py runs on the 1st Raspberry Pi, detects new post insertion
camera_2.py runs on the 1st Raspberry Pi, takes a picture of the post and sends it to the 2nd Raspberry Pi
ocr.py runs on the 2nd Raspberry Pi, detects text on the post, applies filters and sends email