matrix-io / matrix-malos-zigbee

MALOS service for ZigBee
GNU General Public License v3.0
5 stars 6 forks source link

ZigBeeGateway: Assertion `0' failed #10

Closed draity closed 6 years ago

draity commented 6 years ago

Hi I'm currently testing Zigbee with my Matrix Creator. Unfortunately I can't find a solution for the following error when running the test_zigbee.js:

ZigBeeGateway: ../../../protocol/zigbee_5.7/app/framework/util/af-main-host.c:372: emAfResetAndInitNCP: Assertion '0' failed.

What I did:

After these steps I'm successfully connected to the ZigBeeGateway, but I get the following output form malos_zigbee while the nodejs test app gets stuck on Requesting ZigBee Network Status:

**************
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 127.0.0.1
Connected to the Gateway
New connection from client 127.0.0.1:35724 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
Aborted

The only match I found for the given error message describes how to avoid an out of memory error: https://www.silabs.com/community/wireless/zigbee-and-thread/knowledge-base.entry.html/2012/06/29/why_do_i_get_ezsper-Rod0

Because the source of ZigBeeGateway is not accessible I don't know what to do next. Is this problem connected to the Raspberry Pi 2 I'm using? Are there any additional logs available for the ZigBeeGateway? Any ideas how to fix/avoid this error?

kdpatino commented 6 years ago

Hello @draity

We release a new version, that solves this issue. https://github.com/matrix-io/matrix-malos-zigbee/releases/tag/v0.1.3. You just need to update your matrixio-malos-zigbee.

Also, we updated our documentation. https://github.com/matrix-io/matrix-malos-zigbee/blob/master/README.md

Let me know if you have any doubt about it.

Regards,

Kevin Patino

draity commented 6 years ago

Hey @kdpatino

thanks for your answer!

Unfortunately, the latest update to v0.1.3 didn't solve the issue. I did a complete reinstall which resulted in the same error as mentioned above when using the current JS examples. All other matrixio dependencies are up-to-date, too.

I'm going to try it again when my ordered Raspberry Pi 3 arrives.

draity commented 6 years ago

Hey @kdpatino,

I installed Raspian Stretch Lite on a new RaspberryPi 3 and followed your instructions -> same error message.

kdpatino commented 6 years ago

Hello @draity ,

I just check it, I found that the verification process in the matrixio-creator-init package has an issue.matrix-init issue

Also, we are working on to create Linux service instead to use a syscall in the malos zigbee driver.

Meanwhile, you could:

  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

At the end it will be show you:

wrote 4200 bytes to file /tmp/em358_dump from flash bank 0 at offset 0x00000000 in 0.142001s (28.884 KiB/s)
shutdown command invoked
TEST=1
****  EM358 MCU programmed!
Running the program instead of the bootloader

Then run: /usr/share/matrixlabs/matrixio-devices/blob/ZigBeeGateway -n 1 -p ttyS0

/usr/share/matrixlabs/matrixio-devices/blob/ZigBeeGateway -n 1 -p ttyS0 
Reset info: 11 (SOFTWARE)
ezsp ver 0x04 stack type 0x02 stack ver. [5.7.2 GA build 444]
Ezsp Config: set source route table size to 0x0007:Success: set
Ezsp Config: set security level to 0x0005:Success: set
Ezsp Config: set address table size to 0x000A:Success: set
Ezsp Config: set TC addr cache to 0x0002:Success: set
Ezsp Config: set stack profile to 0x0002:Success: set
Ezsp Config: set MAC indirect TX timeout to 0x1E00:Success: set
Ezsp Config: set max hops to 0x001E:Success: set
Ezsp Config: set tx power mode to 0x8000:Success: set
Ezsp Config: set supported networks to 0x0001:Success: set
Ezsp Policy: set binding modify to "allow for valid endpoints & clusters only":Success: set
Ezsp Policy: set message content in msgSent to "return":Success: set
Ezsp Value : set maximum incoming transfer size to 0x00000052:Success: set
Ezsp Value : set maximum outgoing transfer size to 0x00000052:Success: set
Ezsp Config: set binding table size to 0x0002:Success: set
Ezsp Config: set key table size to 0x0000:Success: set
Ezsp Config: set max end device children to 0x0006:Success: set
Ezsp Config: set rf4ce pairing table size to 0x0001:Success: set
Ezsp Config: set rf4ce pending outgoing packet table size to 0x0008:Success: set
NCP supports maxing out packet buffers
Ezsp Config: set packet buffers to 255
Ezsp Config: set end device poll timeout to 0x0005:Success: set
Ezsp Config: set end device poll timeout shift to 0x0006:Success: set
Ezsp Config: set zll group addresses to 0x0000:Success: set
Ezsp Config: set zll rssi threshold to 0xFF80:Success: set
Ezsp Config: set transient key timeout to 0x012C:Success: set
Ezsp Endpoint 1 added, profile 0x0104, in clusters: 7, out clusters 22
Ezsp Policy: set TC Key Request to "Deny":Success: set
Ezsp Policy: set App. Key Request to "Allow":Success: set
Ezsp Policy: set Trust Center Policy to "Allow Joins, ignore preconfigured key rejoins":Success: set
ZigBeeGateway>

If you complete this steps without troubles, you are ready to use matrixio-malos-zigbee

(If you got these results uncomment the line in /usr/share/matrixlabs/matrixio-devices/em358-program.bash)

Thank You for your feedback.

draity commented 6 years ago

Hey @kdpatino,

thank you! Your instructions worked as you expected. Now I'm able to control an IKEA Tradfri bulb :)

As you already created another issue in matrix-creator-init I'm closing this now.

Thanks again for your support! I'm happy to test further updates.

kdpatino commented 6 years ago

Hello @draity

I already released a new version of matrix-creator-init: https://github.com/matrix-io/matrix-creator-init/releases/tag/v0.4.5.

You just need to update and upgrade your debian packages.

Thank You for your feedback.