[Solved] Alexa script install and autostart on boot for Matrix VOICE

I hope somebody can shine a light on this.
I have a clean Stretch install on a Raspberry 3 with a Matrix VOICE attached. I believe I tried ALL guides on the Internet, Github and the random text files (all pointing to the Matrix Creator) what MatrixLabs calls “Documentation”. Not a single guide led to successful Alexa implementation, None. Demo’s with spinning LEDs and LEDs changing intensity depending on the sound intensity do work.

I believe it all comes down to the microphone and speaker settings, I can not record and playback a wav file for example (see results at the end of this post).

This guide


leads to “Unknown PCM cards.pcm.xxx” errors

This guide


leads to
“Exception:
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/usr/lib/python2.7/dist-packages/pip/commands/install.py”, line 353, in run
wb.build(autobuilding=True)
File “/usr/lib/python2.7/dist-packages/pip/wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “/usr/lib/python2.7/dist-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))”

Im clueless on where to go from here.

Some more info:

cat /proc/asound/cards

0 [ALSA ]: bcm2835_alsa - bcm2835 ALSA
bcm2835 ALSA
1 [Dummy ]: Dummy - Dummy
Dummy 1

aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6

card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

arecord -l

**** List of CAPTURE Hardware Devices ****
card 1: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

arecord /tmp/test.wav

Recording WAVE ‘/tmp/test.wav’ : Unsigned 8 bit, Rate 8000 Hz, Mono

aplay /tmp/test.wav

aplay: main:788: audio open error: No such file or directory

ls /tmp

matrix_micarray_channel_0 matrix_micarray_channel_6
matrix_micarray_channel_1 matrix_micarray_channel_7
matrix_micarray_channel_2 matrix_micarray_channel_8
matrix_micarray_channel_3 test.wav
matrix_micarray_channel_4
matrix_micarray_channel_5

sudo nano /etc/asound.conf

pcm.sc {
type hw
card 1
}

pcm.mic_channel0 {
type file
file “/tmp/matrix_micarray_channel_0”
infile “/tmp/matrix_micarray_channel_0”
format “raw”
slave {
pcm sc
}
}

pcm.mic_channel1 {
type file
file “/tmp/matrix_micarray_channel_1”
infile “/tmp/matrix_micarray_channel_1”
format “raw”
slave {
pcm sc
}
}

pcm.mic_channel8 {
type file
file “/tmp/matrix_micarray_channel_8”
infile “/tmp/matrix_micarray_channel_8”
format “raw”
slave {
pcm sc
}
}

pcm.!default
{
type asym
playback.pcm {
type hw
card 0
device 0
}
capture.pcm {
type file
file “/tmp/matrix_micarray_channel_0”
infile “/tmp/matrix_micarray_channel_0”
format “raw”
slave {
pcm sc
}
}
}

sudo nano /boot/config.txt

dtparam=audio=on
max_usb_current=1
gpu_mem=320
dtparam=spi=on
dtparam=i2c_arm=on
enable_uart=1
dtoverlay=w1-gpio
dtoverlay=spi0-cs,cs1_pin=12
dtparam=gpio_in_pin=16
dtparam=gpio_in_pull=down
dtparam=gpio_out_pin=13

cd ~/matrix-creator-hal/build/
sudo bash startsample.sh


SDK Version 1.5.0
2018-02-17 17:40:26.341 [ c] 0 CurlEasyHandleWrapper:reset:responseCode=HTTP_RESPONSE_SUCCESS_NO_CONTENT
2018-02-17 17:40:26.336 [ d] 0 TemplateRuntime:addObserverInExecutor
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa

Sorry for a long post. Im hoping to give enough info for someone to point me in the right direction.

can you check if the malos serivce is running, it does handle the alsa pipes.

sudo systemctl status matrixio-malos.service

Thanks! Here is the result:
sudo systemctl status matrixio-malos.service

  • matrixio-malos.service - Matrix Abstraction Layer for OS
    Loaded: loaded (/lib/systemd/system/matrixio-malos.service; enabled; vendor preset: enabled)
    Active: active (running) since Sat 2018-02-17 21:27:52 EET; 2h 38min ago
    Main PID: 600 (malos)
    CGroup: /system.slice/matrixio-malos.service
    `-600 /usr/bin/malos

Feb 17 21:27:52 Pi5_Echo malos[600]: **************
Feb 17 21:27:52 Pi5_Echo malos[600]: You can query specific driver info using port 20012.
Feb 17 21:27:52 Pi5_Echo malos[600]: Registered driver IMU with port 20013.
Feb 17 21:27:52 Pi5_Echo malos[600]: Registered driver Humidity with port 20017.
Feb 17 21:27:52 Pi5_Echo malos[600]: Registered driver Everloop with port 20021.
Feb 17 21:27:52 Pi5_Echo malos[600]: Registered driver Pressure with port 20025.
Feb 17 21:27:52 Pi5_Echo malos[600]: Registered driver UV with port 20029.
Feb 17 21:27:52 Pi5_Echo malos[600]: Registered driver MicArray_Alsa with port 20037.
Feb 17 21:27:52 Pi5_Echo malos[600]: Registered driver Servo with port 20045.
Feb 17 21:27:52 Pi5_Echo malos[600]: Registered driver Gpio with port 20049.

Also, this is working fine, very clear:
cd ~/matrix-creator-hal/build/demos/
./micarray_recorder
sox -r 16000 -c 1 -e signed -c 1 -e signed -b 16 mic_16000_s16le_channel_8.raw beamforming_result.wav
aplay beamforming_result.wav

So why the errors and why do none of the Alexa scripts run on this clean Stretch install :frowning:

i would suggest to try a more recent guide, which uses the newer apt repository and so on.

Hi, as said, I tried “all” guides. To me, this one produces the same result. Can someone honestly say that this worked immediately on a new Stretch install?

i just tested it on the creator and it still works, with the latest software stack.

did you clone the fork https://github.com/matrix-io/alexa-avs-sample-app and not the parent? it contains some modifications to access the sound devices.

I have a Matrix Voice, maybe that makes a difference? I can’t recall now with 100% certainty what I cloned first.

I will try a fresh install, that fork and report back.

Thanks for the comments and direction, it is much appreciated.

Unfortunately it failed again.

Here is my sequence of actions:

Format SD card
Install Stretch
sudo rpi-update
sudo apt-get update
sudo apt-get upgrade
"follow https://www.hackster.io/matrix-labs/matrix-voice-running-alexa-demo-in-hands-free-mode-404aa3"
sudo apt-get install oracle-java8-jdk
"Do the whole Amazon thing"
curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo “deb https://apt.matrix.one/raspbian $(lsb_release -sc) main” | sudo tee /etc/apt/sources.list.d/matrixlabs.list
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install matrixio-malos libmatrixio-creator-hal-dev
sudo reboot
cd /home/pi/Desktop
git clone https://github.com/matrix-io/alexa-avs-sample-app.git
cd alexa-avs-sample-app
. automated_install.sh

That last install fails with:

CMakeFiles/wakeWordAgentTest.dir/home/pi/Desktop/alexa-avs-sample-app/samples/wakeWordAgent/src/WakeWordAgent.cpp.o: In function AlexaWakeWord::WakeWordAgent::mainLoop()': WakeWordAgent.cpp:(.text+0x838): undefined reference tomatrix_hal::WishboneBus::WishboneBus()'
WakeWordAgent.cpp:(.text+0x84c): undefined reference to matrix_hal::WishboneBus::SpiInit()' WakeWordAgent.cpp:(.text+0x860): undefined reference tomatrix_hal::Everloop::Everloop()'
WakeWordAgent.cpp:(.text+0x89c): undefined reference to matrix_hal::MatrixDriver::Setup(matrix_hal::WishboneBus*)' WakeWordAgent.cpp:(.text+0xadc): undefined reference tomatrix_hal::Everloop::Write(matrix_hal::EverloopImage const*)'
WakeWordAgent.cpp:(.text+0xc94): undefined reference to `matrix_hal::Everloop::Write(matrix_hal::EverloopImage const*)'
collect2: error: ld returned 1 exit status
CMakeFiles/wakeWordAgentTest.dir/build.make:566: recipe for target ‘wakeWordAgentTest’ failed
make[2]: *** [wakeWordAgentTest] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/wakeWordAgentTest.dir/all’ failed
make[1]: *** [CMakeFiles/wakeWordAgentTest.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2
chown: changing ownership of ‘/home/pi/Desktop/alexa-avs-sample-app/samples/wakeWordAgent/ext/lib/libblas.so.3’: Operation not permitted
chown: cannot access ‘/home/pi/.asoundrc’: No such file or directory

wait a secound. i’ll will try to recompile this on my pi it seems it does not find the hal dev headers. i’ll will update this post here.

Update
Can you check if you have this folder;

ls /usr/include/matrix_hal

if not, check if libmatrixio-creator-hal-dev is realy installed:

sudo apt install libmatrixio-creator-hal-dev

and/or do a manual test

sudo ldconfig
cd /home/pi/Desktop/alexa-avs-sample-app/samples/wakeWordAgent/src
make clean
cmake .
make

further last check:

dpkg -l | grep libmatrix
# should return something like (libmatrixio-malos/-dev should not be needed):
ii  libmatrixio-creator-hal:armhf         0.2.2                                armhf        Hardware Abstraction Layer for MATRIX.
ii  libmatrixio-creator-hal-dev           0.2.2                                armhf        Hardware Abstraction Layer for MATRIX (headers)
ii  libmatrixio-malos:armhf               0.1.2                                armhf        Libraries of MATRIX abstraction layer for MOS
ii  libmatrixio-malos-dev                 0.1.2                                armhf        Libraries of MATRIX abstraction layer for MOS
ii  libmatrixio-protos:armhf              0.1.1                                armhf        Protocolbuffers for MATRIX abstraction layer
ii  libmatrixio-protos-dev                0.1.1                                armhf        Protocolbuffers headers for MATRIX abstraction layer

ls /usr/include/matrix_hal
audio_output.h dummy_data.h gpio_control.h matrix_driver.h pressure_sensor.h
circular_queue.h dummy_sensor.h humidity_data.h mcu_firmware.h uart_control.h
creator_memory_map.h everloop.h humidity_sensor.h microphone_array.h uv_data.h
cross_correlation.h everloop_image.h imu_data.h microphone_array_location.h uv_sensor.h
direction_of_arrival.h fw_data.h imu_sensor.h pressure_data.h wishbone_bus.h

sudo apt install libmatrixio-creator-hal-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
libmatrixio-creator-hal-dev is already the newest version (0.2.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

sudo ldconfig
cd /home/pi/Desktop/alexa-avs-sample-app/samples/wakeWordAgent/src
make clean
cmake .
– HAL found => /usr/lib/libmatrix_creator_hal.a
– Configuring done
– Generating done
– Build files have been written to: /home/pi/Desktop/alexa-avs-sample-app/samples/wakeWordAgent/src
make
[ 6%] Building CXX object CMakeFiles/wakeWordAgent.dir/main.cpp.o
[ 13%] Building CXX object CMakeFiles/wakeWordAgent.dir/WakeWordAgent.cpp.o
[ 20%] Building CXX object CMakeFiles/wakeWordAgent.dir/WakeWordEngineFactory.cpp.o
[ 26%] Building CXX object CMakeFiles/wakeWordAgent.dir/WakeWordEngine.cpp.o
[ 33%] Building CXX object CMakeFiles/wakeWordAgent.dir/WakeWordIPCFactory.cpp.o
[ 40%] Building CXX object CMakeFiles/wakeWordAgent.dir/WakeWordIPC.cpp.o
[ 46%] Building CXX object CMakeFiles/wakeWordAgent.dir/WakeWordIPCSocket.cpp.o
[ 53%] Building CXX object CMakeFiles/wakeWordAgent.dir/IPCInterface.cpp.o
[ 60%] Building CXX object CMakeFiles/wakeWordAgent.dir/Logger.cpp.o
[ 66%] Building CXX object CMakeFiles/wakeWordAgent.dir/WakeWordException.cpp.o
[ 73%] Building CXX object CMakeFiles/wakeWordAgent.dir/KittAiSnowboyWakeWordEngine.cpp.o
[ 80%] Building CXX object CMakeFiles/wakeWordAgent.dir/PortAudioWrapper.cpp.o
[ 86%] Building CXX object CMakeFiles/wakeWordAgent.dir/SensoryWakeWordEngine.cpp.o
[ 93%] Building CXX object CMakeFiles/wakeWordAgent.dir/GPIOWakeWordEngine.cpp.o
[100%] Linking CXX executable wakeWordAgent
[100%] Built target wakeWordAgent

cool now everything is build. :slight_smile:

so you can configure your services and so on.

dpkg -l | grep libmatrix
ii libmatrixio-creator-hal:armhf 0.2.2 armhf Hardware Abstraction Layer for MATRIX.
ii libmatrixio-creator-hal-dev 0.2.2 armhf Hardware Abstraction Layer for MATRIX (headers)
ii libmatrixio-malos:armhf 0.1.2 armhf Libraries of MATRIX abstraction layer for MOS
ii libmatrixio-protos:armhf 0.1.1 armhf Protocolbuffers for MATRIX abstraction layer

Great thanks!! Any chance the install file can be changed so that this works at once?

Also I still get lots of errors:
[INFO] ------------------------------------------------------------------------
[INFO] Building Alexa Voice Service Sample Java Client 20160207.7
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — exec-maven-plugin:1.2.1:exec (default-cli) @ sample-java-client —
[2723:2758:0218/152220.319614:ERROR:cert_verify_proc_nss.cc(912)] CERT_PKIXVerifyCert for localhost failed err=-8179
[3103:3103:0218/152222.156975:ERROR:gl_surface_glx.cc(412)] GLX 1.3 or later is required.
[3103:3103:0218/152222.157094:ERROR:gl_initializer_x11.cc(156)] GLSurfaceGLX::InitializeOneOff failed.
[3103:3103:0218/152222.162530:ERROR:gpu_child_thread.cc(264)] Exiting GPU process due to errors during initialization
[1:12:0218/152222.200493:ERROR:adm_helpers.cc(62)] Failed to query stereo recording.

But Alexa seems awake, listens and responds,

Next step is to get things working after reboot without the need to log in. Do you have any pointers for that?

ah i understand, the tests are failing, i did never run them, maybe they are broken, but you can can try get everything up and running, my tests are failing too

Update.
a quick fix is to comment out the tests in.

automated_install.sh
#  cd $Wake_Word_Agent_Loc/tst && cmake . && make -j4

alternative, modify the tst/CMakeLists.txt, i’ll create a pull request on the repo to include this fix.

diff --git a/samples/wakeWordAgent/tst/CMakeLists.txt b/samples/wakeWordAgent/tst/CMakeLists.txt
index 1c5d375..a4a9c13 100644
--- a/samples/wakeWordAgent/tst/CMakeLists.txt
+++ b/samples/wakeWordAgent/tst/CMakeLists.txt
@@ -31,6 +31,9 @@ set( WAKE_WORD_AGENT_TEST_LIBS
         sensory
         wiringPi )

+FIND_LIBRARY(HAL_LIB NAMES matrix_creator_hal)
+message(STATUS "HAL found => " "${HAL_LIB}")
+
 find_package( Threads )
 set( CMAKE_THREAD_PREFER_PTHREAD TRUE )

@@ -45,6 +48,7 @@ target_include_directories( wakeWordAgentTest PRIVATE ${CMAKE_SOURCE_DIR}/../ext

 target_link_libraries( wakeWordAgentTest ${WAKE_WORD_AGENT_TEST_LIBS} )
 target_link_libraries( wakeWordAgentTest ${CMAKE_THREAD_LIBS_INIT} )
+target_link_libraries( wakeWordAgentTest ${HAL_LIB} )

 add_library( snowboy-detect STATIC IMPORTED )
 set_target_properties( snowboy-detect PROPERTIES IMPORTED_LOCATION

Thanks, I hope you will get the github files updated :slight_smile:

You can try to create a service that runs a script with this commands:

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

cd /home/pi/alexa-avs-sample-app/samples/javaclient/
Xvfb :1 &
export DISPLAY=:1
mvn exec:exec &

cd /home/pi/alexa-avs-sample-app/samples/wakeWordAgent/src
sleep 30
./wakeWordAgent -e sensory

for the service check here

Let me know how it goes

Thanks, the autostart is now working:

Step 1 – Create Your Script
sudo nano /usr/local/bin/AlexaStart.sh
add:

#!/bin/bash
# AlexaStart.sh
set -e
cd ~/Desktop/alexa-avs-sample-app/samples/companionService/
npm start &
cd ~/Desktop/alexa-avs-sample-app/samples/javaclient
export DISPLAY=:1
mvn exec:exec &
cd ~/Desktop/alexa-avs-sample-app/samples/wakeWordAgent/src
sleep 30
./wakeWordAgent -e sensory

save the file

sudo chmod +x /usr/local/bin/AlexaStart.sh

Step 2 – Create A Unit File
sudo nano /lib/systemd/system/AlexaStart.service
add:

[Unit]
Description=AlexaStart Service
After=multi-user.target

[Service]
Type=simple
User=pi
ExecStart=/bin/bash /usr/local/bin/AlexaStart.sh

[Install]
WantedBy=multi-user.target

save the file

sudo chmod 644 /lib/systemd/system/AlexaStart.service

Step 3 – Configure system
sudo systemctl daemon-reload
sudo systemctl enable AlexaStart.service

Great to hear that @OPK!

Thanks for posting your steps, so other can use it :+1:

Glad to help!

Hello,

I tried your Autostart, but unfortunately it doesn’t work for me :-(.

I tried to see the errors by running it with “bash -x” an I got this:

~ $ bash -x AlexaStart.sh

  • set -e
  • cd /home/pi/Desktop/alexa-avs-sample-app/samples/companionService/
  • cd /home/pi/Desktop/alexa-avs-sample-app/samples/javaclient
  • npm start
  • export DISPLAY=:1
  • DISPLAY=:1
  • cd /home/pi/Desktop/alexa-avs-sample-app/samples/wakeWordAgent/src
  • sleep 30
  • mvn exec:exec

alexa-voice-service-sample-companion-service@1.0.0 start /home/pi/Desktop/alexa-avs-sample-app/samples/companionService
node ./bin/www

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! 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.
npm ERR! 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 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! System Linux 4.9.35-v7+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” "start"
npm ERR! cwd /home/pi/Desktop/alexa-avs-sample-app/samples/companionService
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/Desktop/alexa-avs-sample-app/samples/companionService/npm-debug.log
npm ERR! not ok code 0
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Alexa Voice Service Sample Java Client 20160207.7
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — exec-maven-plugin:1.2.1:exec (default-cli) @ sample-java-client —
Exception in thread “main” java.awt.AWTError: Can’t connect to X11 window server using ‘:1’ as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at com.amazon.alexa.avs.config.DeviceConfig.canOnlyDoHeadless(DeviceConfig.java:200)
at com.amazon.alexa.avs.config.DeviceConfig.(DeviceConfig.java:192)
at com.amazon.alexa.avs.config.DeviceConfigUtils.readConfigFile(DeviceConfigUtils.java:118)
at com.amazon.alexa.avs.config.DeviceConfigUtils.readConfigFile(DeviceConfigUtils.java:50)
at com.amazon.alexa.avs.App.(App.java:39)
at com.amazon.alexa.avs.App.main(App.java:34)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.388s
[INFO] Finished at: Sun Mar 04 17:41:41 CET 2018
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project sample-java-client: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

  • ./wakeWordAgent -e sensory
    INFO:main: Starting Wake Word Agent
    INFO:WakeWordAgent: State set to IDLE(2)
    INFO:Initializing Sensory library | library name: TrulyHandsfree | library version: 5.0.0-beta.10.2 | model file: …/ext/resources/spot-alexa-rpi.snsr
    WARNING:Library expires on: License expires on 28 Jun 2018 00:00:00 GMT
    xcb_connection_has_error() returned true
    INFO:SensoryWakeWordEngine: mainLoop thread started
    INFO:WakeWordIPCSocket::mainLoop thread started
    INFO:WakeWordIPCSocket: init socket on port:5123
    INFO:Not connected! Make sure AVS client is running
    INFO:WakeWordAgent: thread started
    INFO:Not connected! Make sure AVS client is running

Thanks in advance for an advice.