1

No experience beyond novice Pi level, learning with interesting (to me) projects.

With little difficulty I have a Pi Echo working.

Pi Echo requires three separate terminal instances to run 3 separate series of commands:

#1 - cd ~/Desktop /Alexa-avs-sample-app/samples Cd companionService && npm start

#2 - cd ~/Desktop /Alexa-avs-sample-app/samples cd javaclient && mvn exec:exec

#3 - cd ~/Desktop /Alexa-avs-sample-app/samples cd wakewordAgent/STCR && ./wakewordAgent -e kitt_ai

I would like to put an icon on the desktop that runs the commands in three separate terminal windows that will STAY OPEN.

My research so far in creating desktop shortcuts has not provided me with results.

Very much appreciated.

  • I recently followed this tutorial. My understanding is that these need to be run in order, or in sequence basically. Login With Amazon is a manual step that must be performed in order to authenticate the client (corresponding to Alexa running on your device). I am looking for a way to do this in a headless manner; not sure if that is allowed. – Web User Nov 9 '16 at 19:15
3

This works on Pi3

Create 3 shell scripts, one for each service. enter image description here

I run this from the GUI (open in terminal) and works fine. You still need to enter auth credentials though. You will need to change paths - my files are all in Home/pi

hope that helps

2

For the launching of terminals you may have some success with a shell script using '-e' to execute your commands:

#! /bin/bash

LXTerminal -e "first command to run" &
LXTerminal -e "second command to run" &
LXTerminal -e "third command to run" &

For most terminals you can add a '-hold' to keep it open after the execution or specify it in the options for a profile. For LXTerminal I don't see an obvious way. A solution would be to install another terminal which has this option, xterm maybe?

  • Thank you, I will give it a try - as well as a different terminal program. – Arthur Oct 24 '16 at 1:54
1

After a couple of DAYS I found a way for a great autostart for Alexa and I wanted to post it for the others who are interested in this. This autostart function is for the SamuelBrucksch Project. Thank you for the Project!

  1. Create an empty file with the extension .sh and name it whatever you want. (For example: alexa-start.sh) Past the following Skript in the created File:

    #!/bin/bash
    # First terminal
    lxterminal -l -e 'cd ~/alexa-avs-sample-app/samples/companionService && npm start;' &
    
    # Wait
    sleep 10s
    
    # Second Terminal
    lxterminal -l -e 'cd ~/alexa-avs-sample-app/samples/javaclient && mvn exec:exec;' &
    
    # Wait
    sleep 30s
    
    # Third terminal
    lxterminal -l -e 'cd ~/alexa-avs-sample-app/samples/wakeWordAgent/src && ./wakeWordAgent -e kitt_ai;' &
    
  2. Then, save the script file wherever you want, or in the /home/pi folder like I did.

  3. Give that file the necessary Permissions with: chmod +x filename.sh

  4. Then, open /home/pi/.config/autostart folder. It might be different in your case. Just open your home folder and enable view hidden folders. If you don't see the autostart folder, then create a folder called "autostart" within the .config folder.

  5. Within autostart folder you will need to create a shortcut to your script file that you created as follows. Create an empty file with the extension .desktop. (For example: "alexa-start.desktop")

  6. Copy and paste the following in the empty .desktop file except you will need to change Comment, Name, Exec, Path and Icon field's value (Actually you just need to change the Exec, Name, and Path Values the others can stay as they are:

    [Desktop Entry]
    Comment=Comment
    Exec=/path/to/Your/application/Name-of-the-script-file.sh
    Name=Name -of-the-script-file.sh
    Path=/Path/to/Your/application
    Type=Shell
    
  7. Save and close the file after changing all the necessary fields. You are done. Just test it out and enjoy Alexa on your Raspberry!

0

In order to do this headless, kicking off three terminals I'd look into crontab. Otherwise you should be able to run the script as a daemon. Remember that Raspbian is just Linux, and that you'll have luck in finding answers when googling by replacing Raspberry Pi with Linux.

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.