Cant connect Timed out waiting for packet header

Hello, ive just tried to setup my nice new Matrix Voice ESP32, but Im not getting very far at all. Unfortunately its not connecting right at the start.
using this guide:
https://matrix-io.github.io/matrix-documentation/matrix-voice/esp32/
when i get to the step to run -
esptool.py --chip esp32 --port /dev/ttyS0 --baud 115200 --before default_reset --after hard_reset erase_flash
I get a timeout error:-
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

image

I have tried a pi4 and a pi zero, both with the same result.

I found another command to run, shown in the snip. it shows no device detected.
Is it dead?

I have tried some commands from the troubleshooting document and some ideas from this post.

But i am still stuck.

My voice is currently perched on top of a Pi4b with a genuine pi 3a power supply.
I did try it on a Pi0 yesterday, but the result was the same

here is some output from things ive tried.
Although there are lots of errors connecting, there is some succes from ‘sudo xc3sprog -j -c sysfsgpio_voice’ & ‘sudo xc3sprog -c sysfsgpio_voice’ shown below.

Would appreciate some help. thanks.

pi@zen:~ $ sudo /usr/share/matrixlabs/matrixio-devices/matrix-init.bash
MATRIX device has not been detected

MATRIX device has not been detected^C
pi@zen:~ $
pi@zen:~ $
pi@zen:~ $ sudo /usr/share/matrixlabs/matrixio-devices/fpga_info
INFO: [/dev/spidev0.0] was opened
MATRIX device has not been detected
FPGA IDENTIFY = 0
FPGA VERSION = 10bc4
pi@zen:~ $ ^C
pi@zen:~ $ cd /usr/share/matrixlabs/matrixio-devices
pi@zen:/usr/share/matrixlabs/matrixio-devices $ sudo xc3sprog -c sysfsgpio_voice                                                                                                                                blob/bscan_spi_s6lx9_ftg256.bit
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

WARNING: gpio 23 already exported
WARNING: gpio 17 already exported
WARNING: gpio 27 already exported
WARNING: gpio 22 already exported
**DNA is 0x992e833063d0b700**
pi@zen:/usr/share/matrixlabs/matrixio-devices $ 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
pi@zen:/usr/share/matrixlabs/matrixio-devices $ sudo /usr/share/matrixlabs/matri                                                                                                                               xio-devices/fpga_info
INFO: [/dev/spidev0.0] was opened
MATRIX device has not been detected
FPGA IDENTIFY = 0
FPGA VERSION = 10bc4
pi@zen:/usr/share/matrixlabs/matrixio-devices $ sudo ./fpga-program.bash
MATRIX device has not been detected
**** Could not program FPGA
pi@zen:/usr/share/matrixlabs/matrixio-devices $ sudo xc3sprog -c sysfsgpio_voice blob/bscan_spi_s6lx9_ftg256.bit
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 0x992e833063d0b7fe
pi@zen:/usr/share/matrixlabs/matrixio-devices $ sudo xc3sprog -j -c sysfsgpio_voice
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

JTAG loc.:   0  IDCODE: 0x24001093  Desc:                        XC6SLX9 Rev: C  IR length:  6
pi@zen:/usr/share/matrixlabs/matrixio-devices $ curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                         Dload  Upload   Total   Spent    Left  Speed
100  2203  100  2203    0     0   4789      0 --:--:-- --:--:-- --:--:--  4778
OK
pi@zen:/usr/share/matrixlabs/matrixio-devices $ echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
deb https://apt.matrix.one/raspbian buster main
pi@zen:/usr/share/matrixlabs/matrixio-devices $ sudo voice_esp32_enable
pi@zen:/usr/share/matrixlabs/matrixio-devices $ esptool.py --chip esp32 --port /dev/ttyS0 --baud 115200 --before default_reset --after hard_reset erase_flash
esptool.py v2.8
Serial port /dev/ttyS0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
pi@zen:/usr/share/matrixlabs/matrixio-devices $ sudo cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-53, parent: platform/fe200000.gpio, pinctrl-bcm2835:
 gpio-18  (                    |sysfs               ) out hi
 gpio-24  (                    |sysfs               ) out lo
 gpio-25  (                    |sysfs               ) out hi
 gpio-26  (                    |sysfs               ) out hi
 gpio-42  (                    |led0                ) out lo

gpiochip1: GPIOs 504-511, parent: platform/soc:firmware:gpio, raspberrypi-exp-gpio, can sleep:
 gpio-504 (BT_ON               )
 gpio-505 (WL_ON               )
 gpio-506 (PWR_LED_OFF         |led1                ) out lo
 gpio-507 (GLOBAL_RESET        )
 gpio-508 (VDD_SD_IO_SEL       |vdd-sd-io           ) out hi
 gpio-509 (CAM_GPIO            )
 gpio-510 (                    |vcc-sd              ) out hi
 gpio-511 (                    )
pi@zen:/usr/share/matrixlabs/matrixio-devices $ sudo /usr/share/matrixlabs/matrixio-devices/matrix-init.bash
MATRIX device has not been detected
**** Could not program FPGA
MATRIX device has not been detected
pi@zen:/usr/share/matrixlabs/matrixio-devices $

Hi @Gfawkes,

Welcome to the community!

I think your hardware is okay. Can you send me the output of the following:

uname -a

Did you make sure to run the following before trying to enable the ESP32 voice?

sudo apt update
sudo apt upgrade

Also, you can do a quick check of the microphones using ALSA on the Pi by following this example just to make sure. Note that every reboot is important as it loads the modules.

Let me know how it goes.

Best,
Samreen

Hello Samreen,
Thanks fro taking a look at this for me.

I tried your suggestions, and have made some progress.
I had run apt-get update/upgrade but run them again and rebooted just for the hell of it.
The suggested microphone check did work using the matrix kernal. i was able to record a test and played it back.
But i am still unable to flash / erase.
here is the console output of my efforts.
Thanks again.
GF

pi@zen:~ $ uname -a
Linux zen 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux

pi@zen:~ $ sudo reboot
login as: pi


pi@zen:~ $ sudo pt-get update
sudo: pt-get: command not found
pi@zen:~ $ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Hit:3 https://download.docker.com/linux/raspbian buster InRelease
Get:4 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Hit:5 https://apt.matrix.one/raspbian buster InRelease
Fetched 13.0 MB in 49s (267 kB/s)
Reading package lists... Done
pi@zen:~ $ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  rpi.gpio-common
The following packages will be upgraded:
  python-rpi.gpio
1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 26.5 kB of archives.
After this operation, 14.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.raspberrypi.org/debian buster/main armhf rpi.gpio-common armhf 0.7.0-0.1~bpo10+1 [5,776 B]
Get:2 http://archive.raspberrypi.org/debian buster/main armhf python-rpi.gpio armhf 0.7.0-0.1~bpo10+1 [20.8 kB]
Fetched 26.5 kB in 0s (256 kB/s)
Reading changelogs... Done
Selecting previously unselected package rpi.gpio-common:armhf.
(Reading database ... 61132 files and directories currently installed.)
Preparing to unpack .../rpi.gpio-common_0.7.0-0.1~bpo10+1_armhf.deb ...
Unpacking rpi.gpio-common:armhf (0.7.0-0.1~bpo10+1) ...
Preparing to unpack .../python-rpi.gpio_0.7.0-0.1~bpo10+1_armhf.deb ...
Unpacking python-rpi.gpio (0.7.0-0.1~bpo10+1) over (0.7.0~buster-1) ...
Setting up rpi.gpio-common:armhf (0.7.0-0.1~bpo10+1) ...
Setting up python-rpi.gpio (0.7.0-0.1~bpo10+1) ...

pi@zen:~ $ sudo reboot
login as: pi

pi@zen:~ $ sudo voice_esp32_enable
pi@zen:~ $ esptool.py --chip esp32 --port /dev/ttyS0 --baud 115200 --before default_reset --after hard_reset erase_flash
esptool.py v2.8
Serial port /dev/ttyS0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

pi@zen:~ $ uname -a
Linux zen 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux
pi@zen:~ $ curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2203  100  2203    0     0   3708      0 --:--:-- --:--:-- --:--:--  3702
OK

pi@zen:~ $ echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
deb https://apt.matrix.one/raspbian buster main
pi@zen:~ $ sudo apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Hit:3 https://download.docker.com/linux/raspbian buster InRelease
Hit:4 https://apt.matrix.one/raspbian buster InRelease
Reading package lists... Done
pi@zen:~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@zen:~ $ sudo apt install matrixio-kernel-modules
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  dkms raspberrypi-kernel-headers
Suggested packages:
  python3-apport menu
The following NEW packages will be installed:
  dkms matrixio-kernel-modules raspberrypi-kernel-headers
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.0 MB of archives.
After this operation, 163 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.raspberrypi.org/debian buster/main armhf raspberrypi-kernel-headers armhf 1.20200601-1 [24.9 MB]
Get:2 http://mirror1.it.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian buster/main armhf dkms all 2.6.1-4 [74.4 kB]
Get:3 https://apt.matrix.one/raspbian buster/main armhf matrixio-kernel-modules all 0.2.3 [20.6 kB]
Fetched 25.0 MB in 1min 14s (340 kB/s)
Selecting previously unselected package dkms.
(Reading database ... 61136 files and directories currently installed.)
Preparing to unpack .../archives/dkms_2.6.1-4_all.deb ...
Unpacking dkms (2.6.1-4) ...
Selecting previously unselected package raspberrypi-kernel-headers.
Preparing to unpack .../raspberrypi-kernel-headers_1.20200601-1_armhf.deb ...
Unpacking raspberrypi-kernel-headers (1.20200601-1) ...
Selecting previously unselected package matrixio-kernel-modules.
Preparing to unpack .../matrixio-kernel-modules_0.2.3_all.deb ...
Unpacking matrixio-kernel-modules (0.2.3) ...
Setting up dkms (2.6.1-4) ...
Setting up raspberrypi-kernel-headers (1.20200601-1) ...
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.19.118+
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.19.118-v7+
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.19.118-v7l+
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.19.118-v8+
Setting up matrixio-kernel-modules (0.2.3) ...
Loading new matrixio-kernel-modules-0.2.3 DKMS files...
It is likely that 4.19.118-v7l+ belongs to a chroot's host
Building for 4.19.118+, 4.19.118-v7+, 4.19.118-v7l+ and 4.19.118-v8+
Building initial module for 4.19.118+
Done.

matrixio-core.ko:
Running module version sanity check.
 - Original module
---------------------------------------------------
-------------------------------------------------- 
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.118-v7l+/kernel/drivers/mfd/

depmod...

DKMS: install completed.
Module build for kernel 4.19.118-v8+ was skipped since the
kernel headers for this kernel does not seem to be installed.
Enable configurations in /boot/config.txt
Processing triggers for man-db (2.8.5-2) ...


pi@zen:~ $ sudo reboot
login as: pi

pi@zen:~ $ arecord recording.wav -f S16_LE -r 16000 -d 5
Recording WAVE 'recording.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
pi@zen:~ $ aplay recording.wav
Playing WAVE 'recording.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
pi@zen:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  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
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
card 2: MATRIXIOSOUND [MATRIXIO-SOUND], device 1: matrixio.pcm-out.0 snd-soc-dummy-dai-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
pi@zen:~ $ 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
card 2: MATRIXIOSOUND [MATRIXIO-SOUND], device 0: matrixio.mic.0 snd-soc-dummy-dai-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
pi@zen:~ $ sudo voice_esp32_enable
pi@zen:~ $ esptool.py --chip esp32 --port /dev/ttyS0 --baud 115200 --before default_reset --after hard_reset erase_flash
esptool.py v2.8
Serial port /dev/ttyS0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
pi@zen:~ $

I am still stuck. 2 weeks later - i still cant connect/flash/erase.
I have contacted tech support twice but had no response from them either.

this seems like an interesting device and I would really appreciate some help before i condemn it to the drawer of death… I cant fix it myself.

@Samreen any chance you could look at this again? all the info you asked me for is in the last post.

@Gfawkes,

Can you send me pictures of your setup? Maybe of the MV+Pi assembly from an angle so I can see the pin connections and the bottom of your MATRIX Voice so I can see the ESP32 chip. I want to rule out any visible defects.

Best,
Samreen

Hi @Samreen

Thanks for taking a look at this.

Here are various pics. hopefully this is what you are after. Let me know if you need anything else
I did try this on a pi zero also with the latest Buster light that was a freshly built OS, but still had the same result.


Hi,

Maybe is a Raspbian version issue, what version have you? Please you can check it with:

lsb_release -a

Hi @Hpsaturn,

Here is the result of the command

image

It is a recent install of Buster Light. I have another pi I’ve tried, but that is also a recent build of Buster Light.

I would speculate that you are on the right track.Possibly a recent update to the OS is causing the issue?
Unfortunately i don’t have an old build to test this idea. But Matrix aught to be able to reproduce this quite easily.

Thanks

@Gfawkes,

I just tested with the latest Raspbian Buster Lite OS, Linux kernel version 4.19.118-v7+ on Pi 3 and 4.19.118-v7l+ on Pi 4 which seems to be the same as yours from your previous terminal outputs, and it worked for me with flashing the ESP32 on both.

My next instinct would be to check if your MATRIX packages are all the latest versions. Could you show me the output of

dpkg -l | grep matrix

Have you tried setting up from scratch just to check? I would flash a fresh install of Raspbian Buster and run everything here sequentially - adding packages and key, updating upgrading, installing MATRIX init package, the all-important reboot, then trying to flash the ESP32 after enabling it.

Best,
Samreen

Hi Samreen, thanks for trying on your setup.

I still have the same issue unfortunately.

I have tried as you suggest - wiping a card an installing a fresh OS.
The guide you refer to is the one i have been using.
I did all 6 steps in sequence from Step 1 but still the result is the same.
As i say, this was a fresh install of Buster Light on my Pi4.
I have not configured anything else or installed anything outside of these 6 steps.
Here is a snip of the dpkg output and the kernel version which appears to be the same as the one you tried.

I wonder if you are able to try a new matrix from your stock? (if you havn’t already!)

I am sure you have seen this recent post, but it looks to me like it may be the same issue.

@Gfawkes,

The issue in that post is different as they are using a MATRIX Creator and are having trouble connecting to the FPGA. We found from your above troubleshooting that you can record using ALSA so your FPGA is detected.

Since I am no longer sure if this is just a software issue for you with the ESP32 module, I am sending you a direct message to see if we can figure something out with the hardware.

Best,
Samreen