52 | | 2. TI 15.4 Stack [http://www.ti.com/tool/download/TI-15-4-STACK-GATEWAY-LINUX-SDK TI-15-4-STACK-GATEWAY-LINUX-SDK] |
53 | | |
54 | | There are 3 or more pieces of software: |
55 | | 1. GW16122 firmware: '''pre-installed (so you can skip this step)''' is called the !CoProcessor firmware |
56 | | * Download the SDK here: [http://www.ti.com/tool/download/SIMPLELINK-CC13X0-SDK SIMPLELINK-CC13X0-SDK] |
57 | | * Gateworks tested with SDK version 1.40.xx |
58 | | * There is a precompiled binary in the SDK here: |
59 | | * /usr/src/ti/simplelink_cc13x0_sdk_xxx/examples/rtos/CC1350_LAUNCHXL/ti154stack/hexfiles/coprocessor_cc13x0_lp.hex |
60 | | * Built from the source code here: |
61 | | * /usr/src/ti/simplelink_cc13x0_sdk_xxx/examples/rtos/CC1350_LAUNCHXL/ti154stack/coprocessor |
62 | | 1. CC1350 !LaunchPad Sensor Node Firmware |
63 | | * There is a precompiled binary .hex file in the [http://www.ti.com/tool/download/SIMPLELINK-CC13X0-SDK SIMPLELINK-CC13X0-SDK] from step 1: |
64 | | * /usr/src/ti/simplelink_cc13x0_sdk_xxx/examples/rtos/CC1350_LAUNCHXL/ti154stack/hexfiles/default/sensor_default.hex |
65 | | * Gateworks tested with SDK version 1.40.xx |
66 | | * Install firmware to Sensor !LaunchPad with [#HostProgrammingSoftware this information] |
67 | | * Additional TI Links here: |
68 | | * [http://dev.ti.com/tirex/content/simplelink_academy_cc13x0sdk_1_12_01_16/modules/154-stack_03_linux_project_0/154-stack_03_linux_project_0.html Recommended - Project 0] |
69 | | * [http://www.ti.com/lit/ug/swru491a/swru491a.pdf Gateway Example PDF] |
70 | | 1. Install [wiki:ubuntu Ubuntu 14.04] trusty-ventana (~210MB) on Gateworks SBC |
71 | | * Note Ubuntu Xenial 16.04 is not supported at this time |
72 | | 1. The collector application running in Ubuntu on the Gateworks SBC |
73 | | * Must download Ti-15-4 Stack from Ti onto Linux Desktop [http://www.ti.com/tool/download/TI-15-4-STACK-GATEWAY-LINUX-SDK] |
74 | | * Once installed on desktop, find the file: ti154stack_linux_x64_2_04_00_19/prebuilt/bbb_prebuilt.tar.gz |
75 | | * Copy this file (bbb_prebuilt.tar.gz) onto the Gateworks SBC running Ubuntu either through wget or USB drive or scp or other options. |
76 | | * Extract this with the command on the Gateworks SBC: |
77 | | {{{ |
78 | | tar xvf bbb_prebuilt.tar.gz |
79 | | }}} |
80 | | * Keep note of where this was extracted for future reference. |
81 | | * Install the required packages for this application: |
82 | | {{{ |
| 67 | 1. TI Uniflash [http://www.ti.com/tool/uniflash] |
| 68 | |
| 69 | Once downloaded, install all 3 packages on your Linux desktop workstation. |
| 70 | |
| 71 | Prepare the TI 15.4 stack for transfer to your Gateworks board for the collector software. |
| 72 | {{{#!bash |
| 73 | # enable execute permissions on binary downloaded from above link, your file name may be different |
| 74 | chmod +x ti15.4stack_linux_x64_2_02_00_03.run |
| 75 | # run the installer |
| 76 | ./ti15.4stack_linux_x64_2_02_00_03.run |
| 77 | # package the install files from target directory |
| 78 | tar -czvf ti15-4.tar.gz ti/ |
| 79 | }}} |
| 80 | **Note:** See also [wiki:/expansion/gw16122#GateworksSBCTools SBC Tools] |
| 81 | |
| 82 | === Configure Gateworks board === |
| 83 | |
| 84 | This procedure has been tested with both Newport and Ventana family of products. Ubuntu Trusty and later has been verified to work with this test. Refer to [http://trac.gateworks.com/wiki/gettingstarted Getting Started] for instruction to install Ubuntu. In this particular example Bionic Ubuntu was installed on a Newport GW6304. |
| 85 | |
| 86 | **On Gateworks SBC with Ubuntu installed:** |
| 87 | |
| 88 | Update Ubuntu: |
| 89 | {{{#!bash |
84 | | apt-get install -y build-essential nodejs |
85 | | }}} |
86 | | |
87 | | |
88 | | === Getting Started Steps === |
89 | | |
90 | | * Program CC1350 !LaunchPad Sensor node as described in software section above |
91 | | * Connect GW16122 to Gateworks SBC in Mini-PCIe slot that supports USB |
92 | | * Connect antenna to GW16122 |
93 | | * Gateworks SBC should have Ubuntu 14.04 Trusty installed as required in the software section above |
94 | | * Connect ethernet cable to Gateworks SBC on the same network as a PC/Laptop (for web gui viewing from PC) |
95 | | * Install the collector application software on the Gateworks SBC as described above in the software requirements section |
96 | | |
97 | | ==== Running the Collector Application ==== |
98 | | |
99 | | * To start the collector application, run the script on the Gateworks command line: |
100 | | {{{ |
101 | | ./run_demo.sh |
102 | | }}} |
103 | | The output will look something like below: |
104 | | {{{ |
105 | | root@ventana-trusty:~/ti-15.4/examples/linux/prebuilt# ./run_demo.sh |
106 | | Launching the Collector Application in the background |
107 | | Found Mac Co-Processor Version info is: |
108 | | Transport: 3 |
109 | | Product: 1 |
110 | | Major: 2 |
111 | | Minor: 0 |
112 | | Maint: 0 |
113 | | ---------------------------------------- |
114 | | Start the gateway application |
115 | | Collector Running as Process id: 1656 |
116 | | Launching Node-JS gateway application in background |
117 | | Gateway is running as Process id: 1667 |
118 | | |
119 | | On your host, launch your browser using: |
120 | | http://192.168.21.136:1310 |
121 | | root@ventana-trusty:~/ti-15.4/examples/linux/prebuilt# |
122 | | |
123 | | }}} |
124 | | * Observe the IP address printed out in the script output |
125 | | |
126 | | * From a computer on the same network as the Gateworks board, open a web browser and type in the IP address including the port and observe the web gui shown below: |
127 | | * * '''IMPORTANT''' Click the grey button in the !WebGui on the left to open the network for new devices |
128 | | * [[Image(gw16122webgui.png,400px)]] |
129 | | * Power on the sensor node that should then connect to the collector. |
130 | | * NOTE: The sensor node has NV Ram that stores the last network it was connected to. This must be reset every time the run_demo.sh script is ran. |
131 | | * You can test the connection by clicking the 'Toggle LED' on the sensor node. This often takes 10 seconds to transmit and will affect LED D2 on the GW16122 if it is being used as a sensor. |
132 | | |
133 | | ==== Troubleshooting ==== |
134 | | * Be sure any GW16122 boards have an antenna installed |
135 | | * Be sure the collector network is an open network so that the sensors can joined. By default, the network is closed and no sensors can join |
136 | | * Be sure that the Gateworks board and collector are all setup and turned on and the WebGUI is live with the run_demo script running on the Gateworks board. After this, then try re-programming the sensor firmware. This usually will force the sensor to re-join and search for new networks. |
137 | | * On the Gateworks board, you can try deleting the file in the extracted bin folder called nv-simulation.bin. This file will erase all previously connected sensor entries. |
| 91 | }}} |
| 92 | Transfer the TI 15.4 stack files to your Gateworks SBC using your method of choice: |
| 93 | {{{#!bash |
| 94 | # pull installation file from host pc (networked method) |
| 95 | wget http://remotehost/path/to/ti15-4.tar.gz |
| 96 | #scp is also viable |
| 97 | }}} |
| 98 | Extract the files: |
| 99 | {{{#!bash |
| 100 | tar xzvf ./ti15-4.tar.gz |
| 101 | # Optional delete the .tar.gz file |
| 102 | rm ti15-4.tar.gz |
| 103 | }}} |
| 104 | Install build-essential and nodejs packages: |
| 105 | {{{#!bash |
| 106 | apt-get install build-essential nodejs |
| 107 | }}} |
| 108 | Change directory to TI trunk, allow execute permission, and run build_all: |
| 109 | {{{#!bash |
| 110 | cd ~/ti/ti154stack_linux_x64_2_08_00_04 |
| 111 | chmod +x build_all.sh |
| 112 | ./build_all.sh |
| 113 | }}} |
| 114 | Now make host_collector: |
| 115 | {{{#!bash |
| 116 | cd ~/ti/ti154stack_linux_x64_2_08_00_04/example/collector |
| 117 | make |
| 118 | #Optional verify host collector is correct architecture |
| 119 | file host_collector |
| 120 | }}} |
| 121 | Modem manager will conflict with the GW16122 and must be disabled. |
| 122 | {{{#!bash |
| 123 | #stop ModemManager |
| 124 | systemctl stop ModemManager |
| 125 | #disable ModemManager at boot |
| 126 | systemctl disable ModemManager |
| 127 | #mask ModemManager so it will surely not start, if this process runs host_collector will produce errors and not work. |
| 128 | systemctl mask ModemManager |
| 129 | }}} |
| 130 | **The Gateworks SBC is now configured, execute the command "sync" then remove power for next steps.** |
| 131 | {{{#!bash |
| 132 | sync #this ensures changes are written to MMC |
| 133 | }}} |
| 134 | |
| 135 | === Configure GW16122 Sensor and Co-processor firmware === |
| 136 | Launch Uniflash GUI with the following commands: |
| 137 | {{{#!bash |
| 138 | cd uniflash/uniflash_4.6.0/node-webkit |
| 139 | ./nw |
| 140 | }}} |
| 141 | Under "New Configuration" you will see "1" "Choose Your Device" below that "Category:", Select "All" then in the search field type "cc1350f128", this will leave you with one option, click on it. |
| 142 | A new search field will appear "Texas Instruments XDS110 USB Debug Probe" will be selected by default, if not search for it and select it, then click "3" "Start". |
| 143 | This will take you to the next menu. There are 4 fields that can be chosen from: |
| 144 | * Program |
| 145 | * Settings & Utilities |
| 146 | * Memory |
| 147 | * Standalone Command Line |
| 148 | |
| 149 | **Flashing Firmware:** |
| 150 | |
| 151 | 1. Select the "Settings & Utilities" field, locate the "Program Load" drop down, then click the bubble for "All Unprotected Sectors". By default this is set to "Necessary Sectors Only" and must be changed. Now scroll down to the "Manual Erase" drop down, ensure "Erase entire flash" is selected. |
| 152 | 1. Select the "Program" field, then the search field "Flash Image(s)", click "Brouse", navigate to where Simplelink SDK has been installed. Navigate further to the folder containing the co-processor firmware and select the **coprocessor_cc13xx_lp.hex**: |
| 153 | {{{ |
| 154 | $SDK_TRUNK/simplelink_cc13x0_sdk_1_40_00_10/examples/rtos/CC1350_LAUNCHXL/ti154stack/hexfiles/coprocessor_cc13xx_lp.hex |
| 155 | #Note this is the hexfiles directory |
| 156 | }}} |
| 157 | 1. Attach the GW16122 you wish to be the Collector to your USB > mPCI-e adapter, attach this to your host machine's USB port, then click "Load Image". |
| 158 | 1. Disconnect the Collector GW16122, remove it from the USB > mPCI-e adapter and replace it with the GW16122 that will act as a sensor. |
| 159 | 1. In the search field under "Flash Image(s)" navigate to the folder containing the sensor firmware and select **sensor_default.hex**: |
| 160 | {{{ |
| 161 | $SDK_TRUNK/simplelink_cc13x0_sdk_1_40_00_10/examples/rtos/CC1350_LAUNCHXL/ti154stack/hexfiles/default/sensor_default.hex |
| 162 | #Note this is a subdirectory of hexfiles |
| 163 | }}} |
| 164 | 1. Be sure "All Unprotected Sectors" and "Erase entire flash" settings from step one are still selected, click "Load Image", when the message "[SUCCESS] Program Load completed successfully." is displayed and the flashing procedure is complete, disconnect the GW16122 from the desktop workstation USB. |
| 165 | |
| 166 | === Install GW16122 collector on SBC then launch webUI gateway === |
| 167 | 1. Attach antenna to "SUB 1GHz" port of the GW16122 that is programmed with "co-processor" firmware, now install GW16122 on Gateworks SBC in a slot with USB signaling. |
| 168 | 1. Power the Gateworks SBC, verify GW16122 is present with lsusb. |
| 169 | **Example:** |
| 170 | {{{#!bash |
| 171 | root@bionic-newport:~# lsusb |
| 172 | Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub |
| 173 | Bus 003 Device 002: ID 0451:bef3 Texas Instruments, Inc. #This is the GW16122 |
| 174 | Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub |
| 175 | Bus 002 Device 002: ID 0424:5744 Standard Microsystems Corp. |
| 176 | Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub |
| 177 | Bus 001 Device 003: ID 0424:2740 Standard Microsystems Corp. |
| 178 | Bus 001 Device 002: ID 0424:2744 Standard Microsystems Corp. |
| 179 | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub |
| 180 | }}} |
| 181 | 3. "ifconfig" record localhost ip. Be sure this IP is on the same subnet as your desktop workstation. |
| 182 | **Example:** |
| 183 | {{{#!bash |
| 184 | root@bionic-newport:~# ifconfig |
| 185 | eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 |
| 186 | inet 172.24.24.193 netmask 255.240.0.0 broadcast 172.24.255.255 # In this example 172.24.24.193 is the IP address of the localhost. |
| 187 | inet6 fe80::2d0:12ff:feda:f3fa prefixlen 64 scopeid 0x20<link> |
| 188 | ether 00:d0:12:da:f3:fa txqueuelen 1000 (Ethernet) |
| 189 | RX packets 5038 bytes 490843 (490.8 KB) |
| 190 | RX errors 0 dropped 0 overruns 0 frame 0 |
| 191 | TX packets 173 bytes 16799 (16.7 KB) |
| 192 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
| 193 | |
| 194 | lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 |
| 195 | inet 127.0.0.1 netmask 255.0.0.0 |
| 196 | inet6 ::1 prefixlen 128 scopeid 0x10<host> |
| 197 | loop txqueuelen 1000 (Local Loopback) |
| 198 | RX packets 36 bytes 4392 (4.3 KB) |
| 199 | RX errors 0 dropped 0 overruns 0 frame 0 |
| 200 | TX packets 36 bytes 4392 (4.3 KB) |
| 201 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
| 202 | }}} |
| 203 | 4. Navigate to then launch the gateway, it will be silent and in the background: |
| 204 | {{{#!bash |
| 205 | cd ~/ti/ti154stack_linux_x64_2_08_00_04/example/gateway/ |
| 206 | nodejs gateway.js 1>/dev/null & |
| 207 | }}} |
| 208 | * If this is successful you will see a PID. |
| 209 | |
| 210 | |
| 211 | 5. Navigate to then launch host_collector: |
| 212 | {{{#!bash |
| 213 | cd ~/ti/ti154stack_linux_x64_2_08_00_04/example/collector |
| 214 | ./host_collector collector.cfg |
| 215 | }}} |
| 216 | 6. Uppon running host_collector a file nv-simulation.bin is created, be sure to delete this file at the end of every session. **It is critical this file is not present when launching host_collector.** |
| 217 | {{{#!bash |
| 218 | rm nv-simulation.bin #if this file is present no errors will display but sub 1 GHz connection will not complete |
| 219 | }}} |
| 220 | === Collector WebUI === |
| 221 | Open Brouser on desktop workstation, navigate to the IP address of your Gateworks SBC (recorded in previous steps), append the port :1310 and enter this into the address bar. Using the IP from the example the address bar will contain "http://172.24.24.193:1310/". In the "Network Information" field click the "Open" button next to the text "Network close for New Devices", when sucessful this will change to "Network open for New Devices" |
| 222 | |
| 223 | === Power ON sensor, final steps === |
| 224 | Attach antenna to "SUB 1GHz" port of the GW16122 that will act as "Sensor". Connect the GW16122 "sensor" to the USB of your desktop workstation to power it on. The sensor should connect imedately to the collector, this is indicated by the red LED D2 iluminating. If this LED does not iluminate see "Troubleshooting" section. Using the WebUI check that a "Sensor Node" is present. Under "RSSI" click the "ToggleLED" box, this will cause LED D1 and D2 on the Collector to turn on brifly. This is verification that all the steps have been followed correctly, and RSSI signals can be sent and recieved. |
| 225 | |
| 226 | === Troubleshooting === |
| 227 | * Be sure GW16122 boards have an antenna installed |
| 228 | * Be sure the collector network is an open network so that the sensors can be joined. By default, the network is closed and no sensors can join |
| 229 | * Use "systemctl |grep running -i" or "systemctl |grep modem -i" to verify !ModemManager is not running. |
| 230 | * Be sure that the Gateworks board and collector are all setup and turned on and the WebGUI is live with the host_collector program running on the Gateworks board. After this, then try re-programming the sensor firmware, then powering it off and back on. |
| 231 | * On the Gateworks board nv-simulation.bin has been deleted. This file will erase all previously connected sensor entries. |
| 232 | * When flashing "Erase all unprotected sectors" and "Erase entire flash" have been selected. |
| 233 | |