Changes between Version 53 and Version 54 of expansion/gw16122


Ignore:
Timestamp:
04/01/2019 08:08:25 PM (6 months ago)
Author:
Cale Collins
Comment:

Heavily modified Getting Started section, through to troubleshooting.

Legend:

Unmodified
Added
Removed
Modified
  • expansion/gw16122

    v53 v54  
    2626It is beneficial to read this entire wiki page before getting started to gain knowledge about the product. Note that a majority of information required for an advanced IoT solution will come from TI.
    2727
    28 Please follow the below steps to get started with the Gateworks hardware using the default Ti software solution.
     28Please follow the steps below to get started with the Gateworks hardware using the default Ti software solution.
     29
     30=== TI's Projet Zero using Gateworks products ===
     31[http://dev.ti.com/tirex/content/cc26xx_bluetooth_smart/cc26xx_bluetooth_smart__2.01.00.44423/Projects/ble/ProjectZero/project0_resources/prz/index.html Project Zero on dev.ti.com]
     32
     33This Project will configure one GW16122 to recieve data transmission via a sub 1ghz connection from a second GW16122.  A web UI will show the devices as connected.   
     34
     35**Summary:**
     36
     371. Acquire necessary hardware
     381. Download TI software
     391. Configure Gateworks SBC
     401. Configure Coprocessor and Sensor firmware
     411. Install Coprocessor on GWSBC, attach SBC to same subnet as workstation and verify IP address
     421. Boot GW SBC launch launch webUI gateway then collector
     431. Open brouser on workstation, access webUI, open collector for new connections
     441. Power sensor on and watch for connection, verify transmission can be sent and received   
     45
    2946
    3047=== Hardware Requirements ===
    31  All items purchased seperately
    32 
    33  * Gateworks [http://www.gateworks.com/product Ventana or Newport] Single Board Computer
    34  * Gateworks [http://www.gateworks.com/product/item/gw16122-mini-pcie-iot-radio-expansion-card GW16122 IoT Card]
    35  * Gateworks GW10124 900Mhz Antenna
    36  * Gateworks [https://shop.gateworks.com/index.php?route=product/product&product_id=59 GW10074] MMCX to SMA Female Adapter Cable
    37  * [http://www.ti.com/tool/LAUNCHXL-CC1350 Ti CC1350 LaunchPad]
    38   * Gateworks SBC and GW16122 are the 'collector' in the system. This CC1350 !LaunchPad becomes the 'sensor' for development.
    39  *  USB to Mini-PCIe Adapter
     48 All items purchased separately
     49
     50 * 1 x Gateworks [http://www.gateworks.com/product Ventana or Newport] Single Board Computer
     51 * 2 x Gateworks [http://www.gateworks.com/product/item/gw16122-mini-pcie-iot-radio-expansion-card GW16122 IoT Card]
     52 * 2 x Gateworks [[https://shop.gateworks.com/index.php?route=product/product&path=70_71&product_id=213 GW10124] 900Mhz Antenna
     53 * 2 x Gateworks [https://shop.gateworks.com/index.php?route=product/product&product_id=59 GW10074] MMCX to SMA Female Adapter Cable
     54 * 1 x USB to Mini-PCIe Adapter
    4055  * This allows the Gateworks GW16122 to be connected to a Laptop / PC for programming purposes.
    4156  * [https://www.amazon.com/Mini-Wireless-Adapter-Module-Testing/dp/B00T2FPC2A/ref=sr_1_8?ie=UTF8&qid=1519335779&sr=8-8& Option #1 - Amazon] - Requires rubberband to hold GW16122 in
    4257 
    43  
    44 === Software Requirements ===
    45 
    46 Note, this example uses the standard Ti software. For other software, see [#ThirdPartySoftware here]
    47 
    48 Most software must be acquired from Ti because it is held behind a EULA.
    49 
    50 You will need to download 2 software packages from TI on a Linux PC:
     58 === Software Requirements ===
     59
     60Note, this example uses the standard Ti software. For third party software, see [#ThirdPartySoftware here].
     61
     62Software must be acquired from Ti because it is held behind a EULA.
     63
     64Download 3 these software packages on a Linux PC:
     651. TI 15.4 Stack [http://www.ti.com/tool/download/TI-15-4-STACK-GATEWAY-LINUX-SDK TI-15-4-STACK-GATEWAY-LINUX-SDK]
    51661. TI !SimpleLink SDK [http://www.ti.com/tool/download/SIMPLELINK-CC13X0-SDK SIMPLELINK-CC13X0-SDK]
    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 {{{
     671. TI Uniflash [http://www.ti.com/tool/uniflash]
     68
     69Once downloaded, install all 3 packages on your Linux desktop workstation.
     70
     71Prepare 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
     74chmod +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
     78tar -czvf ti15-4.tar.gz ti/ 
     79}}}
     80**Note:** See also [wiki:/expansion/gw16122#GateworksSBCTools SBC Tools]
     81
     82=== Configure Gateworks board ===
     83
     84This 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
     88Update Ubuntu:
     89{{{#!bash
    8390apt-get update
    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}}}
     92Transfer 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)
     95wget http://remotehost/path/to/ti15-4.tar.gz
     96#scp is also viable
     97}}}
     98Extract the files:
     99{{{#!bash
     100tar xzvf ./ti15-4.tar.gz
     101# Optional delete the .tar.gz file
     102rm ti15-4.tar.gz
     103}}}
     104Install build-essential and nodejs packages:
     105{{{#!bash
     106apt-get install build-essential nodejs
     107}}}
     108Change directory to TI trunk, allow execute permission, and run build_all:
     109{{{#!bash
     110cd ~/ti/ti154stack_linux_x64_2_08_00_04
     111chmod +x build_all.sh
     112./build_all.sh
     113}}}
     114Now make host_collector:
     115{{{#!bash
     116cd ~/ti/ti154stack_linux_x64_2_08_00_04/example/collector 
     117make
     118#Optional verify host collector is correct architecture
     119file host_collector
     120}}}
     121Modem manager will conflict with the GW16122 and must be disabled.
     122{{{#!bash
     123#stop ModemManager
     124systemctl stop ModemManager
     125#disable ModemManager at boot
     126systemctl disable ModemManager
     127#mask ModemManager so it will surely not start, if this process runs host_collector will produce errors and not work.
     128systemctl mask ModemManager
     129}}}
     130**The Gateworks SBC is now configured, execute the command "sync" then remove power for next steps.**
     131{{{#!bash
     132sync #this ensures changes are written to MMC
     133}}}
     134
     135=== Configure GW16122 Sensor and Co-processor firmware ===
     136Launch Uniflash GUI with the following commands:
     137{{{#!bash
     138cd uniflash/uniflash_4.6.0/node-webkit
     139./nw
     140}}}
     141Under "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.
     142A 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". 
     143This 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
     1511. 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.
     1521. 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}}}
     1571. 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". 
     1581. Disconnect the Collector GW16122, remove it from the USB > mPCI-e adapter and replace it with the GW16122 that will act as a sensor.
     1591. 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}}}
     1641. 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  ===
     1671. 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. 
     1681. Power the Gateworks SBC, verify GW16122 is present with lsusb.
     169 **Example:**
     170{{{#!bash
     171root@bionic-newport:~# lsusb
     172Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
     173Bus 003 Device 002: ID 0451:bef3 Texas Instruments, Inc.  #This is the GW16122
     174Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
     175Bus 002 Device 002: ID 0424:5744 Standard Microsystems Corp.
     176Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
     177Bus 001 Device 003: ID 0424:2740 Standard Microsystems Corp.
     178Bus 001 Device 002: ID 0424:2744 Standard Microsystems Corp.
     179Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
     180}}}
     1813. "ifconfig" record localhost ip. Be sure this IP is on the same subnet as your desktop workstation. 
     182 **Example:**
     183{{{#!bash
     184root@bionic-newport:~# ifconfig
     185eth0: 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
     194lo: 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}}}
     2034.  Navigate to then launch the gateway, it will be silent and in the background:
     204{{{#!bash
     205cd ~/ti/ti154stack_linux_x64_2_08_00_04/example/gateway/
     206nodejs gateway.js 1>/dev/null &
     207}}}
     208 * If this is successful you will see a PID. 
     209
     210
     2115.  Navigate to then launch host_collector:
     212{{{#!bash
     213cd ~/ti/ti154stack_linux_x64_2_08_00_04/example/collector
     214./host_collector collector.cfg
     215}}}
     2166. 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
     218rm nv-simulation.bin #if this file is present no errors will display but sub 1 GHz connection will not complete
     219}}}
     220=== Collector WebUI ===
     221Open 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 ===
     224Attach 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
    138234
    139235=== What's Next? ===
     
    141237This example showcases a network setup between a sensor and collector, with the Gateworks SBC acting as a co-processor.
    142238
    143 Future development will be accomplished through understanding all the Ti source code contained in the SimpleLink SDK and TI 15.4 Stack. Custom applications can be created using all of the TI provided software.
     239Future development will be accomplished through understanding all the Ti source code contained in the !SimpleLink SDK and TI 15.4 Stack. Custom applications can be created using all of the TI provided software.
    144240
    145241Please read and understand the following links below:
     
    147243 * [http://dev.ti.com/tirex/#/ TI Resource Explorer - Documentation]
    148244 * [http://processors.wiki.ti.com/index.php/Main_Page TI Wiki]
    149 
    150245 * [http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20CC13x0%20SDK ​CC1350 Wiki]
    151246 * [http://dev.ti.com/tirex/content/tirtos_cc13xx_cc26xx_2_20_00_06/resources/cc1350LaunchPad/project0/landing_page_index.html ​Launch Pad Resource Explorer Landing Page on Ti]