Custom device integration with Asset Protection

You now have the possibility to integrate more devices to work with Asset Protection. You have full control over device configuration so it will fit your business needs perfectly!


Introduction

This blog post is related to the Asset Protection feature. Read more about it here:

Asset Protection blog post
Start your Asset Protection business today

You can now make custom device integration with Asset Protection! This opens up the possibility to tailor the device configuration to suit your intended usage. First please make sure that the device and server meets the requirements before you begin integration.

Requirements

Device requirements

  • - Supports setting a geofence on the tracking device.
  • - The device should alert when it leaves the geofence.
  • - Recommended: A device with long battery life or support for an external power source.

Server requirements

  • - A working SMS provider set up on the server to be able to send commands to the tracking device.
How to integrate

To integrate a new device you need to complete three steps that are shown below. Each step is explained in detail further down.

  1. Create a new instance of the device type you want to use.
  2. Map the geofence left alert signal from the device to a GpsGate Server variable
  3. Create four (4) new template commands.
    • APSetup
    • APRefresh
    • APLock
    • APUnlock

The required steps are explained in detail below.


1. Create new device instance

To avoid changing your original device mapper you will create a new one specific for Asset Protection.

  1. Go to SiteAdmin -> Devices tab -> Types in the left menu.
  2. Select the Device Type you want to integrate.
  3. In the Instance section, click on New.
  4. Change the name of the Instance. Recommended naming convention is to keep the instance name and add “AP” to the end. “AP” is short for Asset Protection.
    Example: Original Instance name is GL500, you should call your new Instance GL500 AP.
  5. Save your new Device Instance.


(Click image to enlarge)


The instance name you choose here is the name you will use in the CSV file you need to import later.


2. Map geofence left signal

When the device leaves a set geofence it will alert GpsGate Server. This signal needs to be mapped to a GpsGate Server internal variable.

  1. Go to SiteAdmin -> Devices tab -> Types in the left menu.
  2. Select your newly created device instance.
  3. Click on Display Mapper Template under Meta Fields section.
  4. In the Device Mapper Template section, map the alert Input from the device to the “Left GEO fence” variable.

Tip! If your device does not have a input for geofence alert you can add your own script to determine when the alert should trigger. Below is a general script example for inspiration.


(Click image to enlarge)


3. Create template commands

The mobile app will send commands to control the device. You are free to configure your device to fit your needs but there are a few things that are necessary. We describe the requirements in this section.

Note! The name of the commands is important. If you do not name the commands as described in this guide they will not work with Asset Protection.

Note! For all commands below you should make the first step in the command use SMS as First Attempt to make communication with the device more reliable.

Each command step should also include a regular expression pattern that the device must respond with before the command will move to the next step. The image below shows an example of a regular expression pattern that can be used for Queclink GL500/GL505 for the APSetup command.


(Click image to enlarge)

Go to SiteAdmin -> Devices tab -> Commands -> Select your device protocol -> Click New command.

Add the following commands:

APSetup

This command should set up your device to communicate with your GpsGate Server, set the report interval, etc.

Name: APSetup
Alias: Unchecked
Rights: No
Queueable: Yes
Device Types: Select the new device type that you created in step one of this blog.
Add command steps that does the following:

- Set the device to “continous mode” and and make sure it can receive SMS. If you put the device in deep sleep you will not be able to use the app as intended because it has to wait before the device receives the commands.
- It is recommended to set up the device to respond on TCP to limit the number of SMS sent.
- The last step of this command should request the current position of the device.

Note! Always set the first step to have SMS as First attempt. This makes communication with the device more reliable.

Here is an example of an APSetup command for the Queclink GL500/GL505 device


(Click image to enlarge)

APRefresh

This command should request the current position of the device.

Name: APRefresh
Alias: Unchecked
Rights: No
Queueable: Yes
Device Types: Select the new device type that you created in step one of this blog.

Add command steps that does the following:
- Request the current position from the device.

Note! Always set the first step to have SMS as First attempt. This makes communication with the device more reliable.

APLock

This command should set a geofence on the device current position.

Name: APLock
Alias: Unchecked
Rights: No
Queueable: Yes
Device Types: Select the new device type that you created in step one of this blog.

Add command steps that does the following:
- Set a geofence on the device and make device alert when it leaves the geofence. Set radius to 100 meters.

Note! Always set the first step to have SMS as First attempt. This makes communication with the device more reliable.

APUnlock

This command should remove/deactivate the geofence on the device.

Name: APUnlock
Alias: Unchecked
Rights: No
Queueable: Yes
Device Types: Select the new device type that you created in step one of this blog.

Add command steps that does the following:
- Remove/deactivate the geofence set on the device.

Note! Always set the first step to have SMS as First attempt. This makes communication with the device more reliable.

Testing

Now you are done with the set up and it is time to test the integration.

  1. Add a test device to a VehicleTracker application with the same device type as you created in step 1 of this guide.
  2. Open up the Terminal window for that device. This is done by right clicking it in the Vehicles panel and then clicking Terminal.
  3. Select the APSetup command that you created and send it to the device.
  4. Verify that the device responds to the command and that all of the command steps complete.
  5. For additional verification you can physically connect the device and read the device configuration to see if it received the settings properly.
  6. When the APSetup command is working, you can start to test the rest of the commands with the mobile application.
  7. Remove the device from the application (you can’t add it with the mobile app if it is already on the server).

Continue with the Asset Protection blog post for the next steps.

When you have your QR code ready, use the Asset Protection mobile application to scan it. This will create a new application on your server and add the device to it. Now use the mobile application to test the Refresh, Lock and Unlock functionality. You can use the Queue Viewer in SiteAdmin -> System Tools tab -> to see if the commands are sent to the device properly.


(Click image to enlarge)

 


  Discuss this blog post on the forum please



Download free GpsGate Server

Install it on your own server. The installation is free for 5 users.

Download Now