ZigBee Gateway troubleshooting

Hi, I’m having some problems with using ZigBee. I’ve followed the instructions on

I’ve ran the test_zigbee.js in js_test, and it is hanging on “Requesting ZigBee Network Status”. Running malos_zigbee in a separate terminal, I get the following:

pi@raspberrypi:/usr/share/matrixlabs/matrixio-devices $ malos_zigbee
MALOS ZigBee starting

You can query specific driver info using port 40000.
Registered driver Zigbee with port 40001.
New delay between updates for Zigbee is 1000 ms.
New timeout after last ping for Zigbee 1000 ms.
Connecting to the ZigbeeGateway
Listening for connections on port 4901
Listening for connections on port 4900
Waiting for client connection on port 4901
client: connecting to
Connected to the Gateway
New connection from client on port 4901
ZigBeeGateway: ../../../protocol/zigbee_5.7/app/framework/util/af-main-host.c:372: emAfResetAndInitNCP: Assertion `0' failed.
Gateway socket hung up
*** buffer overflow detected ***: malos_zigbee terminated

After doing some googling, I found

has had the exact same issue.

This post

offered a solution, so I followed the following steps:

  1. Comment https://github.com/matrix-io/matrix-creator-init/blob/master/em358-program.bash#L78 in /usr/share/matrixlabs/matrixio-devices/em358-program.bash
  2. cd /usr/share/matrixlabs/matrixio-devices`
  3. sudo ./em358-program.bash`

the output of sudo ./em358-program.bash:

pi@raspberrypi:/usr/share/matrixlabs/matrixio-devices $ sudo ./em358-program.bash
*** Running the program instead of the bootloader

Then the output for /usr/share/matrixlabs/matrixio-devices/blob/ZigBeeGateway -n 1 -p ttyS0:

pi@raspberrypi:/usr/share/matrixlabs/matrixio-devices $ /usr/share/matrixlabs/matrixio-devices/blob/ZigBeeGateway -n 1 -p ttyS0
Reset info: 11 (SOFTWARE)
ERROR: ezspForceReset 0x21
ZigBeeGateway: ../../../protocol/zigbee_5.7/app/framework/util/af-main-host.c:372: emAfResetAndInitNCP: Assertion `0' failed.
ZigBeeGateway>Child process for serial input got EOF. Exiting

I’m not sure what to do now, help would be appreciated.

1 Like


i am having the same problem! did you ever fix it?


Sorry, I’ve had no luck fixing the issue.

1 Like

Hi @ecc21 and @randlea2,

We’ve been looking into this issue and are still trying to pinpoint the fix for it.

One interesting observation, if you uninstall and re-install matrixio-malos-zigbee and reboot after each process, ZigBee starts working again. This is not a permanent fix but could work temporarily.

I’ve been using these files to test, one to register a device and one to control it which was written by one of our software developers.

Will send you updates when we have more information on a solution.




Just wondering is there any update on this?


I am having the same problem, any update on this?

Also when running

sudo ./em358-program.bash

the output is the same as described in the first post.

The log written to “/tmp/em358-program.log” looks like this:

Open On-Chip Debugger 0.10.0-dev-g6165f43c-dirty (2019-06-27-05:36)
Licensed under GNU GPL v2
For bug reports, read
BCM2835 GPIO config: tck = 17, tms = 4, tdi = 22, tdo = 27
BCM2835 GPIO config: trst = 18
trst_only separate trst_push_pull
adapter speed: 200 kHz
Warn : em357.bs.bs: nonstandard IR value
Warn : Specify TAP 'em357.cpu.cpu' by name, not number 0
cortex_m reset_config vectreset
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : JTAG only mode enabled (specify swclk and swdio gpio to add SWD mode)
Info : clock speed 200 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: em357.cpu.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (0) in DAP response
Error: Could not initialize the debug port
Error: Target not examined yet


The failing assertion seems to come from here. The comments in the code say “If this fails, odds are the simulated NCP doesn’t have enough memory allocated to it.”

It seems to be an issue caused by the Raspberry Pi 4. I was able to succesfully run the test_zigbee.js sample by putting the same SD card and same Matrix Creator into a Raspberry Pi 3.

EDIT: After booting the Raspberry Pi 3 you have to wait for 2-3min for the matrixio-devices-firmware service to start up, otherwise the error also occurs on the Raspberry Pi 3. After succesfully running the sample on the Raspberry Pi 3 it did also work on the Raspberry Pi 4. I suspect that programming the MCU with the em358-program.bash script does not work on the Raspberry Pi 4 but has to be done only once.

1 Like


Thank you for sharing your findings, I will run this by our hardware engineers to confirm.