Globalsat TR-151 Setup Manual

Protocol adapter
Hide thumbs Also See for TR-151:

Advertisement

Quick Links

GlobalSat TR-151 Protocol Adapter
SDK Setup Guide
Version 1.0

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TR-151 and is the answer not in the manual?

Questions and answers

Summary of Contents for Globalsat TR-151

  • Page 1 GlobalSat TR-151 Protocol Adapter SDK Setup Guide Version 1.0...
  • Page 2: Table Of Contents

    GlobalSat TR-151 – Protocol Adapter SDK Setup Guide Introduction .............................. 2 About the Protocol Adapter SDK ...................... 2 About GlobalSat TR-151 ........................... 3 Installation .............................. 3 Prerequisite: Installing the GlobalSat Configuration Tool and Drivers ............ 3 Configuration and Setup .......................... 3 Configuring the GlobalSat device ...................... 3 Configuring the Protocol Adapter ...................... 5 Running the Protocol Adapter SDK ...................... 6 Troubleshooting ............................ 8 Compatibility .............................. 9...
  • Page 3: Introduction

    GlobalSat TR-151 – Protocol Adapter SDK Setup Guide Introduction About the Protocol Adapter SDK The Internet of Things is a rapidly-growing and oftentimes fragmented network of devices which frequently don’t unify under a standardized “language” which connects them easily to each other. There exist many examples of devices which may be perfectly suited to reporting data in a specialized role, but for which their data reporting is shrouded in a proprietary format. When the ThingWorx platform needs to connect to one of these devices, the need for a translator, or Protocol Adapter, arises. The Protocol Adapter SDK is a package provided by ThingWorx for the purposes of connecting such a device, whose firmware and/or data format is unchangeable and incompatible with ThingWorx, to the ThingWorx Platform: Normal Data- ThingWorx Reporting Websocket Platform Device Proprietary Codec ThingWorx Data-Reporting Websocket (translator) Platform Device Often, these devices open a TCP or UDP networking socket and send data using a proprietary format. To allow these devices to connect to the ThingWorx Platform, the Protocol Adapter SDK runs intermediary to the device and ThingWorx, and listens on a specified port for any incoming device messages, and it parses the incoming messages from the device’s native format into properties that are then transmitted to the ThingWorx Platform. It should be noted that the Protocol Adapter SDK should ideally be set up to run on an intermediary server, separate from the one on which the ThingWorx Platform is located (for scalability purposes). However, the Protocol Adapter SDK may also be run on the same server on which the ThingWorx Platform is located.
  • Page 4: About Globalsat Tr-151

    GlobalSat TR-151 – Protocol Adapter SDK Setup Guide data reporting device, with minimal design requirements on the part of the user. It provides an “always- on” connection to the platform, and it opens a local web server that interacts with the REST API available on the platform. About GlobalSat TR-151 The device – GlobalSat TR-151 – is a real-time tracking device for personal/vehicle applications using GPS and GSM technology. The device is capable of sending SMS and GPRS messages that constitute the GPS coordinates of the device, the IMEI number of the device, time, date, etc. The device has an SOS button that sends the GPS coordinates of the device to numbers that are registered on the device configuration tool for SOS updates, and runs on a rechargeable battery for truly mobile operations. The configuration tool is compatible with windows platforms. This guide will follow the steps in configuring the GlobalSAT TR-151 device to report data to a ThingWorx server via the Protocol Adapter SDK. The Protocol Adapter SDK allows only for one-way communication in this case. Installation The Protocol Adapter SDK, for the purposes of this guide, should run on the same AWS server/local machine that runs the Thingworx platform. Please note that this guide was written for a computer running Microsoft Windows. Refer to the Troubleshooting section of this guide for help with frequently asked questions. Prerequisite: Installing the GlobalSat Configuration Tool and Drivers Use the following link to download Configuration tool v1.8 and the newest version of firmware for the GlobalSat device. You may also be required to install USB drivers for the device if Windows does not automatically do so when you connect your device. http://www.globalsat.com.tw/products- page.php?menu=2&gs_en_product_id=3&gs_en_product_cnt_id=24&img_id=53&product_cnt_folder Extract the “TR151 User tool.exe” executable to a suitable location on the computer which will be connected to the TR151 device. Configuration and Setup Configuring the GlobalSat device Remove the battery from the back of the TR-151 device. Following the instructions...
  • Page 5 GlobalSat TR-151 – Protocol Adapter SDK Setup Guide in the user guide, toggle the DIP switches so that they are in the following positions: Switches 1,2, and 3 should be switched ON (up) for setup. Following this, insert a valid and activated SIM card into the SIM card slot. Connect the device to your computer via USB cable without connecting the battery. The “Warning” LED on the side should illuminate solid red. Open the GlobalSat Config tool and scan your computer’s COM port. It should open the COM port. Before you begin configuration, ensure that you have updated the firmware of your device. Follow the guide for this device to update the Firmware, available on GlobalSAT’s website. Click the “Start” button to begin configuring. After a few moments, the tool should report the IMEI number of the device. When it becomes available, click the “Setting” button. The configuration of the device should look like image on the right. The GPRS server hostname should be set to the public IP address of the server/local machine running ThingWorx. Open Command Prompt in windows and use the “ipconfig” command to find the public IP of your computer. If you are hosting the Protocol Adapter on an AWS...
  • Page 6: Configuring The Protocol Adapter

    GlobalSat TR-151 – Protocol Adapter SDK Setup Guide listening for incoming connections on this port. Finally, confirm that your device’s “Default Report Mode” is set to “GPRS period report: mode 9” as shown in the screenshot. After entering your configuration details, Click on “Set to Device” to ensure that the device is configured. When you have finished, click “Exit” and then “Stop” to close the configuration tool. When the configuration has completed, unplug the device from the computer. Reset the DIP switch 3 to OFF mode. Connect the battery, and connect the USB cable from the computer to the device, and power it on. Configuring the Protocol Adapter 1. Included in the starter kit for the TR-151 Protocol Adapter SDK package, you’ll find a file labeled “config.json” in the root level of the GlobalSat.zip package. Open this file for editing with a text editor. In config.json, change the value of socketPort under ConnectionServerSettings to 5000 (or the port value specified in the configuration tool previously). The Protocol Adapter will be listening on this port. Remember that the GPRS port for the device is the same.
  • Page 7: Running The Protocol Adapter Sdk

    GlobalSat TR-151 – Protocol Adapter SDK Setup Guide 2. In config.json, change the thingworxServerAPIKey to an Application Key currently being used by your Thingworx application. Set the thingworxServer and thingworxServerPort to the IP address and port number, respectively, of the machine that is running the Thingworx platform. Your configuration should resemble the image on the right. The socketPort is set to 5000 which should be the same as the port assigned for configuring the GlobalSat GPRS port. Running the Protocol Adapter SDK Before running the Protocol Adapter SDK, make sure that the Thingworx application is running on the referenced port and server address. Make sure that the GlobalSat device is plugged in, switched ON, and it is located in an area with clear GPS signal (such as a window or outside area). 1 Using Eclipse IDE: Import the project into the eclipse workspace. File->Import- >Java->Existing Projects… -> browse to the folder containing the project. Note: Create a new Java Project in your IDE if necessary before importing. 2 Build a “Runnable JAR” file using File > Export > Runnable JAR File, and run it from command line (alternatively, run within Eclipse IDE) using the command: Java –jar <jar-filename>.jar 3 While the program is running, you should see a series of output messages, beginning with a successful connection message, and including an “Accepted client connection…” message indicating that the Protocol Adapter is...
  • Page 8 GlobalSat TR-151 – Protocol Adapter SDK Setup Guide If you do not receive these messages in the log, verify that the connection settings on both your TR-151 Device and in the config.json files are correct. In addition, verify that the specified listener port is “open” on your server and that no firewalls are blocking a connection. 4 When your Protocol Adapter listener successfully receives a connection from the GlobalSAT device, it should automatically create a remote thing on your ThingWorx instance, to which you may bind a Remote Thing entity on the platform and add data bindings. Data forwarded from the Protocol Adapter will be visible under “Manage Remote Bindings” on a Remote Thing entity in ThingWorx which carries the same name/identifier as that created by the Protocol Adapter on the platform. Above: Successful data reporting from the Protocol Adapter to the Thingworx platform. Note the value of “isConnected” is set to “True”.
  • Page 9: Troubleshooting

    SSL disabled. While the GlobalSat is running and reporting The GlobalSat device is not able to connect to the Protocol Adapter SDK. data to the server, the Protocol Adapter SDK is Check the GlobalSat settings and make sure that it is similar to the merely stating the following debug message: picture in the configuration section.
  • Page 10: Compatibility

    GlobalSat device messages). Ensure that the GlobalSat device is kept somewhere outside building. Use a SSH client such as PuTTy to connect to the GlobalSat device via usb and verify that it is sending data and has a GPS and cellular signal.
  • Page 11: Document Revision History

    GlobalSat TR-151 – Protocol Adapter SDK Setup Guide Document Revision History Revision Date Version Description of Change September 1, 2015 1.0 Initial Release...

Table of Contents