Step 5. Start rpi-echo.py automatically
In rpi-echo.py, xxx debugging should be off (Log.setDebug(False))
rpi-echo.py can start automatically using systemd
$ wget https://raw.githubusercontent.com/dumbo25/Control-Raspberry-Pi-with-Alexa/master/rpi-echo.service
$ sudo chown root:root rpi-echo.service
$ sudo cp rpi-echo.service /lib/systemd/system/.
Step 6. Check if the service is running
After any changes to the service, run these commands:
$ sudo systemctl enable rpi-echo.service
$ sudo systemctl start rpi-echo.service
$ sudo systemctl daemon-reload
$ ps aux | grep rpi-echo
There should be two items for rpi-echo
Ensure it works after reboot
$ sudo reboot
log back in using ssh
$ ps aux | grep rpi-echo
Here are some other ways to ensure the rpi-echo.service in systemd is enabled and running:
$ systemctl list-unit-files | grep enabled | grep rpi-echo
$ systemctl | grep running | grep rpi-echo
$ systemctl status rpi-echo.service -l
If there are any issues with starting the script using systemd, then examine the journal using:
$ sudo journalctl -u rpi-echo.service
$ cat rpi-echo.log
Step 7. Tell Alexa or Echo about the new device
Tell echo/alexa to discover new devices
Say, Alexa, turn <device> <command>
Debugging:
In rpi-echo.py, debugging should be on (Log.setDebug(True)), or leave it False
Open a second terminal window and cat the log file
$ cd ~/.
$ cat rpi-echo.log
Notes (and general complaining):
This problem has been solved a couple of different ways. Here are two approaches to controlling a Raspberry Pi using Alexa:
Ouimeaux (2013) seems to be the first implementation (2015 for fauxmo).
As of 22MAY2020, the latest version of fauxmo is 0.5.0. I tried using this, and it seems more complicated then it needs to be. For example, the documentation is unclear on how to change the config.json to meet my needs.