Someone may encounter the ezspForceReset error during launching the host application. the most common cause of this issue is uart or spi communication failure.here are some suggestions for debugging this issue.
1. To make sure uart/spi work properly on the host part.
make sure the driver of uart/spi works properly
choose the proper uart/spi port(driver file) for host application when lanuching the host application
2. To make sure the ncp firmware works properly.
here is a simple way to indentify whether the ncp firmware works properly.
Connect to the WSTK or ISA3 and start capture on Simplicity Studio.
reset the ncp and you will find the stack version of the ncp is printed on Events window.
If there is no log printed when you reset the ncp. that means the ncp doesn't work properly.In this case, it is recommended to use pre-build ncp image to exclude the firmware issue. if the pre-build ncp image for your part number can't be found in ncp-images folder. You can only build the customized ncp image by reference to https://www.silabs.com/documents/public/application-notes/an1010-customized-ncp.pdf
As you may know, we can use the EZSP frame setPreinstalledCbkeData(0xA2) and setPreinstalledCbkeData283k1(0xED) to set the device's CA public key and 283k1 curve CA public key, which has been mentioned in UG100(page107). The associated APIs are ezspSetPreinstalledCbkeData() and ezspSavePreinstalledCbkeData283k1().
Please note, there is a difference between these two APIs.
Regarding the ezspSetPreinstalledCbkeData(), you can call it directly after inputing the three parameters (caPublic, myCert, myKey). But regarding the ezspSavePreinstalledCbkeData283k1(), it can't. You need set EZSP_VALUE_CERTIFICATE_283K1/ EZSP_VALUE_PUBLIC_KEY_283K1/ EZSP_VALUE_PRIVATE_KEY_283K1 firstly before you call the ezspSavePreinstalledCbkeData283k1(). Actually, we have an new API(emberSetPreinstalledCbkeData283k1) to implement the funciton. Please refer to below code.
The CBKE Data associated with ECC 283k1 is sent in three separate EZSP commands because the total length of the combined data is greater than the max EZSP message length (133). The first EZSP command will contain the certificate followed next by the public key and finally the private key. Once all the data has been received by the NCP a 4th command is sent by the host indicating to push the data into permanent storage.
In 802.15.4 specification, it mentions the PHY shall provide the capability to perform CCA. Zigbee stack is based on 802.15.4, what is the CCA threshold for Zigbee device? The default CCA threshold of GB868 SubGHz is -87dBm, and the default CCA threshold of 2.4GHz is -75dBm.
As you may know there is a MFG token (TOKEN_MFG_CCA_THRESHOLD) can be set to override the default CCA threshold(s) by setting this token if your design uses a Low-Noise Amplifier (LNA). An LNA changes the gain on the radio input which results in the radio “seeing” a different energy level than if no LNA was used. If you use an LNA in your design, you will need add the gain of LNA to the default CCA threshold, then write to this MFG token. Please refer to the AN961 for more information.
You may have question where the two default values come from? Actually, these two values are defined by specification, 802.15.4-2006 mentioned the ED threshold shall correspond to a received signal power of at most 10 dB above the specified receiver sensitivity. Sensitivity requirement for 2.4 GHz is -85dBm, hence CCA threshold = -75dBm, GB868 sensitivity is -97dBm per Zigbee R22 spec, hence CCA threshold =-87dBm.
Sometimes customers want to actively send custom messages from NCP to host. For example, customer connects GPIO of the NCP to an alarm sensor. When the alarm occurs, the level of the GPIO changes and an event should be reported to the host actively. The attached example in this article demonstrates how to send a custom message actively from NCP to host. Customer needs to enable XNCP library and then use the API “emberAfPluginXncpSendCustomEzspMessage” to send custom message from NCP to host.
Example:
Implement an example project base on the default ncp-uart-hw example and Z3GatewayHost example within EmberZnet 6.4.0.
The NCP example is running on WSTK+BRD4162, and the host is running on Cygwin. NCP connects to the host through a UART port with hardware flow control.
Prepare NCP program:
Step 1: Create a project based on the example “ncp-uart-hw”;
Step 6: Open the file ncp-callback.c and add the following code snippet:
EmberEventControl customReportEventControl;
#define XNCP_CUSTOM_REPORT_HELLO_CMD 0xA0
void customReportEventHandler(void)
{
uint8_t msg[32];
msg[0] = XNCP_CUSTOM_REPORT_HELLO_CMD;
sprintf(&msg[1], "Hello host!");
emberAfPluginXncpSendCustomEzspMessage(sizeof(msg), msg);
emberEventControlSetDelayMS(customReportEventControl, 5000);
}
/** @brief Performs any additional initialization required at system startup.
*
* This function is called when the application starts and can be used to
* perform any additional initialization required at system startup.
*/
void emberAfMainInitCallback(void) {
// your code here
emberEventControlSetDelayMS(customReportEventControl, 5000);
}
Step 7: Build the project and download the generated image file to the WSTK.
Prepare host program:
Step 1: Create a host project based on the example “Z3GatewayHost”;
Connect the WSTK to PC, then start Cygwin and run the host application. You can see custom message in the console of the host every 5 seconds:
$ ./Z3GatewayHost.exe -p COM9
Reset info: 11 (SOFTWARE)
ezsp ver 0x07 stack type 0x02 stack ver. [6.4.0 GA build 385]
Ezsp Config: set source route table size to 0x0064:Success: set
Ezsp Config: set security level to 0x0005:Success: set
Ezsp Config: set address table size to 0x0002: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 0x0010:Success: set
Ezsp Config: set key table size to 0x0000:Success: set
Ezsp Config: set max end device children to 0x0020:Success: set
Ezsp Config: set aps unicast message count to 0x000A:Success: set
Ezsp Config: set broadcast table size to 0x000F:Success: set
Ezsp Config: set neighbor table size to 0x0010: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 0x00B4:Success: set
Ezsp Endpoint 1 added, profile 0x0104, in clusters: 8, out clusters 20
Ezsp Endpoint 242 added, profile 0xA1E0, in clusters: 0, out clusters 1
deactivate report event
Found 0 files
Z3GatewayHost>
Ncp report:Hello host!
Ncp report:Hello host!
Ncp report:Hello host!
Ncp report:Hello host!
Ncp report:Hello host!
Some customers need a blacklist mechanism in a ZigBee network. For example:
Prevent specific devices from joining.
Filter messages from a specific node ID.
Prevent devices from joining into a specific PAN.
Here is an example to show you how to use blacklist in EmberZNet.
The mechanism is implemented by a plugin “MAC Address Filtering”. There are three lists in the plugin, short address list(2-byte node ID), long address list(64-bit IEEE address) and PAN ID list(2-byte PAN ID). Each list can be configured as either a whitelist or a blacklist. The default is a blacklist with no addresses configured (accept all packets normally). There is also a separate option to allow or drop packets with no address information (e.g. Beacon Requests).
To use this mechanism, you must enable the plugin “MAC Address Filtering” first:
Then build and program the application to your device.
Filter by long address
If you want to block the device with EUI64 90FD9FFFFE7B81BD , then you can run the following commands on the console:
No Address Packets: Drop Packets Accepted 0, Dropped: 6
Short Address Filter: Blacklist Packets Accepted 0, Dropped: 0
Long Address Filter: Blacklist Packets Accepted 0, Dropped: 0
Dest PAN ID Filter: Blacklist Packets Accepted 0, Dropped: 0
Short Address Filter List
0: ---
1: ---
2: ---
3: ---
4: ---
5: ---
6: ---
7: ---
8: ---
9: ---
Long Address Filter List
0: ---
1: ---
2: ---
3: ---
4: ---
5: ---
6: ---
7: ---
8: ---
9: ---
Please note that in the “MAC Address Filtering” plugin, all lists are cleared at system startup, so if you want to add some blacklist items permanently, you can make a modification in the source code. The source code of the “MAC Address Filtering” plugin can be found at:
A step-by-step guide to creating, building, and running your own Router Eligible End Device (REED) application based on the Silicon Labs Thread stack. Before tackling this tutorial, please checkout "Building a Thread Router Eligible End Device Application" Part 1 and Part 2 tutorials first. This tutorial expands on Part 2 by adding a button event for the LED toggle and capturing the associated network traffic.
Requirements:
Software:
Simplicity Studio v4
Silicon Labs Thread Stack 2.7.1
IAR Workbench 7.80.4
Generated project for Router Eligible End Device from Part 1 and Part 2.
I. Updating Configuration for the Reed
1. Go back to the ISC configuration file we have been working on (ThreadReed271EFR32).
2. Navigate to the "Callbacks" tab.
a. Select "halButtonIsr".
3. Under the "Other" tab:
a. Add an Event item under Event Configuration section. This will link an event to a button press.
i. Set Command to "eventToggle".
ii. Set Callback to "eventToggleHandler".
4. Click "Generate". AppBuilder will ask you to validate the generation to make sure which files can be overwritten. Make sure thread-callbacks.c is UNCHECKED. Click OK.
5. In the "Generation successful" window click OK.
6. Save the ISC file.
II. Add Code and Build Project in Simplicity Studio IDE
1. In thread-callbacks.c add the following code to have the node send out a CoAP Broadcast message.
3. Compile your project and Ensure that the build completes with zero errors.
III. Load Application to All WSTKs
1. In Network Analyzer perspective, click on a node for your application and select "Flash/Upload".
2. Upload only the updated application. This time DO NOT erase the chip because we want to keep the network parameters saved in non-volatile memory.
3. Repeat for all nodes.
IV. Capture Network Traffic
1. Set Network Analyzer decode to the appropriate Thread stack by going to Window -> Preferences -> Network Analyzer -> Decoding -> Stack Versions. (Please note, there is an auto-detection decoder stack however, if you have multiple protocols in the air in your space, then we recommend selecting the specific stack).
2. Make sure your master-key is available in Window -> Preferences -> Network Analyzer -> Decoding -> Security Keys. If it is not there add a new security key by clicking on the "Add" button.
3. In Network Analyzer perspective, in the Device view, right-click on a node and select "Start capture with options"
a. May need to select "Connect" first if icon beside node name is not showing green.
4. In capture options specify PAN ID. This allows you to narrow the data captured to the specific PAN ID.
V. Bringing the Reed Back into Network
1. In console bring the node back up by using the resume command. Either use the following command or press PB1 on WSTK (button 1).
network-management resume
2. Do this for all nodes. Management traffic should start showing in the network capture.
VI. Sending Messages
1. Press Button0 on WSTK board. Console will print when the node is broadcasting. Nodes with URI "reed/toggle", will toggle their LEDs. The network capture will show CoAP POST messages with acknowledgements.
A step-by-step guide to creating, building, and running your own Router Eligible End Device (REED) application based on the Silicon Labs Thread stack. Before tackling this tutorial, please checkout "Building a Thread Router Eligible End Device Application" tutorial first.
This tutorial expands on Part 1 by adding a handler for a received CoAP message.
I. Updating Configuration for REED
1. Go back to the ISC configuration file we created in the previous exercise (ThreadReed271EFR32.isc).
2. Navigate to the "Plugins" tab:
a. Select "CoAP Dispatch".
b. Remove "CoAP Debug" as there are some conflicts.
3. Under the "Other" tab:
a. Add a CoAP Dispatch item.
i. Change Method to POST.
ii. Change URI Path to "reed/toggle".
iii. Change Handler to "reedToggleHandler".
4. Click "Generate". AppBuilder will ask you to validate the generation to make sure which files can be overwritten. Make sure thread-callbacks.c is unchecked. Click OK.
5. In the "Generation successful" window click OK.
6. Save the ISC file.
II. Add Code and Build Projects in Simplicity Studio IDE
1. In thread-callbacks.c add the following code to have the node respond to CoAP messages. This Handler will respond to "reed/toggle" URI, toggle an LED on the WSTK, and print a statement to the console.
2. Build your project and ensure that it completes with zero errors.
III. Load Application to All WSTKs
1. In Network Analyzer perspective, click on a node for your application and disconnect from the device (for the EFR32). Then select "Flash/Upload".
2. Upload only the updated application. This time DO NOT erase the chip because we want to keep the network parameters saved in non-volatile memory.
3. Repeat for all nodes.
IV. Bringing Nodes Back Into the Network
1. In Network Analyzer perspective, navigate to the node's console and use the resume command
network-management resume
2. Do this for all nodes.
V. Sending CoAP messages
1. In the console send a CoAP POST message to your neighbor using their IP address and unique URI to toggle the LED. This CoAP POST message will toggle LED0 on the WSTK and print out "Toggle LED" on the receiving node.
coap post <destination> <uri> <body>
Example:
coap post "fd00:db8::d9dd:b493:143b:9cbc" "reed/toggle" "1"
Zigbee & Thread Knowledge Base
How to debug the ezspForceReset error during launching the host application
Someone may encounter the ezspForceReset error during launching the host application. the most common cause of this issue is uart or spi communication failure.here are some suggestions for debugging this issue.
1. To make sure uart/spi work properly on the host part.
2. To make sure the ncp firmware works properly.
here is a simple way to indentify whether the ncp firmware works properly.
If there is no log printed when you reset the ncp. that means the ncp doesn't work properly.In this case, it is recommended to use pre-build ncp image to exclude the firmware issue. if the pre-build ncp image for your part number can't be found in ncp-images folder. You can only build the customized ncp image by reference to https://www.silabs.com/documents/public/application-notes/an1010-customized-ncp.pdf
3. If the host application still can't be launched successfully, you have to capture the waveform from the uart or spi pins with logic analyzer or oscilloscope, and then compare the waveform with the expected one which described in https://www.silabs.com/documents/public/application-notes/an711-ezsp-spi-host-interfacing-guide.pdf or https://www.silabs.com/documents/public/application-notes/an706-ezsp-uart-host-interfacing-guide.pdf
The difference when setting the device's CA public key and 283k1 curve CA public key
As you may know, we can use the EZSP frame setPreinstalledCbkeData(0xA2) and setPreinstalledCbkeData283k1(0xED) to set the device's CA public key and 283k1 curve CA public key, which has been mentioned in UG100(page107). The associated APIs are ezspSetPreinstalledCbkeData() and ezspSavePreinstalledCbkeData283k1().
Please note, there is a difference between these two APIs.
Regarding the ezspSetPreinstalledCbkeData(), you can call it directly after inputing the three parameters (caPublic, myCert, myKey). But regarding the ezspSavePreinstalledCbkeData283k1(), it can't. You need set EZSP_VALUE_CERTIFICATE_283K1/ EZSP_VALUE_PUBLIC_KEY_283K1/ EZSP_VALUE_PRIVATE_KEY_283K1 firstly before you call the ezspSavePreinstalledCbkeData283k1(). Actually, we have an new API(emberSetPreinstalledCbkeData283k1) to implement the funciton. Please refer to below code.
The CBKE Data associated with ECC 283k1 is sent in three separate EZSP commands because the total length of the combined data is greater than the max EZSP message length (133). The first EZSP command will contain the certificate followed next by the public key and finally the private key. Once all the data has been received by the NCP a 4th command is sent by the host indicating to push the data into permanent storage.
CCA threshold of Zigbee
In 802.15.4 specification, it mentions the PHY shall provide the capability to perform CCA. Zigbee stack is based on 802.15.4, what is the CCA threshold for Zigbee device? The default CCA threshold of GB868 SubGHz is -87dBm, and the default CCA threshold of 2.4GHz is -75dBm.
As you may know there is a MFG token (TOKEN_MFG_CCA_THRESHOLD) can be set to override the default CCA threshold(s) by setting this token if your design uses a Low-Noise Amplifier (LNA). An LNA changes the gain on the radio input which results in the radio “seeing” a different energy level than if no LNA was used. If you use an LNA in your design, you will need add the gain of LNA to the default CCA threshold, then write to this MFG token. Please refer to the AN961 for more information.
You may have question where the two default values come from? Actually, these two values are defined by specification, 802.15.4-2006 mentioned the ED threshold shall correspond to a received signal power of at most 10 dB above the specified receiver sensitivity. Sensitivity requirement for 2.4 GHz is -85dBm, hence CCA threshold = -75dBm, GB868 sensitivity is -97dBm per Zigbee R22 spec, hence CCA threshold =-87dBm.
在EFR32上用TCXO
问题
如何将TCXO连接到EFR32?
回答
EFR32主时钟可以用TCXO作为时钟源。为了用TCXO时钟源来运行,需要重新配置时钟管理单元中的HFXO寄存器。如下的配置可参阅EFR32参考手册获取更多细节:
•CMU_HFXOCTRL - HFXO 控制寄存器。
•HFXO Mode该位置1使单端TCXO替代晶体振荡器。
•该位默认置0,表示选择晶体振荡器。
•CMU_OSCENCMD - 晶振使能命令寄存器。
•HFXOEN 该位置1使HFXO Mode寄存器生效。
•该位默认置0,不使能HFXO。
•HFXODIS 如果不用或者用不到TCXO或晶体振荡器,将该位置1使复位振荡器到默认设置。
•该位缺省置0。
•CMU_HFXOSTARTUPCTRL - HFXO 启动控制/ CMU_HFXOSTEADYSTATECTRL - HFXO 稳态控制。
•CTUNE 为补偿额外负载电容,相对于晶振来说用TCXO时的CTUNE可能需要设置成低值或0。
以上寄存器设置要确保物理上将TCXO连接到芯片的HFXTAL_N管脚。芯片的HFXTAL_P管脚不用连接。
英文原文: https://www.silabs.com/community/wireless/zigbee-and-thread/knowledge-base.entry.html/2016/11/07/using_a_tcxo_withan-Uue4
Reporting Custom Message from NCP to Host
Background:
Sometimes customers want to actively send custom messages from NCP to host. For example, customer connects GPIO of the NCP to an alarm sensor. When the alarm occurs, the level of the GPIO changes and an event should be reported to the host actively. The attached example in this article demonstrates how to send a custom message actively from NCP to host. Customer needs to enable XNCP library and then use the API “emberAfPluginXncpSendCustomEzspMessage” to send custom message from NCP to host.
Example:
Implement an example project base on the default ncp-uart-hw example and Z3GatewayHost example within EmberZnet 6.4.0.
The NCP example is running on WSTK+BRD4162, and the host is running on Cygwin. NCP connects to the host through a UART port with hardware flow control.
Prepare NCP program:
Step 1: Create a project based on the example “ncp-uart-hw”;
Step 2: Enable “XNCP Library” plugin and disable “XNCP Stub Library” plugin;
Step 3: Enable callback “emberAfMainInitCallback”;
Step 4: Add a custom event:
Step 5: Save and generate the application;
Step 6: Open the file ncp-callback.c and add the following code snippet:
Step 7: Build the project and download the generated image file to the WSTK.
Prepare host program:
Step 1: Create a host project based on the example “Z3GatewayHost”;
Step 2: Enable callback “ezspCustomFrameHandler”;
Step 3: Modify Z3GatewayHost_callbacks.c :
Step 4: Build the project.
Run and test:
Connect the WSTK to PC, then start Cygwin and run the host application. You can see custom message in the console of the host every 5 seconds:
怎样为EFR32MG实现天线分集?
怎样为EFR32MG实现天线分集?
答案
芯科并没有提供具有天线分集的EFR32MG参考设计。但是,你可以以EM35x的天线分集设计作为例子,比如如何选用外部的RF开关。自EmberZNet 5.7.4 版本协议栈起,对发射/软件分集(当MAC—Level的ACK没有收到时切换天线路径)就开始有了支持,并且通过天线插件(Antenna plug-in)的选择/配置任何的GPIO都可用来做天线选择功能。接收/硬件分集(对到来的数据包的RSSI值做评估从而选择最强的路径)功能是不支持的。也就是说,在设计中通过MODEM_ANT0和MODEM_ANT1 两个GPIO选择 (在有两个天线选择GPIO和一个外部RF开关情况下)来保证发射/软件分集暂时可用,如果将来加入了接收/硬件天线分集功能,可以通过软件升级来支持该功能。请参考EFR32MG1规格书的表6.5来了解哪些GPIO具有MODEM_ANT0 和 MODEM_ANT1功能的详细内容。
就硬件的建议上,天线应该分开至少1/4波长的距离,而且应相互转成90度。请参考上述的EM35x天线分集设计作为例子。
英文原文:
https://www.silabs.com/community/wireless/zigbee-and-thread/knowledge-base.entry.html/2016/11/09/how_can_i_implement-hsvn
How to Use Blacklist in EmberZNet
Some customers need a blacklist mechanism in a ZigBee network. For example:
Here is an example to show you how to use blacklist in EmberZNet.
The mechanism is implemented by a plugin “MAC Address Filtering”. There are three lists in the plugin, short address list(2-byte node ID), long address list(64-bit IEEE address) and PAN ID list(2-byte PAN ID). Each list can be configured as either a whitelist or a blacklist. The default is a blacklist with no addresses configured (accept all packets normally). There is also a separate option to allow or drop packets with no address information (e.g. Beacon Requests).
To use this mechanism, you must enable the plugin “MAC Address Filtering” first:
Then build and program the application to your device.
If you want to block the device with EUI64 90FD9FFFFE7B81BD , then you can run the following commands on the console:
plugin mac-address-filtering long-address-list add {90FD9FFFFE7B81BD}
plugin mac-address-filtering long-address-list set-blacklist
Then the devices won’t response to the association request from the specific long address:
A statistics info shown as below:
If you want to filter devices by short address 0xA88F, you can run the following commands on the console:
plugin mac-address-filtering short-address-list add 0xA88F
plugin mac-address-filtering short-address-list set-blacklist
A statistics info shown as below:
If you want to filter specific PAN ID 0xF459, then you can run the following commands on the console:
plugin mac-address-filtering pan-id-list add 0xF459
plugin mac-address-filtering pan-id-list set-blacklist
The device won’t send an association to the filtered PAN:
A statistics info shown as below:
If you want to filter beacon request, you can run the following commands on the console.
plugin mac-address-filtering set-config no-address-filter
Then the router won’t response to the beacon request:
A statistics info shown as below:
Please note that in the “MAC Address Filtering” plugin, all lists are cleared at system startup, so if you want to add some blacklist items permanently, you can make a modification in the source code. The source code of the “MAC Address Filtering” plugin can be found at:
SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.3\protocol\zigbee\app\framework\plugin-soc\mac-address-filtering\mac-address-filtering.c
You can modify the code if you want to set some specific items of the list in runtime.
e.g (mac-address-filtering.c)
Building a Thread Router Eligible End Device Application (with Silicon Labs Thread 2.7.1) Part 3.
A step-by-step guide to creating, building, and running your own Router Eligible End Device (REED) application based on the Silicon Labs Thread stack. Before tackling this tutorial, please checkout "Building a Thread Router Eligible End Device Application" Part 1 and Part 2 tutorials first. This tutorial expands on Part 2 by adding a button event for the LED toggle and capturing the associated network traffic.
Requirements:
Software:
Hardware:
I. Updating Configuration for the Reed
1. Go back to the ISC configuration file we have been working on (ThreadReed271EFR32).
2. Navigate to the "Callbacks" tab.
a. Select "halButtonIsr".
3. Under the "Other" tab:
a. Add an Event item under Event Configuration section. This will link an event to a button press.
i. Set Command to "eventToggle".
ii. Set Callback to "eventToggleHandler".
4. Click "Generate". AppBuilder will ask you to validate the generation to make sure which files can be overwritten. Make sure thread-callbacks.c is UNCHECKED. Click OK.
5. In the "Generation successful" window click OK.
6. Save the ISC file.
II. Add Code and Build Project in Simplicity Studio IDE
1. In thread-callbacks.c add the following code to have the node send out a CoAP Broadcast message.
2. In thread-callbacks.c add interrupt service routine for the button states.
3. Compile your project and Ensure that the build completes with zero errors.
III. Load Application to All WSTKs
1. In Network Analyzer perspective, click on a node for your application and select "Flash/Upload".
2. Upload only the updated application. This time DO NOT erase the chip because we want to keep the network parameters saved in non-volatile memory.
3. Repeat for all nodes.
IV. Capture Network Traffic
1. Set Network Analyzer decode to the appropriate Thread stack by going to Window -> Preferences -> Network Analyzer -> Decoding -> Stack Versions. (Please note, there is an auto-detection decoder stack however, if you have multiple protocols in the air in your space, then we recommend selecting the specific stack).
2. Make sure your master-key is available in Window -> Preferences -> Network Analyzer -> Decoding -> Security Keys. If it is not there add a new security key by clicking on the "Add" button.
3. In Network Analyzer perspective, in the Device view, right-click on a node and select "Start capture with options"
a. May need to select "Connect" first if icon beside node name is not showing green.
4. In capture options specify PAN ID. This allows you to narrow the data captured to the specific PAN ID.
V. Bringing the Reed Back into Network
1. In console bring the node back up by using the resume command. Either use the following command or press PB1 on WSTK (button 1).
2. Do this for all nodes. Management traffic should start showing in the network capture.
VI. Sending Messages
1. Press Button0 on WSTK board. Console will print when the node is broadcasting. Nodes with URI "reed/toggle", will toggle their LEDs. The network capture will show CoAP POST messages with acknowledgements.
Building a Thread Router Eligible End Device Application (with Silicon Labs Thread 2.7.1) Part 2.
A step-by-step guide to creating, building, and running your own Router Eligible End Device (REED) application based on the Silicon Labs Thread stack. Before tackling this tutorial, please checkout "Building a Thread Router Eligible End Device Application" tutorial first.
This tutorial expands on Part 1 by adding a handler for a received CoAP message.
Requirements:
Software:
Hardware:
I. Updating Configuration for REED
1. Go back to the ISC configuration file we created in the previous exercise (ThreadReed271EFR32.isc).
2. Navigate to the "Plugins" tab:
a. Select "CoAP Dispatch".
b. Remove "CoAP Debug" as there are some conflicts.
3. Under the "Other" tab:
a. Add a CoAP Dispatch item.
i. Change Method to POST.
ii. Change URI Path to "reed/toggle".
iii. Change Handler to "reedToggleHandler".
4. Click "Generate". AppBuilder will ask you to validate the generation to make sure which files can be overwritten. Make sure thread-callbacks.c is unchecked. Click OK.
5. In the "Generation successful" window click OK.
6. Save the ISC file.
II. Add Code and Build Projects in Simplicity Studio IDE
1. In thread-callbacks.c add the following code to have the node respond to CoAP messages. This Handler will respond to "reed/toggle" URI, toggle an LED on the WSTK, and print a statement to the console.
2. Build your project and ensure that it completes with zero errors.
III. Load Application to All WSTKs
1. In Network Analyzer perspective, click on a node for your application and disconnect from the device (for the EFR32). Then select "Flash/Upload".
2. Upload only the updated application. This time DO NOT erase the chip because we want to keep the network parameters saved in non-volatile memory.
3. Repeat for all nodes.
IV. Bringing Nodes Back Into the Network
1. In Network Analyzer perspective, navigate to the node's console and use the resume command
2. Do this for all nodes.
V. Sending CoAP messages
1. In the console send a CoAP POST message to your neighbor using their IP address and unique URI to toggle the LED. This CoAP POST message will toggle LED0 on the WSTK and print out "Toggle LED" on the receiving node.
Example:
VI. Expanding application
The third part of this tutorial adds functionality to the sending node.
GPIOs used for the pre-built EM35X NCP images
Question
Which GPIOs are used on the EM35X NCP-UART and NCP-SPI?
Answer
For the pre-built NCP images we include in C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v1.1\protocol\zigbee_5.10\ncp-images
NCP-UART:
NCP-SPI: