Transcript
QSG102 THREAD BORDER ROUTER ADD-ON KIT QUICK-START GUIDE A border router is a component of a Thread network that manages the traffic between the Thread network and adjacent networks. The border router facilitates a number of key capabilities including the following: • • • •
Commissioning of Thread nodes Packet filtering and rate limiting GUA (Global Unicast Address) or ULA (Unique Local Address) assignment IP routing from the Thread network to the cloud
The Silicon Labs Thread Border Router Add-On Kit adds a border router demonstration system to the EM35x Development kit. This quick-start guide describes the Border Router Add-On Kit RD-0004-0201, how to set it up with an existing EM35x development kit, and how to demonstrate an example application. The following documents are valuable references and may be found at www.silabs.com/support or included with the EM35x Development kit: • • •
QSG101, EM35x Development Kit Quick-Start Guide. QSG105, Getting Started with Silicon Labs Wireless Networking Software. UG103.11, Application Development Fundamentals: Thread.
1 About the Thread Border Router Add On Kit The Thread Border Router Add-On Kit RD-0004-0201 contains: • • • • •
Raspberry Pi 2 Model B with case MicroSD card with Raspberry Pi 2 operating system and the Thread Border Router application pre-loaded Edimax USB Wi-Fi Adapter, providing a Wi-Fi network for demonstration purposes CEL EM3588 USB Thread Adapter, pre-loaded with the Thread NCP (network co-processor) Power supply
Figure 1. Silicon Labs Border Router
Rev 0.1
Copyright © 2015 by Silicon Laboratories
QSG102
QSG102 Border router system components, shown in Figure 2, are as follows: • • • •
Thread Border Router Thread End Node Web Server Virtual Machine (observation and control of Thread End Node) Optional: Web Browser
The Thread Border Router application running on the Raspberry Pi 2 routes IPv6 datagrams between the Thread End Nodes via Thread NCP and the Web Server Virtual Machine via Wi-Fi or Ethernet network, to observe and control the Thread End Node. The Thread Border Router also routes IPv4 datagrams between the Web Server Virtual Machine and an optional handset, tablet or computer, also to observe and control the Thread End Nodes.
Figure 2. Border Router System Components
2 Getting Started 2.1
Register, Install Software, and set up the EM35x Development Kit
Before you begin to use the Thread Border Router, you must take the following steps: 1. Register on the support portal. 2. Install Silicon Labs Thread stack, Ember Desktop, and the IAR-EWARM compiler. 3. Acquire the EM35x Development kit with EM3588 modules. EM35x Development kits acquired before February 2015 contain EM357 modules and must be upgraded with EM3588 modules. To get started, go to http://www.silabs.com/products/wireless/Pages/thread-getting-started.aspx. Detailed installation instructions are available in the release notes installed with the Silicon Labs Thread stack.
2
Rev. 0.1
QSG102 2.2
Unpack the Thread Border Router Add-On Kit ATTENTION: Observe precautions for handling electrostatic sensitive devices.
2.3
Assemble the Thread Border Router Add-On Kit
The Thread Border Router is nearly ready to run out of the box. The remaining steps are: • • •
Connect the USB Wi-Fi Adapter to one of the Raspberry Pi’s USB ports (if not already installed). Connect the CEL EM3588 USB Thread Adapter to one of the Raspberry Pi 2’s USB ports. Plug in the Raspberry Pi 2’s power supply. In the following procedures you will power the Raspberry Pi on and off by connecting and disconnecting its power supply.
The resulting assembly provides Thread Border Router and Wi-Fi network functionality.
2.4
Download Border Router Software
Border Router software downloads are available through Silicon Labs’ support portal for registered users. Navigate to “Software Releases >> Latest Thread Software” and download the following software: • •
ThreadBorderRouterWebServerVM-version.zip ThreadBorderRouterApplication-version.zip
•
ThreadBorderRouterRPi2-version.img
web server virtual machine Thread Border Router application Thread USB adapter NCP software Thread End Node application IP driver software operating system, drivers and utilities
You may not need to download the last, very large, ThreadBorderRouterRPi2-version.img file. Refer to section 4.1, Update the Raspberry Pi 2 operating system software, to determine whether a download is required.
3 Install Software The following instructions outline the steps for installing required software.
3.1
Install the Web Server Virtual Machine Software
You will need a computer with Windows or MacOS to run the Web Server Virtual Machine software. Begin with the Raspberry Pi 2 powered off. 1. Install VirtualBox 4.3.12 from https://www.virtualbox.org/wiki/Download_Old_Builds_4_3_pre24. Warning: Do not install or use any other version of VirtualBox. 2. Unzip WebServerVirtualMachine-version.zip. The following files are relevant: a. build.ovf b. build-disk1.vmdk c. readme.txt 3. Run build.ovf to import the virtual machine. 4. Power on the Raspberry Pi 2. Note red and green LED activity during the boot process. 5. Connect to the Raspberry Pi 2 Wi-Fi access point. a. SSID = Silicon Labs Thread ABCD (where ABCD is unique hex number) b. Network security key = solutions 6. Run the Web Server Virtual Machine. a. Launch VirtualBox 4.3.12. b. Select the Web Server Virtual Machine.
Rev. 0.1
3
QSG102 c.
Select the Network Bridge adapter and the appropriate Wi-Fi adapter for your computer as shown in Figure 3.
Figure 3 . Configure the Virtual Machine Network Adapter
3.2
Install the Thread End Node Application Software
The Thread End Node application software must be loaded onto at least two of the EM35x Development kit EM3588 modules (installed on breakout boards). 1. Unzip ThreadBorderRouterApplication.zip. The relevant file is: a. sensor-actuator-node.s37 2. Follow the instructions in QSG105, Getting Started with Silicon Labs Wireless Networking Software, to program the EM3588 modules as end nodes.
4 Update Software if Necessary The following instructions outline the steps for updating software if necessary. In each case procedures are provided for determining whether an update is required and how to perform the update.
4.1
Update the Raspberry Pi 2 Operating System Software
A version of the Raspberry Pi 2 operating system, drivers and utilities (collectively the “operating system software”) is pre-programmed on the microSD card. The version of the Raspberry Pi 2 operating system software is contained in /home/pi/readme.txt. An update is required if the ThreadBorderRouterRPi2-version.img file version is greater than the readme.txt version number. Steps 1 through 3 below will determine if an update is necessary, and steps 4 through 7 below will guide you through the update. 1. Power on the Raspberry Pi 2. Note red and green LED activity during the boot process. 2. Connect to the Raspberry Pi 2 Wi-Fi access point. a. SSID = Silicon Labs Thread ABCD (where ABCD is unique hex number) b. Network security key = solutions
4
Rev. 0.1
QSG102 3. Check the version of the Raspberry Pi 2 operating system software. a. Open an SSH session using PuTTY: (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) b. Connect to the Raspberry Pi 2 at 192.168.42.1, port 22. c. Login = pi, Password = raspberry d. Type cat /home/pi/readme.txt and note the Raspberry Pi 2 operating system software version. e. If an update is necessary, download the ThreadBorderRouterRPi2-version.img file as described in section 2.4, Download Border Router Software, and continue with this procedure. 4. Update the microSD card. a. Power off the Raspberry Pi 2. b. Remove the microSD card from the Raspberry Pi 2. c. Insert the microSD into an SD card writer, using the microSD card adapter included in the kit. d. Copy the ThreadBorderRouterRPi2-version.img file to the Raspberry Pi 2 microSD card using Win32 Disk Imager (http://sourceforge.net/projects/win32diskimager/) or similar application. e. Install the microSD card in the Raspberry Pi 2. 5. Power on the Raspberry Pi 2. Note red and green LED light activity during the boot process. 6. Connect to the Raspberry Pi 2 Wi-Fi access point. a. SSID = Silicon Labs Thread ABCD (where ABCD is unique hex number) b. Network security key = solutions 7. Expand the file system on the microSD card. a. Open an SSH session using PuTTY. b. Connect to the Raspberry Pi at 192.168.42.1, port 22. c. Login = pi, Password = raspberry d. Type sudo ./raspi-config i. Select option 1 – expand file system ii. Select reboot
4.2
Update the Raspberry Pi 2 Thread Border Router Application
A version of the Raspberry Pi 2 Thread Border router application is pre-programmed on the microSD card. The version of the Thread Border application is contained in /home/pi/readme.txt. An update is required if the ThreadBorderRouterApplication-version.zip file version is greater than the readme.txt version number. Steps 1 through 3 below will determine if an update is necessary, and steps 4 through 7 below will guide you through the update. 1. Power on the Raspberry Pi 2. Note red and green LED activity during the boot process. 2. Connect to the Raspberry Pi 2 Wi-Fi access point. a. SSID = Silicon Labs Thread ABCD (where ABCD is unique hex number) b. Network security key = solutions 3. Check the version of the Raspberry Pi 2 Thread Border Router application. a. Open an SSH session using PuTTY: (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html): b. Connect to the Raspberry Pi 2 at 192.168.42.1, port 22. c. Login = pi, Password = raspberry d. Type cat /home/pi/readme.txt and note the Thread Border Router application version. e. Continue if an update is necessary. 4. Unzip the ThreadBorderRouterApplication.zip file. The relevant files are: a. thread_update_package.tgz
Rev. 0.1
5
QSG102 b. thread_update.sh 5. Transfer files to the Raspberry Pi 2. a. Use WinSCP (http://winscp.net/eng/download.php). b. Connect to the Raspberry Pi 2 at 192.168.42.1, port 22. c. Login = pi, Password = raspberry d. Copy thread_update_package.tgz to /home/pi/thread_update_package.tgz. e. Copy thread_update.sh to /home/pi/thread_update.sh. 6. Run the update script on the Raspberry Pi 2. a. Open an SSH session using PuTTY. b. Connect to the Raspberry Pi at 192.168.42.1, port 22. c. Login = pi, Password = raspberry d. Run the update script and reboot the Raspberry Pi 2: i. Type ./thread_update.sh ii. Type sudo reboot
4.3
Update the USB Thread Adapter NCP software
The USB Thread Adapter NCP software is pre-programmed on the USB Thread Adapter. The software is included with the Thread stack distribution: {installation directory} \Thread-1.0.0\ncp-images\em3588\ncp-uart.s37. If you are working with a later version of the Thread stack and the versions of the ncp-uart.s37 files are different, follow the instructions in QSG105, Getting Started with Silicon Labs Wireless Networking Software to reprogram the USB Thread Adapter. Note that the process for reprogramming the Thread Adapter NCP is identical to the process for reprogramming an EM35x breakout board module once the Packet Trace Port cable is connected.
5 Running the Border Router Example Application 5.1
Turn On and Connect all Components 1. Power on the Raspberry Pi 2. Note red and green LED activity during the boot process. 2. Turn on the Thread End Nodes running on the EM35x development boards. 3. On the Web Server Virtual Machine a. Select the Silicon Labs Thread Wi-Fi network. b. Open the web browser and navigate to http://localhost. c. Note the IPv4 server address in the “About” tab. 4. Optional: On one or more devices (handset, tablet, or computer): a. Select the Silicon Labs Thread Wi-Fi network. a. Open the web browser and navigate to the IPv4 server address noted previously. 5. The end nodes will commission automatically. This process will take approximately two minutes the first time. On subsequent power on cycles it will be significantly faster because commissioning has already completed. If you wish to restart the commissioning process, you must erase and reprogram the end nodes.
5.2
Observe and Control the Thread End Nodes 1. Each commissioned Thread End Node will appear in the web browser device list with its IPv6 address. 2. The Thread Border Router demonstrates the routing of IPv6 datagrams between the Thread End Nodes and the Web Server Virtual Machine (Figure 4). 3. Communication to and from each Thread End Node is via CoAP POST. • •
6
Temperature, in units of degrees centigrade * 1000, is sent periodically from each Thread End Node. Button0 events are sent immediately from each Thread End Node.
Rev. 0.1
QSG102 •
LEDs and buzzer toggle requests from the web interface are sent immediately to each Thread End Node.
Figure 4. Thread End Node Observation and Control
5.3
Create Bindings between Thread End Nodes
To demonstrate rules running on the Web Server Virtual Machine, it is possible to bind Thread End Node button0 to any Thread End Node LED. 1. Select two devices and click [Set Rule] (Figure 5). 2. Once bound, press button0 on the source Thread End Node to toggle the LED on the target Thread End Node.
Figure 5. Example Thread End Node Bindings
6 Utilities 6.1
Changing the Wi-Fi Parameters
The Wi-Fi parameters can be changed by modifying the hostapd.conf file. 1. 2. 3. 4. 5. 6. 7.
Type cd /etc/hostapd Type sudo nano hostapd.conf Change the Wi-Fi parameters such as SSID and/or wpa_passphrase. Press CTRL+X to exit. Press Y to write changes. Type Enter to accept. Type sudo reboot
Rev. 0.1
7
QSG102 7 Troubleshooting 1. The Raspberry Pi 2 does not boot (no red and green LED activity). a. Verify the microSD card is installed and the power supply is providing power via the USB cable. b. Reprogram the microSD card following instruction in section 4.1, Update the Raspberry Pi 2 operating system software. 2. Multiple devices are unable to see the Silicon Labs Thread Wi-Fi network. a. b. c. d.
Power on the Raspberry Pi 2. Note red and green LED activity during the boot process. Verify that the Edimax Wi-Fi adapter is active by observing blue LED activity on the adapter. Move the Raspberry Pi 2 within five feet of the devices being tested. Reseat the Wi-Fi USB adapter i. Power off the Raspberry Pi 2. ii. Remove and reinstall the Wi-Fi USB adapter. iii. Power on the Raspberry Pi 2. iv. If the problem continues, repeat the process with a different USB port.
3. The Web Server Virtual Machine is unable to see the Silicon Labs Thread Wi-Fi network. a. Verify Wi-Fi radio is enabled. b. In the Web Server Virtual Machine application, verify that the Network Bridge adapter and the appropriate Wi-Fi adapter are selected. c. Move the Raspberry Pi 2 within five feet of the devices being tested. d. Verify other devices can find the Silicon Labs Thread Wi-Fi network. 4. Thread End Nodes do not appear in the device list. a. Power-cycle the Thread End Nodes. b. Power off the Thread End Nodes and Raspberry Pi 2, and close the Web Server Virtual Machine. Repeat the steps in section 5.1, Turn on and connect all components. c. Reprogram the Thread End Nodes. See section 3.2, Install the Thread End Node application software. .
8
Rev. 0.1
QSG102 CONTACT INFORMATION Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 Tel: 1+(512) 416-8500 Fax: 1+(512) 416-9669 Toll Free: 1+(877) 444-3032 For additional information please visit the Silicon Labs Technical Support page: http://www.silabs.com/support/Pages/default.aspx
Patent Notice Silicon Labs invests in research and development to help our customers differentiate in the market with innovative low-power, small size, analog-intensive mixed-signal solutions. Silicon Labs' extensive patent portfolio is a testament to our unique approach and world-class engineering team. The information in this document is believed to be accurate in all respects at the time of publication but is subject to change without notice. Silicon Laboratories assumes no responsibility for errors and omissions, and disclaims responsibility for any consequences resulting from the use of information included herein. Additionally, Silicon Laboratories assumes no responsibility for the functioning of undescribed features or parameters. Silicon Laboratories reserves the right to make changes without further notice. Silicon Laboratories makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Silicon Laboratories assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Silicon Laboratories products are not designed, intended, or authorized for use in applications intended to support or sustain life, or for any other application in which the failure of the Silicon Laboratories product could create a situation where personal injury or death may occur. Should Buyer purchase or use Silicon Laboratories products for any such unintended or unauthorized application, Buyer shall indemnify and hold Silicon Laboratories harmless against all claims and damages. Silicon Laboratories, Silicon Labs, and Ember are registered trademarks of Silicon Laboratories Inc. Other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders.
Rev. 0.1
9