- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
09-28-2017 08:44 AM
I have an Simplicity Studio application that I want to allow up to 4 devices (2 Occupancy Sensors and
2 Door Sensors) to join the applications network. Then it also needs to join a different network.
I have the joining with the different network working fine, but the application is not allowing other
devices to join the network. These other devices can join a network of an exiting device (I'm replacing
a device on that network), so I know that the devices work fine. I am using an EM3588 (if that matters)
that talks serially to my device application (a PIC32).
I made two endpoints (both are Thermostat devices) and two networks, with one endpoint configured to each network (Primary and Secondary). I can join an existing network just fine. In the user interface for
the thermostat, there are FORM, PERMIT JOIN, JOIN, and LEAVE buttons that perform the following
code when pressed: I added the second thermostat device and second network in an effort to get the
devices to connect. Once I did that, it stopped staying connected to the other network just as soon as
if (emberAfNetworkState() == EMBER_NO_NETWORK) // checks if no network is
emberAfFindUnusedPanIdAndForm(); //if no network joined, form new network
//Print the response of network form success from the Zigbee -> PIC
SendCommandToThermostat("&FORM OK", 0);
if (emberAfNetworkState() == EMBER_JOINED_NETWORK) // checks to see if currently
// connected to a network
emberAfBroadcastPermitJoin(TIME_ALLOWING_JOIN); // if connected, allow other devices
// to connect to the network
//Print the response of PJOIN allowed
SendCommandToThermostat("&PERMIT OK", 0);
if (emberAfNetworkState() == EMBER_NO_NETWORK) //check if network is not joined/present
emberAfStartSearchForJoinableNetwork(); // if no network connected, search
// for joinable networks.
if (emberAfNetworkState() == EMBER_JOINED_NETWORK) //checks to see if currently
//connected to a network
emberLeaveNetwork(); //if connected, leave current network. Used to join a different network
//Print the response of leave success from the Zigbee -> PIC
SendCommandToThermostat("&LEAVE OK", 0);
As far a Plugins go, I have the Binding Table Library, Multi-network Library, Packet Validate Library, Security Core Library, ZigBee PRO Stack Library, HAL - ADC, HAL - Antenna Stub, HAL - Configuration,
HAL - HAL Library, HAL - Debug JTAG, HAL - Simulated EEPROM version 1 library,
Form and Join Library, Network Find, Scan Dispatch, Ember Minimal Printf, RAIL Library,
Under Utility, I have Address Table, Concentrator Support, Counters, End Device Support, and Simple
Under Callbacks, I have the Network Find Finished and the only other ones are Cluster Related for when an Attribute changes or a Command is received.
I am fairly new to this development environment, any help is appreciated.
09-28-2017 08:12 PM
A zigbee device can join to a single network one time so I think it's normal to leave original one if you ask it to join a new one.
09-29-2017 06:39 AM
The documentation says you can have a multi-network with two different networks. Now, one network per endpoint, so two endpoints are needed, but each endpoint can select a network.
09-29-2017 08:59 AM
09-29-2017 09:07 AM
If you go to the ZCL Application Framework inside Simplicity Studio and go to the Plugins tab, under EmberZNet Libraries, left click on Multi-network Library (don't click on the checkbox part). Over in the right side of it, it tells you that you can have a single device be on multiple networks and time share between them. The device can be a router on only one network, but must be an end device on the other one.
09-29-2017 10:06 AM
Note that the choice of network contexts prior to API or CLI commands involves manual selection via either CLI command network set N or API command emberAfPushNetworkIndex(N), where N = network index 0 or 1.
So, you should call emberAfPushNetworkIndex to select network before you call any API to make sure it use correct endpoint.
09-29-2017 10:07 AM