2

I'm trying to automate the launch of Alexa Pi and then run it on boot.

I have made a .py script which runs a .sh which then runs 3 .sh files required to run Alexa.

Now the .py script by itself is running fine and Alexa works. But when I try to run it automatically during boot time I get nothing. My processor usage shows 0% right after boot.

My /etc/rc.local:

cd ~/Desktop
python ./test/py &

I have tried running the .sh files directly without the python script. I have tried putting the same commands in /etc/profile, nothing works and I'm about to pull my hair out.

Edit: Tried using systemd for this, it doesn't work either, it tries to run then shows nothing.

0

I finally got it! I used the .desktop method to run Alexa. Anyone trying to run it during boot can do this(Assuming you have the needed files on desktop):

  1. Make Alexa.sh file on desktop and put this inside:

This line goes with the ones below> #!/bin/bash

cd /home/pi/Desktop/alexa-avs-sample-app/samples
cd companionService && npm start &    
cd /home/pi/Desktop/alexa-avs-sample-app/samples    
cd javaclient && mvn exec:exec &    
sleep 20    
cd home/pi/Desktop/alexa-avs-sample-app/samples    
cd wakeWordAgent/src && ./wakeWordAgent -e sensory &    
sleep 20    
sudo speaker-test -t sine  -f 150 -l 1    
$SHELL
  1. Then in terminal run

cd ..

cd .config

cd autostart

sudo nano app.desktop

Copy this inside:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=nds
comment=
Exec=/home/pi/Desktop/Alexa.sh
StartupNotify=false
Terminal=true
Hidden=false

Assuming you followed the official guide, now Alexa would run automatically after boot. I've added a speaker test to give it time to load, only start interacting with it after you hear the speaker test sound or it might mess up. I'm not sure why the terminal doesn't show but it isn't needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.