Well the Pi user has full root access to PM2. I can open a terminal window and enter pm2 restart AlexaCookie (and it will restart).
Edit: let me redirect the output from crontab to my desktop to see if it runs.
30 2 * * * pm2 restart AlexaCookie >> /home/pi/Desktop/out.txt
Will give this a try.
Does anyone else find dealing with the lady in the box annoying? With the latest version, I can see that one message is sent from the Hub to Amazon, but randomly the devices still give the "Sorry I'm having trouble understanding now, please try again later" error. With the change to announcement in the code, I can see that each tablet gets the words since it displays on the screen.
Is the flow such that the tablet would receive the message, then reach out to Amazon to grab the audio to play?
I'm out of ideas. Just one last question - are you directly putting that command in the crontab, or are you executing a shell script with that command from crontab? I actually do the latter.
In the olden days, cron didn't like spaces in the command, and I got into the habit of executing shell scripts from cron. I thought that was fixed a long time back, but who knows ....
The node services you use will be different, but AlexaCookie should be the same. I put the date command to get a timestamp and confirmation that the cron job ran. And the output from pm2 is redirected to the same file.
Edit - make sure the shell script is marked executable. And put the entire path to the commands.
For some reason "AlexaCookie" stopped running as "pm2 list" had an empty result (thus the bash script didn't execute correctly) so I relaunched the application by performing the following
pm2 start AlexaCookie.js (when in the "AlexaCookieNodeJs: directory)
pm2 startup
pm2 save
The cron job will hopefully run tonight and I will report in the morning if it was successful.
So I get to the point where the Alexa TTS Manager app is created, it sees all of my echo's, so it clearly authenticated, and it creates devices for each.
When I try to send text, I always get:
groovy.lang.StringWriterIOException: java.io.IOException: Stream closed on line 40 (deviceNotification)
'speakMessage()': Error making Call (getMessage): Bad Request
'speakMessage()': Error making Call (Status): 400
'speakMessage()': Error making Call (Data): {"message":"Input failed to validate."}
and, unsurprisingly, no sound comes out of the Echo in question.
I'm wondering ... can I use this app even if my environment and country is different than the supported one? I live in Brazil and I don't mind getting my Alexa speakers alerting me in English. This functionality is so interesting - and important - that I don't mind even if it alert me in Sanskrit !
Do you have a US Amazon Alexa Account? Or Brazil Amazon Alexa account? The code does a lookup based on the country you select, and then connects to the corresponding country's alexa.amazon.xxx web site. So, I believe you'll need to have an Amazon account in one of the supported countries.
However, adding additional countries is not too hard. Are you a programmer? If so, take a look at the Alexa TTS App's groovy code. There is a list of countries and their respective web sites. If you know Brazil's, it should be pretty simple to add it. No guarantee that it will work in Brazil, though...
You can simply copy and paste it into a Private Message and I will update my GitHub Repository (unless you are already familiar with GitHub Repo Forking and Pull Requests, as that would work as well.)