question

Klas Hermodsson avatar image
Klas Hermodsson asked

Raspberry Pi: trouble connecting to companion service

Earlier today I successfully built and tested the AVS reference implementation on my macbook. Now a couple of hours later I tried to do the same on my brand new raspberry pi 2. Everything is fine until runtime. The javaclient complains that: “There was a problem connecting to the Companion Service” I have the companion service up and running on the raspberry pi and have confirmed in using netstat. I also made sure that I followed the instructions for raspberry pi and included the dependance to net.java.dev.jna in pom.xml. Any ideas what could be wrong?
alexa voice service
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Klas Hermodsson avatar image
Klas Hermodsson answered
I resolved it myself. It turned out to be an SSL-related exception that was generated when the javaclient tried to communicate to the companionService. I copied over the certs folder from my working macbook AVS project and behold, it worked. Not sure why the self-generated certificate was giving me errors. Maybe I accidentally manager to input the wrong passcode? Anyway, it works now :)
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image
Jamie Grossman answered
Glad you were able to resolve the issue yourself :)
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bushi avatar image
Bushi answered
I have the same issue and couldn't resolve by copying the cert folder from my AVSWindows to my AVSRaspberryPi. Any ideas?
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Eric@Amazon avatar image
Eric@Amazon answered
It could be a certificate issue. Have you tried stepping through generating certificates ( https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/docs/reference-implementation-guide#Generating%20Self-Signed%20Certificates ) line by line on the Raspberry Pi? For instance, forgetting to edit ssl.cnf can prevent the script from working correctly. Also, you should make sure that your product id and device serial number match in both the companion service and the reference app. If they don't match, you could also get this error.
1 comment
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Where does the ssl.cnf go?

0 Likes 0 ·
Bushi avatar image
Bushi answered
Everything seems as per the instructions, but still doesn't work. Questions: 1) What does these dependencies do? The 4.1.0 is version for what? net.java.dev.jna jna 4.1.0 compile 2) Under "Running the Server", #4 and #5. I only got the prompt to Confirm once. IS this normal or should I get the prompt to confirm every time I ran >npm install? 3) Under "Generating Self-Signed Certificates", #5, do I need to add any additional IP address for the RaspberryPi? 4) In my AVS-WindowsPC settings, the config.json file has an extra line: "sessionId":"[i]alphanumeric string here[/i]" IS it normal for the RaspberryPi config.json file not to have this line? Message was edited by: Bushi
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Eric@Amazon avatar image
Eric@Amazon answered
1) This is necessary because the most current version of JNA (needed for integration with vlc) doesn't have a build for arm 2) You should only need to update the security profile in the developer portal once. One confirm is all you need. 3) You shouldn't need any thing additional for the Raspberry PI 4) The sessionId is automatically added when you successfully authenticate with AVS. It's merely a caching mechanism to ensure you don't need to provision your device every time you start it. Lacking a session id just means you haven't yet successfully logged in.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Eric@Amazon avatar image
Eric@Amazon answered
The other issue it could be is an out-of-date Java SDK. You need the latest provided by Oracle, not the latest in the Raspbian repository. (question answered here as well: https://forums.developer.amazon.com/forums/thread.jspa?threadID=9987&tstart=0)
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

_dr3x_ avatar image
_dr3x_ answered

Working on trying to get Alexa running o OSMC on a Raspberry Pi 3 box following these instructions:

https://github.com/alexa/alexa-avs-sample-app/wiki/Raspberry-Pi

Got the code running in the 1st terminal window (lots of hurdles, if you are still having issues with this LMK and I will provide details)

In terminal window 2, where you run the javaclient and it is supposed to pop up a browser for authentication, the code errors out, because the OSMC is headless, doesn't have a UI. Here is the issue I posted but it was closed as a feature request:

https://github.com/alexa/alexa-avs-sample-app/issues/591

Does anyone have a resolution for this? Response on my issue was to do a companion service.

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.