Legrandgroup / libezsp

C++ library to send/receive wireless Zigbee messages to/from a Silicon Labs-based transceiver using the EZSP protocol.
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link

libezsp fails creating a network on a dongle that is already outside of a network #73

Closed lionelains closed 4 years ago

lionelains commented 4 years ago

When running the sample program mainEzspTest with the -c argument, the tools correctly starts up only when the dongle was already previously in a Zigbee network. If the dongle was not in a previous network, libezsp startup fails with the following logs:

CLibEzspMain::handleEzspRxMessage EZSP_ADD_ENDPOINT
Call EZSP_NETWORK_INIT
CLibEzspMain::handleEzspRxMessage EZSP_ADD_ENDPOINT
Call EZSP_NETWORK_INIT
CLibEzspMain::handleEzspRxMessage EZSP_NETWORK_INIT
Call EZSP_NETWORK_STATE
CLibEzspMain::handleEzspRxMessage EZSP_NETWORK_INIT
Call EZSP_NETWORK_STATE
CLibEzspMain::handleEzspRxMessage EZSP_NETWORK_STATE
handleEzspRxMessage_NETWORK_STATE getting EZSP_NETWORK_STATE=0 while CLibEzspInternal::State=STACK_INIT
No pre-existing network on the EZSP adapter
Creating new network on channel 26
CLibEzspMain state changing from STACK_INIT to FORM_NWK_IN_PROGRESS
EZSP library change to state SINK_BUSY
CLibEzspMain::handleEzspRxMessage EZSP_NETWORK_STATE
handleEzspRxMessage_NETWORK_STATE getting EZSP_NETWORK_STATE=0 while CLibEzspInternal::State=FORM_NWK_IN_PROGRESS
No pre-existing network on the EZSP adapter
No channel value has been provided and the adapter has not currently joined any network. Cannot continue initialization
CLibEzspMain state changing from FORM_NWK_IN_PROGRESS to INIT_FAILED
EZSP library change to state INIT_FAILED
CLibEzspMain::handleEzspRxMessage EZSP_SET_POLICY
CLibEzspMain::handleEzspRxMessage EZSP_SET_POLICY
CLibEzspMain::handleEzspRxMessage EZSP_SET_INITIAL_SECURITY_STATE
EZSP_SET_INITIAL_SECURITY_STATE status : EMBER_SUCCESS
CLibEzspMain::handleEzspRxMessage EZSP_FORM_NETWORK
EZSP_FORM_NETWORK status : EMBER_SUCCESS
CLibEzspMain::handleEzspRxMessage EZSP_STACK_STATUS_HANDLER
CEZSP_STACK_STATUS_HANDLER status : EMBER_NETWORK_UP
CLibEzspMain state changing from INIT_FAILED to SINK_BUSY
EZSP library change to state SINK_BUSY

Dongles outside of a network are typically factory default EZSP dongles, so the library does not work on brand new dongles at all.

Steps to reproduce this: Since commit 9308204 the command-line option -l allows mainEzspTest to reset the dongle from Linux. The steps to reproduce the issue are thus (on versions of mainEzspTest supporting -l):