Can't Get Alexa to work

I have Spent many days on getting Alexa to work with the Respeaker and cannot get it to work.

I have a Pi 3 Model B+

And a Respeaker 4 Mic Array HAT



When I run python ns_kws_doa_alexa_with_light.py or ns_kws_doa_alexa.py I get



Traceback (most recent call last):

File “ns_kws_doa_alexa_with_light.py”, line 13, in

from voice_engine.source import Source

ImportError: No module named voice_engine.source



Sometimes I also get

File “ns_kws_doa_alexa.py”, line 20

from avs.alexa import Alexa

^

IndentationError: unexpected indent



Can someone help me get Alexa working completely

Thank you

Hi there,


  1. it seems voice engine is not installed correctly. please try below steps.



    git clone https://github.com/voice-engine/voice-engine.git

    cd voice-engine

    python setup.py bdist_wheel

    pip install dist/*.whl


  2. you also can download the image 2018-08-06-raspbian-for-respeaker.zip with driver and alexa setup. <LINK_TEXT text=“https://v2.fangcloud.com/share/7395fd13 … 8000207913”>https://v2.fangcloud.com/share/7395fd138a1cab496fd4792fe5?folder_id=188000207913</LINK_TEXT>



    first, if you want to use the interactive function, please enter alexa-auth to apply for authorization. After the authorization is successful, the .avs.json file will be generated in the /home/pi directory, and then the interactive function can be used.



    second, there will be a respeaker routine folder in the /home/pi directory, which can be used depending on the mic used. You can update it by executing the git pull origin master command in the related directory. then you can run the python code to active the respeaker. thanks.

I have downloaded your image file and run succesfully authorized with config file etc.,… when I run alexa: I am getting following error:
pi@raspberrypi:~ $ alexa
Traceback (most recent call last):
File “/usr/local/bin/alexa”, line 7, in
from avs.main import main
File “/usr/local/lib/python2.7/dist-packages/avs/main.py”, line 22, in
from respeaker.pixel_ring import pixel_ring
ImportError: No module named respeaker.pixel_ring

If I run with " alexa-tap"

then following message.

press ENTER to talk
INFO:hyper.http20.connection:Received unhandled event <RemoteSettingsChanged changed_settings:{ChangedSetting(setting=SettingCodes._max_header_list_size, original_value=None, new_value=8192)}>
INFO:hyper.http20.connection:Received unhandled event <SettingsAcknowledged changed_settings:{ChangedSetting(setting=SettingCodes.ENABLE_PUSH, original_value=1, new_value=0)}>
INFO:hyper.http20.connection:Received unhandled event <SettingsAcknowledged changed_settings:{}>
INFO:hyper.http20.connection:Received unhandled event <RemoteSettingsChanged changed_settings:{ChangedSetting(setting=SettingCodes.MAX_CONCURRENT_STREAMS, original_value=None, new_value=100)}>
INFO:avs.alexa:wait for response
INFO:avs.alexa:status code: 200
INFO:avs.alexa:{
“header”: {
“namespace”: “System”,
“name”: “SetEndpoint”,
“messageId”: “971efe81-6912-4a42-aba8-1f984bae5d3e”
},
“payload”: {
“endpoint”: “https://bob-dispatch-prod-eu.amazon.com
}
}
INFO:avs.alexa:on_ready

When I open another terminal run : 6mic folder python file, i will get following error in both first in this window and another window.

pi@raspberrypi:~/respeaker/6mic $ python aec_ns_kws_doa_alexa.py
[‘arecord’, ‘-t’, ‘raw’, ‘-f’, ‘S16_LE’, ‘-c’, ‘8’, ‘-r’, ‘16000’, ‘-D’, ‘default’, ‘-q’]
arecord: main:788: audio open error: Device or resource busy

I have tested the following command: “speaker-test -t wav”. able to hear the voice…

** “alexa-tap” command in window displays the continuous message, until I close the aec_ns_kws_doa_alexa.py :**

alexa-tap window : error

ERROR:avs.alexa:‘NoneType’ object has no attribute ‘can_read’
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/avs/alexa.py”, line 110, in run
self._run()
File “/usr/local/lib/python2.7/dist-packages/avs/alexa.py”, line 159, in _run
while conn._sock.can_read:
AttributeError: ‘NoneType’ object has no attribute ‘can_read’
INFO:hyper.http20.connection:Received unhandled event <RemoteSettingsChanged changed_settings:{ChangedSetting(setting=SettingCodes._max_header_list_size, original_value=None, new_value=8192)}>
INFO:hyper.http20.connection:Received unhandled event <SettingsAcknowledged changed_settings:{ChangedSetting(setting=SettingCodes.ENABLE_PUSH, original_value=1, new_value=0)}>
INFO:hyper.http20.connection:Received unhandled event <SettingsAcknowledged changed_settings:{}>
INFO:hyper.http20.connection:Received unhandled event <RemoteSettingsChanged changed_settings:{ChangedSetting(setting=SettingCodes.MAX_CONCURRENT_STREAMS, original_value=None, new_value=100)}>
INFO:avs.alexa:wait for response
INFO:avs.alexa:status code: 200
INFO:avs.alexa:{
“header”: {
“namespace”: “System”,
“name”: “SetEndpoint”,
“messageId”: “f4ad8816-e6d4-4721-82be-209df0687247”
},
“payload”: {
“endpoint”: “https://bob-dispatch-prod-eu.amazon.com
}
}