shivasiddharth / headless-alexa-avs-sample-app

Autostart the Amazon alexa-avs-sample-app on boot on a headless Raspberry Pi
GNU General Public License v3.0
14 stars 11 forks source link

Error when running companion service code #2

Closed caldecy closed 6 years ago

caldecy commented 6 years ago

My Alexa AVS Sample App was working fine before installing your module. All 3 codes for the various functions work well when keyed in manually.

After installing the module and following your instructions to make the necessary amendments, I executed the installer and waited for the Start up sound to be played but to no avail. I then assumed something must have gone wrong during the install and went back to check the script file location. Apparently, I did not remove the ~ that comes after the cd ~/home/pi/.... which I assumed is the error. Afterwhich, I edited all the 3 scripts and saved the files. I executed the installer again and then it just reads "Continuing...". No Start up sound either this time.

Now, even when I try to manually key in the 3 codes into the terminal window to run the Alexa app, the app displays an error as follows:

**This node service needs to be running to store token information memory and vend them for the AVS app.

Port 3000 is already in use

npm ERR! Linux 4.9.61-v7+ npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start" npm ERR! node v6.12.0 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! alexa-voice-service-sample-companion-service@1.0.0 start: node ./bin/www npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the alexa-voice-service-sample-companion-service@1.0.0 start script 'node ./bin/www'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the alexa-voice-service-sample-companion-service package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node ./bin/www npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs alexa-voice-service-sample-companion-service npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls alexa-voice-service-sample-companion-service npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/alexa-avs-sample-app/samples/companionService/npm-debug.log**

I suspect that I might need to recompile all the scripts again after the edition before executing the installer? Or is it that there is another problem? Worst case scenario, I'll just uninstall and re-install the module again.

Thanks in advance!

shivasiddharth commented 6 years ago

what is your directory for alexa-avs-sample-app ? is it in Desktop or is it in pi folder ? What changes did you make to the bash scripts ? can you paste them here please !

The installer just makes the bash scripts executable and creates services for the different services. This would not break your existing installation. so you need not reinstall things. If you stop the services using: sudo systemctl stop companionapp.service sudo systemctl stop client.service sudo systemctl stop wakeword.service and run them manually as you would do normally, you can see the alexa working. Only if i you can provide me with the details that i requested, i wouyld be in a position to troubleshoot.

caldecy commented 6 years ago

Sorry about the missing information in my previous post!

My directory for alexa-avs-sample-app is /home/pi/alexa-avs-sample-app (identical to yours).

The final script looks like this:

Clientstart.sh

!/bin/bash

cd /home/pi/alexa-avs-sample-app/samples cd javaclient && sudo mvn exec:exec

Companionstart.sh

!/bin/bash

cd /home/pi/alexa-avs-sample-app/samples cd companionService && sudo npm start

Wakeword.sh

!/bin/bash

cd /home/pi/alexa-avs-sample-app/samples sleep 45 aplay /home/pi/headless-alexa-avs-sample-app/Startup.wav cd wakeWordAgent/src && sudo ./wakeWordAgent -e kitt_ai

Will use the 3 codes you provided to have the service stop running for now. Hope to hear from you soon regarding my error!

Thanks for the trouble!

shivasiddharth commented 6 years ago

Sorry about the delay in getting back. Had missed your post. Are you still looking for assistance with this issue ?

caldecy commented 6 years ago

I have gotten it to start running when boot up but there are some instances where Alexa does not respond after listening to my command and hangs there. Usually I will have to reboot it to get it working again. Is this an issue you can help me with?

shivasiddharth commented 6 years ago

Sometime, Alexa does take a lot of time to process the requests, but it does not hang. You can check the request status using: sudo systemctl status client.service That will show as to whether, alexa is hung or processing requests.