1 #ZigBee IoT Kit\r
2 \r
3 The SW contained on this git is intended to be used in conjunction with the ZigBee IoT Kit. This SW is a client to the ZigBee Home Automation Gateway described [here](http://www.ti.com/tool/CC2531EM-IOT-HOME-GATEWAY-RD) and available to download [here](http://www.ti.com/tool/z-stack) (Z-STACK-LINUX-GATEWAY download).\r
4 \r
5 \r
6 **TBD: WILL HW BE BROUGHT SEPARATELY OR AS A KIT? Links here!!!**\r
7 \r
8 In this kit you will receive a USB key that will install all the required SW on a BeagleBone Black, clone this git and resolve the NPM dependencies.\r
9 \r
10 #Setting up the BeagleBone Black#\r
11 \r
12 To set the beaglebone Black as a Linux ZigBee Gateway:\r
13 \r
14 1. Connect the USB memory key provided to the Beaglebone Black\r
15 2. Connect the Ethernet port of the BeagleBone Black to an Access Point that has a direct connection to the internet.\r
16 2. Connect the Beaglebone Black USB to your PC and wait for it to bootup.\r
17 3. Open [Tera-Term](http://en.sourceforge.jp/projects/ttssh2/releases/) or similar serail terminal. \r
18 4. If the Beaglebone has booted and the [Gadget Enet Drivers for BeagleBone](http://beagleboard.org/static/beaglebone/latest/README.htm#step2) have been installed correctly you will see "COMxxx: Gadget Serial (COMxx)" as an available serial port. \r
19 5. Open the "COMxxx: Gadget Serial (COMxx)" Serial port.\r
20 5. Select "Setup -> Serial port..." from the menu bar and set it to 115200 8n1 with no flow control. \r
21 4. Select "Setup -> Terminal..." from the menu bar and ensure that "New-Line" - "Receive:" and "Transmit:" are set to "CR" and that "Local Echo" is off.\r
22 6. Press enter to get a prompt and enter "root" as the username and no password.\r
23 7. Run the setup script from the USB Memory Stick: \r
24 \r
25 /media/setup/setup.sh \r
26 9. Once the script has run halt the BeagleBone Black by typing `halt` in the command line.\r
27 \r
28 #Running The IoT Agent And Web Server#\r
29 \r
30 In the following sections you will be walking through the ZigBee IoT kit out of box experience. \r
31 \r
32 The IoT Agent and web servers are implemented using Node.js. The web server allow you to interact with the ZigBee devices locally with no internet connect. The IoT agent connects to the IBM IoT service.\r
33 \r
34 1. When the Beaglebone Black has halt remove the USB memory key and connect the CC2531 USB Dongle programmed with the ZNP FW and then power cycle the BeagleBone.\r
35 \r
36 The gadget driver can be temperamental if it does not reappear press reset on BeagleBone Black, remove the USB close Teraterm and reconnect the USB and wait for it to reboot.\r
37 \r
38 2. When the BeagleBone Black reboots it should be running the Zstack Linux Gateway as a service. To check this is running correct:\r
39 \r
40 systemctl status zbgateway.service\r
41 \r
42 \r
43 if everything is setup correctly it will repoort:\r
44 \r
45 May 15 02:26:02 beaglebone zigbeegw[1436]: starting tracker with our pid /ro...2\r
46 May 15 02:26:02 beaglebone zigbeegw[1436]: =================================...=\r
47 May 15 02:26:02 beaglebone zigbeegw[1436]: tracking 4 pids, 1504 1510 1523 1532\r
48 May 15 02:26:02 beaglebone zigbeegw[1436]: when we see something missing we ...6\r
49 May 15 02:45:01 beaglebone-zigbeegw[1815]: starting tracker with our p... \r
50 \r
51 2. The IoT agent should also be running as a separate service. To check this is running correct:\r
52 \r
53 systemctl status zbiotagent.service\r
54 \r
55 if everything is setup correctly it will repoort:\r
56 \r
57 May 15 02:26:02 beaglebone zigbeegw[1436]: starting tracker with our pid /ro...2\r
58 May 15 02:26:02 beaglebone zigbeegw[1436]: =================================...=\r
59 May 15 02:26:02 beaglebone zigbeegw[1436]: tracking 4 pids, 1504 1510 1523 1532\r
60 May 15 02:26:02 beaglebone zigbeegw[1436]: when we see something missing we ...6\r
61 May 15 02:45:01 beaglebone-zigbeegw[1815]: starting tracker with our p... \r
62 \r
63 3. get the IP address of the BeagleBone Black (in this case it is 192.168.100.104):\r
64 \r
65 \r
66 # ifconfig\r
67 eth0 Link encap:Ethernet HWaddr c8:a0:30:ac:4d:bf\r
68 inet addr:192.168.100.104 Bcast:192.168.100.255 Mask:255.255.255.0\r
69 inet6 addr: fe80::caa0:30ff:feac:4dbf/64 Scope:Link\r
70 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\r
71 RX packets:2326 errors:0 dropped:0 overruns:0 frame:0\r
72 TX packets:130 errors:0 dropped:0 overruns:0 carrier:0\r
73 collisions:0 txqueuelen:1000\r
74 RX bytes:746806 (729.3 KiB) TX bytes:16904 (16.5 KiB)\r
75 Interrupt:40\r
76 \r
77 loLink encap:Local Loopback\r
78 inet addr:127.0.0.1 Mask:255.0.0.0\r
79 inet6 addr: ::1/128 Scope:Host\r
80 UP LOOPBACK RUNNING MTU:65536 Metric:1\r
81 RX packets:2252 errors:0 dropped:0 overruns:0 frame:0\r
82 TX packets:2252 errors:0 dropped:0 overruns:0 carrier:0\r
83 collisions:0 txqueuelen:0\r
84 RX bytes:171340 (167.3 KiB) TX bytes:171340 (167.3 KiB)\r
85 \r
86 usb0 Link encap:Ethernet HWaddr ea:ac:35:eb:82:52\r
87 inet addr:192.168.7.2 Bcast:192.168.7.3 Mask:255.255.255.252\r
88 inet6 addr: fe80::e8ac:35ff:feeb:8252/64 Scope:Link\r
89 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\r
90 RX packets:0 errors:0 dropped:0 overruns:0 frame:0\r
91 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\r
92 collisions:0 txqueuelen:1000\r
93 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)\r
94 \r
95 5. Check that you are on the same LAN as the BeagleBone Black, then browse to http://<*ip_address*>:5000 and view the local web interface. You should see:\r
96 \r
97 ![](http://processors.wiki.ti.com/images/6/6d/Devlist-1.JPG)\r
98 \r
99 #Connecting The Sensor Tag#\r
100 \r
101 1. In the web interface press the "Add Device" button to open the network.\r
102 2. Insert the battery into the Sensor Tag.\r
103 3. Observe the Sensor Tag joining the network and appearing in the device list of the web interface. When the device has joined click "Done".\r
104 4. Click on the temperature sensor in the device list. You should see a web interface which reflects the temperature measured.\r
105 5. Click on the menu icon in the top right and then "Back" to get back to the device list.\r
106 \r
107 The ZigBee Sensor Tag has 3 end points:\r
108 \r
109 - Light Sensor\r
110 - Temperature Sensor\r
111 - Switch \r
112 \r
113 Each EndPoint is represented as a device in the web interface. Spend a few minutes exploring the web interface for each device.\r
114 \r
115 ![](http://processors.wiki.ti.com/images/f/f9/Devview-1.JPG)\r
116 \r
117 #Viewing The Devices Data In IBM QuickStart#\r
118 \r
119 Each device can be visualized in the IBM QuickStart service, the devices start publishing their data to the IBM QuickStart Service when they join the network. To view the Quickstart page for each device simply click on the device, click on the menu icon of the devices web page and click "QuickStart Link".\r
120 \r
121 ![](http://processors.wiki.ti.com/images/4/44/Qstemp-1.JPG) \r
122 \r
123 \r
124 \r