Skip to content
Use Raspberry Pi 3 as home automation device with Alexa
Branch: master
Clone or download
nassir-malik Merge pull request #13 from deveena/patch-1
Update RPi_name_port_gpio.py
Latest commit d5825ec Jan 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
CHIP_IO New May 11, 2017
__pycache__ new2 May 12, 2017
images new May 13, 2017
.gitattributes 🎪 Added .gitattributes & .gitignore files May 11, 2017
.gitignore 🎪 Added .gitattributes & .gitignore files May 11, 2017
CHIP_name_port_gpio.py new May 11, 2017
README.md Update README.md Jan 3, 2019
RPi_name_port_gpio.py
RPi_name_port_gpio_8_Relays.py
RPi_name_port_gpio_8_Relays2.py new Dec 13, 2017
debounce_handler.py New May 11, 2017
example-minimal.py new May 11, 2017
fauxmo.py Update fauxmo.py Jan 3, 2019
ssh new May 13, 2017
wpa_supplicant.conf Update wpa_supplicant.conf Dec 25, 2017

README.md

IOT-Pi3-Alexa-Automation

I updated the code. It is working with Echo dot Gen 3 and Gen 2

Youtube tutorial https://www.youtube.com/watch?v=uS5dTx8vjq4

Use Raspberry Pi 3 as home automation device with Alexa. This project allows you to control multiple devices connected to Raspberry Pi 3 with voice command. You are able to control GPIO pins thus control GPIO connected devices.

Ported from original repos for python 3 https://github.com/toddmedema/echo https://github.com/xtacocorex/CHIP_IO

Instructions:

  1. Download "RASPBIAN STRETCH WITH DESKTOP" and unzip "2017-04-10-raspbian-jessie.zip" https://www.raspberrypi.org/downloads/raspbian/

  2. Download "win32diskimager-1.0.0-install.exe" program from following URL https://sourceforge.net/projects/win32diskimager/files/latest/download

  3. Install "win32diskimager-1.0.0-install.exe"

  4. Connect mini-sd card to a computer. In windows explorer right click your sd card drive letter and click on format menu. In format window select "FAT" in "File System" list and click start. Wait for the task to complete.

    alt text

  5. Launch "win32diskimager" program. Select image file "2017-04-10-raspbian-jessie.img" and your sd card drive letter and click "Write" (Wait for program to finish writing REAPBIAN image to the sd card)

    alt text

  6. Once image writing is completed, Copy "ssh" (ssh file is empty) and "wpa_supplicant.conf" files to root of the sd card. Open "wpa_supplicant.conf" in text editor and update ssid (wi-fi name) & password.

  7. Insert the sd card into Raspberry Pi 3 and boot and wit for 10 seconds

  8. In windows go to run & type "cmd" and type arp -a in command prompt. Look for "Physical Address" that starts with b8-27* & note the Internet Address. This is your Raspberry Pi3 Wi-fi IP address on your network.

    alt text

  9. Download "Putty.exe" from following URL https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

  10. Run "Putty.exe" and type IP address in host name field and click start button & click yes to popup. On putty command line type in "pi" for "Login as:" & enter. For password enter "raspberry" and hit enter. You should see "pi@raspberrypi:~ $" prompt.

    alt text

  11. Type "sudo raspi-config" and go to "Interfacing Options" and enable VNC. Reboot pi3 by typing this command "sudo reboot". You will loose ssh connection.

  12. (Optional) download and install VNC client on youe pc https://www.realvnc.com/download/vnc/windows/. Connect VNC to Respberry Pi3 using IP address. Login with user name "pi" and password "raspberry". You should see Pi3 desktop.

    alt text

  13. Launch Pi ssh session with putty or localy through VNC and type following two commands Pi command prompt to update it. "sudo apt-get update" and "sudo apt-get upgrade" (This will take a while)

  14. Download this github project as zip file with following command "wget https://github.com/nassiramalik/IOT-Pi3-Alexa-Automation/archive/master.zip"

  15. Unzip downloaded zip file with "unzip master.zip" command and type "cd IOT-Pi3-Alexa-Automation-master" command after unzip completes

  16. (Optional) Entery "sudo pip install virtualenv" command to install virtualenv on Pi

  17. (Optional) Enter "virtualenv ipaa-env" command to create virtual environment for your project

  18. (Optional) Enter ". ipaa-env/bin/activate" command to activate your project's virtualen vironment

  19. Enter "sudo python3 RPi_name_port_gpio.py" command to run Pi IOT program

  20. Give voice command to Alex to discover devices "Alexa discover devices" it will search your network and discover your Raspberry Pi 3 as an IOT device.

  21. Give a voice command to Alexa "Turn on the office" you should hear a relay clicking sound and led turn on

  22. Give a voice command to Alexa "Turn off the office" you should hear a relay clicking sound and led should turn off

You can’t perform that action at this time.