Welcome

This enables ​Gateworks SBCs to act as a collector or gateway to other IoT sensors over the Sub-1GHz Radio band. This band allows for long range and low power communication without any carrier subscription required. No consortium or software subscriptions are required. TI has made all software open source and available.

Advantages of Gateworks IoT solution over SigFox, LoRa, Zigbee, etc:

Long Range

Create your own network

Do not rely on coverage of pre-existing networks (Verizon, AT&T, etc)

Open Source provided software by TI

No extra fees, subscription, etc

No joining of alliances/consortiums/etc

Works in remote areas where no coverage from other networks/carriers exist

Getting Started

It 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.

Please follow the below steps to get started with the Gateworks hardware:

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:

* IMPORTANT Click the grey button in the WebGui on the left to open the network for new devices

Power on the sensor node that should then connect to the collector.

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.

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.

Troubleshooting

Be sure any GW16122 boards have an antenna installed

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

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.

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.

What's Next?

This example showcases a network setup between a sensor and collector, with the Gateworks SBC acting as a co-processor.

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.

Texas Instruments CC1350 Reference Design

RF Network / Infrastructure

The GW16122 / CC1350 operates on its own network. It does not rely on towers/networks installed by 3rd party companies (LoRa, Sigfox, Verizon, AT&T, etc). The entire network infrastructure is under control by the user. This includes sensors/nodes, collector(s), antennas and more.

Network Architecture

The default is a star-based topology system where there is one central collector (The GW16122 on a Gateworks SBC) that listens to all the sensors / nodes that are around it.

Sensor Limits

Number of connected users:

Support for 50 nodes in network is for the MAC-CoProcessor configuration, where the network employs full MAC level security (AES-128).

The Security table can take up all available RAM considering 500 bytes packets so some trade off are possible if the max packet size that must be supported by the application is smaller and the network size can go bigger (probably not reach 1K nodes). The network can scale up to much more nodes if for instance the security is removed at MAC level and deployed at application level (the code is hosted on Linux). The actual network size would be in that case more limited by the traffic profile (ie how frequently data is exchanged).

Range Testing

Gateworks did basic range testing with the GW16122 using a 2dBi Omni Antenna on the 915Mhz band. A successful link was acquired at 4500ft/1.4km over water. Note both the transmitter and receiver were only 1m off the ground so much better performance would be expected if the antennas were mounted higher to clear the Fresnel zones. Using a directional antennas, range can be increased further with links easily greater then >10Km. Additionally, there is different modes and tuning that can be done in software to increase the range, such as LRM (long range mode).

More range information may be found on the ​TI E2E Forums and on the TI documentation listed in the references on this page.

Gateworks Range testing map:

Wi-Sun

The TI 15.4 stack leverages WiSun?-based frequency hopping and can be used on CC1350 and CC1352.
Some 3rd parties capable of implementing a Wi-SUN stack are Adsol-Nissin and Procubed.

Glossary

BLE - Bluetooth Low Engery

BLE-ADV - Bluetooth Low Energy Advertising

OAD - Over the Air Download

802.15.4 - IEEE standard defining the operation of low-rate wireless personal area networks (LR-WPANs). Definition includes the physical layer and media access control. Can be used with 6LoWPAN. The IEEE 802.15.4 standard is used as a data-link layer of many popular networking standards deployed in the market (6LoWPAN, Wi-SUN, ZigBee®, Thread and WHART). It guarantees a solid wireless foundation thanks to features like air arbitration (through CSMA-CA), acknowledgments and retransmissions and built-in AES security.

PA/LNA - Power amplifier (PA) for increased output power, and a low-noise amplifier (LNA) with low noise figure for improved receiver sensitivity. This can be used with the ​Ti CC1190 RF Booster / Front End

TI-RTOS - TI-RTOS kernel is a tailored version of the legacy SYS/BIOS kernel and operates as a real-time, preemptive, multi-threaded operating system with drivers, tools for synchronization and scheduling.

TI-15.4 Stack - The TI 15.4-Stack is a software development kit (SDK) running on the SimpleLink™ Sub-1 GHz CC1310 wireless microcontroller (MCU). Based on the proven IEEE 802.15.4 standard, it implements the 'g' amendment of the specification for operations in North America and Europe in the Sub-1 GHz band (regulated respectively by FCC and ETSI).

LPWAN - Low‑Power Wide‑Area

NB-IoT - Narrow band Internet of Things

Contiki - Open Source Operating System

rfWsnDmNodeOad_US_CC1350STK_TI_CC1350F128-v1_06.hex

rf = Radio Frequency

Wsn = Wireless Sensor Network

Dm = Dual Mode, Bluetooth and Sub 1Ghz

Node = A node is an edge device that is a sensor and sends data back to a central coordinator or collector

Oad = Over the air download

STK = Sensor Tag Kit

Coord Addr - Coordinator Address - This is the address on the network for the coordinator/collector. Example: 0xAABB

PanID - Personal Area Network ID, example 0xACDC

FH - Frequency hopping. Not used in default examples.

EasyLink? - an API, a simple abstraction layer on top of the RF Driver and is intended as a starting point for customers creating a proprietary Sub1-GHz protocol or application.

TI-15.4 Stack, Full stack-based network solution, available as part of the CC13x0 SDK

Thread - Thread is an IPv6-based, low-power mesh networking technology for IoT products, intended to be secure and future-proof. Thread will not work on the Gateworks GW16122 because it is not designed for Sub-1Ghz.

Dash7 - DASH7 Alliance Protocol (D7A) is an open source Wireless Sensor and Actuator Network protocol, which operates in the 433 MHz, 868 MHz and 915 MHz unlicensed ISM band/SRD band. Dash7 has not been tested on the GW16122.

GW16122 Development

Much of the following information is taken from TI documentation which is licensed under ​​CC BY NC ND 4.0. This wiki page aims to get users up and runnning with the GW16122 by collating relevant information contained by aforementioned TI sources along with our own annotations.

The subsequent sections detail the information collected by Gateworks related to development with the GW16122. The GW16122 constitutes the following embedded systems:

TiVa TM4C1294NCPDT MCU - Primarily used to program the CC1350; converts USB signals to UART

Developer Set Up

The following sections detail the steps necessary to set up a development environment for the GW16122. It is assumed that you already have a general understanding of Gateworks products and Linux based OS operations.

Development Tools

Development can be done on either a Windows or Linux x86 based machine (host). Various references to Mac OS exist for some tools but were untested by Gateworks. You will need to create a TI account through their ​registration page before downloading some of the software listed here. After creating an account you will still need to sign an agreement on each download indicating its intended use.

Gateworks SBC Tools

The mechanism controlling the GW16122 will be a Gateworks SBC (testing was done with a GW5404-E.2). The Gateworks Ubuntu Trusty image is recommended and the instructions will use Ubuntu specific commands.

Some of the TI example projects make use of the Node.js framework in order to create a web interface to control what is referred to as the "collector" which in our case is the GW16122.

Once Ubuntu has been installed and a network connection has been established, complete the following steps to finish initial target configuration:

Since TI apparently only offers the SDK installer in the form of an x86 binary (ventana CPU is arm architecture), you will need to download the installer on a compatible linux machine, run it, and repackage the files for transfer

Software

A quick breakdown of the software running on each piece of hardware in an example network utilizing the GW16122:

Gateworks SBC

Ubuntu Trusty Gateworks Image

node-js (if using web interface)

serial program (if using serial api)

GW16122 Mini-PCIe Card

TiVa TM4C1294NCPDT MCU

boot_loader.bin - TI boot loader firmware

firmware.bin - XDS110 emulation firmware binary

CC1350 MCU

Co-Processor firmware (.out/.hex) - Either a prebuilt TI example or custom firmware designed with CCS

The following subsections detail the various software layers developed by TI for use with the CC1350 which is the main MCU in the GW16122 as well as Code Composer Studio and other general notes.

TI-RTOS RF driver

The RF core has a dedicated driver called the TI-RTOS RF driver, which is used for all interaction with the RF core. If you do not wish to use the EasyLink abstraction layer, there is also the option to do simple packet RX/TX using the TI-RTOS RF driver directly.

Serial Command API

Important Note: Using this API will not work on the default CoProcessor firmware flashed onto the GW16122. This requires the rfEasyLinkNp firmware example as provided in the TI SDK Download (one must compile the binary in Code Composer Studio and flash it to the GW16122)

The serial command API for the CC1350 is implemented in the form of standard AT+ commands that correlate to EasyLink API functions. This serial control method there has an example project provided by the TI resource center. The web page can be found ​here.

You can easily test the AT to Easylink api commands by using two GW16122/SensorTag devices running the rfEasyLinkNp and the rfEasyLinkRx examples.

Typically, one would open the console port using the screen command in Linux like so:

screen /dev/ttyACM0 115200,cs8

Once the console is opened, type AT commands (followed by the enter key to submit the command), example (with responses) shown below:

Texas Instruments Code Composer Studio

Code Composer Studio (CCS) is an IDE based on Eclipse and includes various libraries and software packages required to develop on many TI MCU's, including the CC1350 which is the primary component of the GW16122.

Resource Center

Click Menu item View -> Resource Explorer
Expand software and view SimpleLink CC13x0 SDK as well as Ti-RTOS for CC2650
Drill down to the area you would like to explore
Find an example, then click the download button to download to desktop
Then click the import to IDE to import the project

Building a Project

Once the project is imported, right click on the project title in the explorer window and click 'Build Project' and let it compile. You can also click the debug button to build the project and run it on the connected target. Once it is complete, a binaries folder will be created under the project. Most TI tools will use the .out file that is produced there to program with.

Alternatively you can build projects via command line and avoid the entire IDE if you so desire. See the official TI wiki on ​Command Line Build/Create for more information.

A couple of additional notes when building via command line:

Note that the executable for Linux CCS installations is named "eclipse" and not "eclipsec"
Run with "-ccs.help" to see full list of options
Use full path names for all command line arguments (environment variables useful here)

General Notes

The XDS110 USB debugger referenced by material related to the CC1350 or in CCS is equivalent to the TiVa chip that's on the GW16122

Make sure the GW16122 is properly into the miniPcie->USB adapter board otherwise it will come up as a usb device but fail to be recognized by the code composer software. You can check if its connected properly by opening the .ccxml file under the projects targetConfigs folder and hitting the "test connection" button. If multiple boards are connected at once you will * need to specify them by serial number.

The US frequency allows for a total of 129 channels to choose from, defined in CONFIG_CHANNEL_MASK

You can prevent conflicts of sensor networks by either limiting the channels enabled on each collector/sensor, or by setting the PAN-ID to match on the devices belonging to each * network.

Beware of adding too many channels to your channel mask, for example, adding all of them took well over 20 minutes to complete the channel selection cycle and bring up the network.

Line of sight is extremely significant. Depending on the material, a few obstacles can drastically reduce your maximum range.

General RF information and specific information regarding antenna choice and performance can be found in this ​app note.

UART RX/TX Example

At a high level, this example allows for you to type from a keyboard to an open UART on each side and the data will be sent to the other side.

Using a Windows or Linux desktop/laptop PC, flash this firmware to the GW16122.

Connect the GW16122 to the desired system where you will then open the UART communication.

This example exposes 2 serial ports to the host that the GW16122 is connected to.

Linux Example

/dev/ttyACM0 (use this first UART)

/dev/ttyACM1

Windows Example

COM6 (use this first UART)

COM8

Open the serial port /dev/ttyACM0 on the host using a terminal program of your choice, such as screen / picocom or Putty using 115200 baud rate and turn on local echo.

You can type the data you want to send, but *must* press the 'Enter' key to actually send the data.

Type a message on the console on the TX side, like so:

hi, hello world!

The other end will print the received data with a string like so:

rx data: hi, hello world!

This example code uses the following LEDs on the GW16122:

LED D1 toggles green when it sends

LED D2 toggles red when it receives

The RF is at 500 kbps by default but can be adjusted in the source code.

Programming the CC1350

The CC1350 of the GW16122 can be programmed a number of ways depending on your host machine.

Gateworks has tested both Windows (SmartRF Flash Programmer v2) and Linux (Uniflash) tools but specific instructions will be provided from the Linux perspective. However, the Windows Software may be easier and more reliable to use.

You will need to have installed the software detailed in the Set Up section in order to continue.

The Uniflash tool is linux compatible and has both a gui and command line interface. The gui program has an autodetect feature and is somewhat easier to use but the command line tool has the same functionality and is better suited for repeated tasks with constant configurations.

Note that there doesn't appear to be a way to update the firmware on a running ARM based target. All of the methods we used to program the TiVa and CC1350 MCU's from a x86 host are not compatible with an ARM based system. This means that users will not be able to update firmware on running boards.

GUI Approach

Connect a single GW16122 to the host machine (desktop/laptop) via mini-PCIe to USB adapter.

Open the "Uniflash" application through a gui file manager from the uniflash_4.2 install directory, or via command line:

./uniflash_4.2/node-webkit/nw

Select target device of CC1350F128

Select connection of Texas Instruments XDS110 USB Debug Probe

Click the "Start" button

In the Program tab, select the firmware file you wish to load. This is typically a .out file created via a Code Composer Studio Project and can be found in your workspace directory (default ~/workspace_v7/)

Click the "Load Image" and "Verify Image" buttons and see the text console output on the bottom of the window for a green success message

It should also be mentioned that you can program your GW16122 directly from the Code Composer Studio IDE by creating a proper target configuration and then selecting "Debug". Most of the TI example projects will detail this procedure.

At this point you may want to power cycle your device.

Command Line Approach

Navigate to your uniflash install directory

cd uniflash_4.2

Run the installer providing a configuration and .out file as arguments, for example:

Third Party Software

Thingsquare

​Thingsquare is a software company that offers customized software for the chip on the GW16122, the Ti CC135x. This software allows for the use of a smartphone app to monitor and control sensors through the Thingsquare cloud/backend. A ​REST API is available as well.

A brief description of what is happening in the demo below:

A Gateworks GW16122 is acting as the Thingsquare IoT gateway on the Gateworks SBC

The GW16122 exposes a few serial interfaces (/dev/ttyACM0 and /dev/ttyACM1) which are then used for the SLIP interface

dnsmasq acts as a DNS server for the slip interface

The sl0 uses PTP for the DNS

The SLIP requires some routing and forwarding between interface sl0 and eth0

The firmware on the GW16122 pushes data up to the Thingsquare cloud

The CC1350 Sensor tag is reporting back to the Gateway and pushing it's information up to the cloud