** Sadly, when I was working in the integration with the GPIO, looks like my board broke, as it turns but won't boot up. So I won't be able to post a video of the final product working.
About the projectOne of the first things I liked about the Edison was its size, it was small but it packed WIFI and Bluetooth. I had a camera module around so that's when I started thinking to create a video doorbell. But didn't want to open a port to the internet to just stream my video feed. That's when I thought how about YouTube? I've streamed some videos before and it's a good service. So If I can get the Edison to stream a livestream when it detected video, all the other stuff like using Twilio for MMS and SMS messaging or Google Drive for picture snapshots to be use for the MMS or email notifications using the Gmail API, everything fell together fine.
The most tricky past was to authenticate the application once and let the application authenticate itself without owning a domain name. That's when I stumbled with Amazon API Gateway, so one more part of puzzle fell in place.
Setting up AmazonOpen an amazon developer account and create the following lambda https://github.com/jreyes/edison-doorbell-lambda/blob/master/index.js . In the script set the value of EDISON_IP to the ip in your internal network of your Intel Edison. Write down the lambda ARN because we will need it for the following step.
More information how to create a lambda can be found here http://docs.aws.amazon.com/lambda/latest/dg/get-started-create-function.html
Now create a new API Gateway project and import the API Gateway definition from https://github.com/jreyes/edison-doorbell-api-gateway/blob/master/api-gateway.yaml and fill out the needed information like the lambda ARN. Deploy it to a stage (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-deploy-api.html) and get the URL for you OauthForwarder GET method. Write down this URL.
Open an account and create a website credential (https://cloud.google.com/java/getting-started/authenticate-users) with the following APIs enabled: YouTube Data API v3, Google Drive API, and Gmail API.
If you want to be able to send SMS and MMS, you will need to open a Twilio account and get a phone number as described here
Sadly the yocto distro doesn't have a good support for ffmpeg and ansible, which is going to make installation of the application a breeze, so decided to install Jubilinux on the Intel Edison as described here https://learn.sparkfun.com/tutorials/loading-debian-ubilinux-on-the-edison
Install AnsibleTo make it more easier to install the rest, install Ansible in your system.
apt-get install python-setuptools python-dev build-essential libssl-dev
easy_install pip
pip install ansible
Install the Edison Doorbell ApplicationAfter installing Ansible, let's install the application by running the following command in the shell
curl -sL https://raw.githubusercontent.com/jreyes/edison-doorbell/master/install.sh | bash
Configure the applicationIn a browser connect to your Edison device using port 8080 like http://youredisonip:8080 and start filling out your google client id, client secret, in redirect URL you'll enter the URL from the API Gateway, from email would contain the email of the google account that owns the project, to email would be the email where you want to be notified.
Also if you want to receive MMS, in the Twilio section start entering your Account SID and Auth Token, for the from phone number you'll enter the Twilio phone number that you bought, and the to phone number the phone number where you want to be notified.
Click Update and the click Connect to start the authentication process with google to allow this application to access the Google APIs in your behalf. After you granted permission to the application, close the browser as the application is ready to be used.
The hardware
Comments