Monday, March 6, 2017

Remote Control the Alexa Echo from Anywhere in the World

Seems to be a common request:  "How do I control my Amazon Echo remotely?"  As to why this needs to be done is somewhat of a mystery, but evidently; done it must be...

First off; this is a hack.  Even hackers being the hacker types they are will think it's a hack and those hackers will be right.
Take a look at the diagram above.  Basically what is happening is a Raspberry PI with a speaker plugged into it is commanding the Amazon Echo via a text-to-speech program.
  • The user logs into their home network via OpenVPN from anywhere in the World.
  • Navigate via VNC, etc. to a RasPI with a speaker placed next to an Amazon Echo.
  • From the RasPI command line use the 'festival' text-to-speech program to speak instructions to the Amazon Echo.
  • Amazon Echo obeys the command.
Here's a quick video demo:
Others have done the hard work, but you will need to install some software:
  • If you don't have OpenVPN running, PiVPN makes this really easy on the Raspberry PI (and other platforms).  This *could* be optional if you only wanted to use the hack from inside your LAN or opened up a PORT on your router.  If you do decide to open up a PORT on your router for the whole wide world be aware of the risks.
  • Install the text-to-speech program 'festival' on the Raspberry PI with the command:
$ sudo apt-get install festival festival-freebsoft-utils 
  • Plug a speaker into the Raspberry PI and place it next to the Amazon Echo.
  • Log into that Raspberry PI and issue a 'festival' text-to-speech command to control the Amazon Echo.  For example:

$ echo  "Alexa, what time is it" | festival --tts

$ echo  "Alexa, play Super Freak" | festival --tts
  •  Success! World domination!