User avatar
johan
GpsGate
Posts: 14919
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

GUIDE: Chat and Job Dispatch using TrackerOne

Thu Jul 07, 2011 12:35 pm

GUIDE: Chat and Job Dispatch using TrackerOne

Install updates

Make sure all plugins are up to date. All listed as "green" under SiteAdmin -> Plugins. For Chat install the "Chat" plugin.

Create Template Commands

1. Go to SiteAdmin -> Devices
2. Select "GpsGate" as protocol.
3. Select "New..." in Commands drop down.
4. Write a name e.g. "MyChat"
5. Write a Template e.g. $FRCMD,,MyChat,,[GarminTime],[ChatText]
6. Set "tcp" as first attempt and "sms" as second attempt.
7. Click "Save"
8. Check "Alias". Select "_SendChatText" in alias drop down.
9. Select the Device Types for which this command should be available.
10. Click "Save Command"

The device type is now enabled for outgoing chat messages, and commands in the format you specified in the Template will be used. A first try will be made using TCP and then fall back on SMS.

The following variables are available in addition to the standard variables.

[GarminTime]
[ChatText]
[UTC]
[ChatTextID]

To send chat to server use $FRCMD,imei,_ReceiveChatText,,chat_text for SMS you can omit "imei".

Text is sent as UTF-8, this means that all ASCII-7 characters are normal, but other characters are multiple bytes. Fields with reserved characters and non-ASCII characters are escaped with {XX}, where XX is the length of the field.

Example of sending "ä" as a chat message:

$FRCMD,imei,_ReceiveChatText,,{2}ä*12

Note that the field containing "ä" is escaped using {2}. "ä" is two bytes in UTF-8 0xc3, 0xa4

ä = 0xc3, 0xa4, ö = 0xc3, 0xb6, ü = 0xc3, 0xbc

Here you have a UTF-8 table http://www.utf8-chartable.de/

For jobs make an alias to _SendStop. The following variables are available:

[Longitude]
[Latitude]
[Text]
[JobID]
[GarminTime]
[UTC]
[Location]
[Destination]
[DestinationLatitude]
[DestinationLongitude]

Test

Now simply test chat in VehicleTracker, and you should have the commands going back and forth.

The "Terminal" is as always useful tool when making integration work:
topic.asp?TOPIC_ID=10740

Related topics in the forum created by users working with Chat/Dispatch integration:
topic.asp?TOPIC_ID=14557

Regards,
Johan

GpsGate Support

User avatar
johan
GpsGate
Posts: 14919
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: GUIDE: Chat and Job Dispatch using TrackerOne

Thu Jun 21, 2012 9:34 pm

Chat with ACK

This guide describes how to implement chat to a custom device/client using Template Commands over TCP with ACK from the device. The command will be sent from the server immediately if the device/client is online. Otherwise the command will be sent next time the device/client connects.

Make sure all plugins are up to date. All listed as "green" under SiteAdmin -> Plugins. For Chat install the "Chat" plugin.

Create Template Command

1. Go to SiteAdmin -> Devices
2. Select "GpsGate" as protocol.
3. Select "New..." in Commands drop down.
4. Write a name e.g. "MyChat"
5. Leave Template empty!
6. Set "tcp" as first attempt and "No second attempt" as second attempt.
7. Click "Save"

8. Click "Add Step"
9. Write a Template e.g. $FRCMD,[DeviceImei],MyChat,,[ChatText][0x0d][0x0a]
10. Set "tcp" as first attempt and "No second attempt" as second attempt.
11. Click "Show Advanced Settings ->"
12. Select "Device response must match regular expression pattern:"
13. Enter e.g. "MyChat"
14. Click "Save"

15. Check "Alias". Select "_SendChatText" in alias drop down.
16. Select the Device Types for which this command should be available.
17. Click "Save Command"

[0x0d][0x0a] adds a CR + LF at the end

Now please enable Chat in a VehicleTracker application and start testing. The command will be sent from the server immediately if the device/client is online. Otherwise the command will be sent next time the device/client connects.

The chat message will be pending, you will see a wait symbol, until the message is ACKed by the device/client.

Send back e.g. "$FRRET,imei,MyChat\r\n" to ACK the command. Where "imei" is the IMEI of the device and "\r\n" is CR + LF, 0x0D, 0x0A hex.


The "Terminal" is as always useful tool when making integration work:
topic.asp?TOPIC_ID=10740

Regards,
Johan

GpsGate Support

wiebej
Posts: 58
Joined: Sun Nov 14, 2010 4:15 am

RE: GUIDE: Chat and Job Dispatch using TrackerOne

Tue Feb 25, 2014 8:37 am

I have a new app for Android that implements the Chat Plugin.

https://play.google.com/store/apps/deta ... psgatechat

Check it out and leave feedback.

Thank you
John

Return to “GpsGate for Developers”