Matrix Voice: Matrix device has not been detected

Hi Ms/Mr,

I really need help to start with Matrix Voice + Raspberry Pi 3. I wrote a post yesterday but it seem not clear and no one reply to it. Please respond and tell me what information i need to provide to have some helps. I received the Matrix Voice from my teacher few days ago after 1 or 2 months of shipment.

  1. When i attach Matrix voice to Raspberry Pi 3, the led on the board ON (white or blue, i dont remember), except 1 of them OFF. Look really okay, same as your demo.
  2. After that, I started with this tutorial:
    https://www.hackster.io/matrix-labs/matrix-voice-and-matrix-creator-running-alexa-c-version-9b9d8d
    I used the pre-installed image of Raspian. Every step is ok. At running step, the result is:
  • all leds are blue color.
  • the terminal show that Alexa is IDLE and repeat the messsage “AbstractKeywordDetector:readFromStreamFailed:reason=readerTimeOut”
  • the board doesn’t respond to “Alexa” keyword
  • The color of leds on Matrix seem respond to “t” + Enter, change from Blue (IDLE) to Green (LISTENING) to Red (THINKING). But at any status, it did not respond to my command “what time is it?”. I test on Google on my Samsung phone, it can recognize my voice.
    These things give me an idea that the microphone doesn’t work well. So, I tried some of your hardware test tutorials.
  1. After i’m fail to run the Alexa, i can not make the leds on the board back to the factory setting (like i described in 1. ). When i unplug and plug again, detach and attach again, all leds on board stay OFF.

  2. I tried “Hardware Test”, “Microphone test”, recording and play,… but nothing worked.
    any command using Matrix Voice hardware tell me " Matrix device has not been detected".

  3. I did try reflashing FPGA, using clean original v4.19 Raspian stretch. But nothing changes.

Please give me some advices, if this post is not good to be understand, please tell me to make it more clear.
Thank you so much.

Update:
I realize that my power supply is 5.1V - 2.1A (an Ipad charger with mircro usb cable), while Raspberry Pi 3 requirement is 5V - 2.5A.
I’m going to buy a new adapter tomorrow, it will be 5V - 2.5A. I’ll test everything again with the new adapter and update the result.
Question for this case:

  • Can a 5V - 3A or 5.1V - 3A be good power supply for Matrix Voice + Raspberry Pi 3B?

Thanks.

@kitkat,

5V/5.1V and greater than 2.5A should work fine so you should be good. Though, 5V is best.

About the LED startup sequence, that only happens the very first time you plug it in to power as it is a factory setting. After that, the LEDs will always be off unless a program is running that turns them on.

I will need to test the Alexa issue you are having, it could be something with the Alexa SDK that got changed.

Once you have the proper power supply, I would recommend installing MATRIX Lite as shown here on a fresh install of Raspbian Buster and run the JS examples.

If your issue persists, please let me know.

Best,
Samreen

I will test it with new adapter and update result soon.
Thank for your kindly help.

Dear Samreen,
I’ve done some tests with proper power supply.

  1. Rainbow led in JS example didn’t work. I installed new Raspian Buster with desktop from https://www.raspberrypi.org/downloads/raspbian/
    I didn’t follow strictly the instruction you recommended, because there were some differences in NodeJS version. But i think that I have installed NodeJs successfully.
    The command: node index.js
    -> the result: Matrix device has not been detected

  2. I also try another example here:
    https://matrix-io.github.io/matrix-documentation/matrix-hal/getting-started/programs/
    But it still show: Matrix device has not been detected

  3. I find another post on the community
    Matrix Voice - MATRIX device has not been detected (No JTAG Chain found)
    I follow your recommend

I tried this on 02 different Raspberry Pi 3 B. But this one still doesn’t work. The result is:


Are there any way to reset all hardware to factory setting/or any stable version that can run an example?
Please give me some suggestions. I’ll try hard to figure it out.

Thanks.
Kitkat

@kitkat,

Apologies for the delayed response.

At this point, I would recommend steps 1 and 2 in the hardware test here if you have not done so already.

If you get **** Could not program FPGA" , try the following:

Reset the FPGA.

echo 26 > /sys/class/gpio/export 2>/dev/null
echo out > /sys/class/gpio/gpio26/direction  
echo 1 > /sys/class/gpio/gpio26/value  
echo 0 > /sys/class/gpio/gpio26/value  
echo 1 > /sys/class/gpio/gpio26/value

Flash the SPI Flash bootloader onto FPGA.

xc3sprog -c matrix_voice blob/bscan_spi_s6lx9_ftg256.bit

You should receive the following (may vary due to user-provided file).

XC3SPROG (c) 2004-2011 xc3sprog project $Rev: 774 $ OS: Linux
Free software: If you contribute nothing, expect nothing!
Feedback on success/failure/enhancement requests:
        http://sourceforge.net/mail/?group_id=170565
Check Sourceforge for updates:
        http://sourceforge.net/projects/xc3sprog/develop

DNA is 0xf9d61a1ecbb64401

Flash the SPI Flash.

xc3sprog -c matrix_voice -I blob/system_voice.bit

You should receive the following (may vary due to user-provided file).

XC3SPROG (c) 2004-2011 xc3sprog project $Rev: 774 $ OS: Linux
Free software: If you contribute nothing, expect nothing!
Feedback on success/failure/enhancement requests:
        http://sourceforge.net/mail/?group_id=170565
Check Sourceforge for updates:
        http://sourceforge.net/projects/xc3sprog/develop

JEDEC: c2 20 0x17 0xc2
Found Macronix MX25L Device, Device ID 0x2017
256 bytes/page, 262144 pages = 67108864 bytes total
Verify: Success!

Reset the FPGA.

echo 26 > /sys/class/gpio/export 2>/dev/null
echo out > /sys/class/gpio/gpio26/direction  
echo 1 > /sys/class/gpio/gpio26/value  
echo 0 > /sys/class/gpio/gpio26/value  
echo 1 > /sys/class/gpio/gpio26/value

Power off your device.

sudo poweroff

Wait until the green led on your Raspberry Pi blinks 10 times, then unplug the power cable from your Raspberry Pi.

Plug the power cable back into your Raspberry Pi.

I would recommend trying this on a fresh install of Raspbian Buster. If this doesn’t work, let me know and I can give you some further recommendations.

Best,
Samreen

Hi Samreen,

The problem is still there.
I’m sure that the installation has been done correctly in a fresh Raspbian Buster. I also try flashing the FPGA. Here is the result:


After flash and reboot:

Please give me some more advices.
Thank for your kindly help.

Kitkat.

@kitkat,

Good news is your FPGA is detected and can be successfully flashed so I think we need to troubleshoot just a bit more.

Can you after the next reboot, try:

cd /usr/share/matrixlabs/matrixio-devices/
sudo ./fpga-program.bash 

Then try the matrix-init script again.

sudo ./matrix-init.bash 

Please send me the images of both outputs. Thank you!

Best,
Samreen

I’ve just done it. The result:

Kitkat.

So odd. Can you send me output of the following?

cat /sys/firmware/devicetree/base/model
uname -a
lsb_release -a

Additionally, can you flash the FPGA manually again like you did here
image
At the end, don’t flash and reboot, instead try running an LED example.

Best,
Samreen

Hi Samreen,
Please see below:

And,

Do you mean the flashing process starting with this:

echo 26 > /sys/class/gpio/export 2>/dev/null
echo out > /sys/class/gpio/gpio26/direction  
echo 1 > /sys/class/gpio/gpio26/value  
echo 0 > /sys/class/gpio/gpio26/value  
echo 1 > /sys/class/gpio/gpio26/value

Kitkat.

Yup!

Let me know how it goes,

Best,
Samreen

Hi Samreen,

Please see below pic:

I notice that the DNA is different now. 2 hex numbers at the tail of DNA string is ‘00’ now. It was ‘fe’ at the first time. Is it a problem? I don’t know about what these numbers mean.

Kitkat.

@kitkat,

It is normal for the DNA to change as I believe that is a number that includes variables like date and time.

Can you try installing the MATRIX kernel modules and run a HAL example again?

HAL uses a different communication method when the kernel modules are installed. Let me know if it still says “device not detected.”

To install the kernel modules

sudo apt install matrixio-kernel-modules

Then reboot

sudo reboot

Best,
Samreen

Hi Samreen,

It does not change.

Please advice. I will try any suggestions.
Thanks a lot for your time :smiley:

Kitkat.

@kitkat,

Thinking about it. This is definitely new for me.

Can you show me the output of arecord -l?

I would like to see if the MATRIX Voice microphones are detected by the kernel modules.

Additionally, can you send me a picture of your device setup?

Thanks!

Best,
Samreen

Please see below pictures:

I remember that when i run Alexa C/C++ version tutorial from Hackster.io. All leds can be controlled by the “t” commands from Terminal (change from blue to green to red). But the microphones seem don’t listen to me.
Is that mean the Matrix is detected?

Kitkat.

@kitkat,

:open_mouth:

Your MATRIX device is detected by kernel modules!

Please try

arecord recording.wav -f S16_LE -r 16000 -d 5
aplay recording.wav  

See if you can hear the recording with earphones or speaker.

If the LEDs worked with Alexa, that means your devices was detected for sure. The wakeword not working could have been caused by Alexa SDK issues since that image is fairly old- on Raspbian Stretch with the old Linux kernels. We need to update it.

Did you install MATRIX HAL from package with sudo apt install?

Can you try Lite JS one more time on this setup?

In the meantime, I’ll test with the example repo you are using.

Best,
Samreen

Hi Samreen,

Which thing confirm that? LED worked with Alexa or “arecord - l” output? or both?

I try recording wav file as you suggested.
First, i test my earphones with an example wav file from internet, “aplay” command can run that file. So my earphones are okay. When i run the command:

arecord recording.wav -f S16_LE -r 16000 -d 5

The terminal seem can not exit below status, it remains like below and doesn’t stop after 5s. I have to force it to stop after 1 or 2 mins. There is still a wav file created, but it seem don’t have data, can’t hear anything when i play it.
1

Yes, I did. Followed the instruction here https://matrix-io.github.io/matrix-documentation/matrix-hal/getting-started/installation-package/

The Lite JS example still dont work. Please see below:


But i’ll try it again, since there are a lot of warning of npm during the installation. I’ll update soon.

Hope it will be figured out soon :smiley: so sorry for taking so much time of you.

Kitkat.

@kitkat,

Both the LEDs working and the arecord -l output indicated that the device is detected.

The warnings are normal, I would not recommend another setup from scratch. We are trying to think about what it could be.

Could you also try below in terminal?

echo  000000 > /dev/matrixio_everloop

It should make 1 LED light up white using the MATRIX kernel modules. Let me know if it works!

Best,
Samreen