Giter Club home page Giter Club logo

alexachip's Introduction

AlexaCHIP

If you're looking for the Raspberry Pi version its here https://github.com/sammachin/AlexaPi

Contributors

  • Sam Machin

This is the code needed to Turn a CHIP into a client for Amazon's Alexa service, it should be farly easy to port it over to the Raspberry Pi or other similar boards that can run python and have audio and network interfaces. I'd welcome any pull requests for doing so.

Setup

First obtain a CHIP from http://getchip.com at time of writing (Jan 2016) orders wern't shipping till June 2016 Sorry!

Assuming you have a CHIP and its connected to your wifi network you then to do the hardware mod to enable mic input on the 3.5mm jack http://docs.getchip.com/#microphone-and-audio-input You could also just use the header pins on the board to access speaker and mic depending on your project.

You'll also want to connect a small normally open push button across GPIO1 and GND (pins 14 an 1 on U14)

Copy the contents of the repo into a new folder on the CHIP and then run the following

apt-get update
apt-get install  libasound2-dev memcached python-pip
pip install -r requirements.txt

Next you need to obtain a set of credentials from Amazon to use the Alexa Voice service, login at http://developer.amazon.com and Goto Alexa then Alexa Voice Service

You need to create a new product type as a Device, for the ID use something like AlexaCHIP, create a new security profile and under the web settings allowed origins put http://localhost:5000 and as a return URL put http://localhost:5000/code you can also create URLs replacing localhost with the IP of your CHIP/Pi etc eg http://192.168.1.123:5000

Once you've got the security credentials put them into the creds.py file on your device.

Now you can run the signup web server to create a login token, run python ./auth_web.py

Now if you setup localhost then you need to open a browser on your CHIP and goto http://localhost:5000 or if you added your IP as well then you can connect from your PC using that URL. This is a simple web app which will take you through authorising your developer credentials to access your alexa account as a user and finally it will return a refresh token that you then need to add to the creds.py file on your CHIP. Sorry this is a bit of a faff but you should only need to do it once for as many CHIP's as you want to use.

Finally you need to tell the CHIP to activate the GPIO pin, run the setup_gpio.sh script from the terminal, you need to do this after each reboot as well.

Now that you've got the refresh token on you CHIP you're all set, just run main.py from the console and after a few secs it should print Ready, now you can press the button say a command and await the response.

Enjoy :)

You'll probbly want to put the setup_gpio and main.py scripts into crontab or something to auto run them at boot up.


Improvements

alexachip's People

Contributors

sammachin avatar hkp avatar smiller171 avatar

Watchers

James Cloos avatar dbbevan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.