Daviscomms MTD2000 Installation instructions

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 1 /105
AT Command Guide
Mobile Tracking Device
MTD2000
Revision 12
1 Jun 2010

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 2 /105
Revision History
Rev
Date Author Description
01 02-Sep-08 CF Chan Initial release.
02 1-Dec-08 CF Chan 1. Add repeat command, event debug command.
2. Revise standard report format.
3. Revise the setting list in $SC.
4. Rename $NR to $NA since $NR is used for NMEA.
5. Add the maximum length for IP address.
03 30-Apr-09 CF Chan 1. Added panic button and counter command.
2. Added RS232 interface mode command.
3. Added GPS data flag in the event table.
4. Added host name constraints for TCP/IP address.
5. Revised GSM LED definition to follow MC55i.
6. Revised memory logging to overwrite memory data when
memory is full.
7. Revised memory dump to keep the unsent data in the
memory.
8. Revised $EV to support 5 conditions, 10 commands, 250
chars maximum length.
9. Revised the ADC conversion algorithm for external power
and battery power.
10. Removed $NA as heartbeat message is not ready.
11. Removed $PI as debouncing is done via hardware mean.
12. Removed $PO as $OUT will serve the same purpose.
04 08-May-09 CF Chan 1. Revised standard report format to shorten the total length
including device ID to less then 90 chars.
2. Removed ‘;’ as the command terminator for commands
sent via SMS and TCP channel.
05 12-Jun-09 CF Chan 1. Added $ACC for harsh acceleration detection.
2. Added $DEC for harsh deceleration detection.
3. Added $DB to set the data memory size.
4. Revised the default port configuration to 8 input ports.
5. Revised $SS command to place individual GSM/GPS
module to sleep.
6. Revised ADC reference voltage to 3.3V in $XE and $XB
command.
06 03-Jul-09 CF Chan 1. Added $NU to support UDP channel.
2. Added $CR to support cell ID.
07 20-Jul-09 CF Chan 1. Added $ND command for DNS server address.
2. Added watchdog timer to prevent firmware lockup.
3. Monitor and reset GSM and GPS module if it stops
responding.
4. Terminate command response with carriage return and
line feed for TCP channel.

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 3 /105
07A 31-Jul-09 CF Chan 1. Revised default data buffer to 300 reports.
08 01-Aug-09 CF Chan 1. Added $MS and $MC for mileage counter.
2. Added GPS antenna detection.
3. Added error code 2303 to indicate failure to send report via
SMS.
09 16-Sep-09 CF Chan 1. Increase APN length to 40 characters in $NG command.
2. Increase watchdog timeout to 65 seconds.
3. Revised SMS recipient in $EI to single SMS number.
4. Revised minimum report interval in $CR to 5 sec.
10 02-Oct-09 CF Chan 1. Added a System Overview section.
2. Added $SIM for dual SIM card.
3. Added GSM/GPRS commands pass through.
4. Removed the support of the following characters (text
message, report, etc) which are not in the default GSM
character set: [ \ ] ^ _ ` { | } ~
10A 10-Mar-10 CF Chan 1. Added $LB for low battery shutdown.
2. Revised interval of data log to 60 sec and above.
3. Revised the maximum length of AT command and event
to 120 characters.
11 17-May-10 CF Chan 1. Added $GF and $GS for geo fence.
2. Added $AI and $AO for analog input and output.
3. Added $FSD and $FSO for fail safe output.
4. Added $MD for motion sensor sensitivity.
5. Added $DI for driver ID.
6. Added $OS for over speed detection.
7. Added $KR for key on reset.
8. Added $GM for GSM modem.
9. Added $SU for over the air firmware upgrade.
10. Added $CV for voice call and silent call.
11. Added $CA for auto answer incoming call.
12. Added $CS for MIC gain and speaker volume.
13. Added $GC and $GA for dead reckoning calibration.
14. Added $BC for battery charging control.
15. Added hardware watchdog timer.
16. Added test mode for peripheral test.
17. Support 5000 reports for data logging.
18. Removed $LB for low battery shutdown.
19. Revised the maximum length of AT command and event
to 150 characters.
12 1-Jun-10 Kyle Hor 1. Updated system code 2105 to include possibility that no
battery is present.
2. Added precaution not to send $SR via SMS at less than
10sec interval.
3. Added $MZ for motion detect calibration and modified
calibration mode not to be unique to gyroscope only.
4. $MD accuracy range and default value changed.

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 4 /105
Table of Contents
1Introduction ........................................................................................................................7
2Features Summary.............................................................................................................8
3System Overview.............................................................................................................10
3.1 End-User-Based Reporting (SMS)............................................................................10
3.2 Server-Based Reporting (SMS) ................................................................................11
3.3 Server-Based Reporting (TCP/UDP Socket).............................................................11
4AT Command Syntax.......................................................................................................12
4.1 AT Command............................................................................................................12
4.2 Write Command........................................................................................................13
4.3 Query Command.......................................................................................................13
4.3.1 Single Index Command......................................................................................13
4.3.2 Multiple Index Command...................................................................................13
4.4 Execution Command.................................................................................................14
4.5 Command Response ................................................................................................14
4.5.1 Normal Response..............................................................................................14
4.5.2 Unsolicited Response........................................................................................15
4.6 Command Interface ..................................................................................................15
5System Code....................................................................................................................16
5.1 MTD System Code....................................................................................................16
5.2 GSM System Code ...................................................................................................16
5.3 GPS System Code....................................................................................................17
6LED Indication..................................................................................................................18
6.1 Charging LED ...........................................................................................................18
6.2 GSM LED..................................................................................................................18
6.3 GPS LED ..................................................................................................................18
7Basic Command...............................................................................................................19
7.1 Command Mode – AT...............................................................................................19
7.2 Repeat Last Command – A/......................................................................................19
8System Command............................................................................................................21
8.1 System Version – AT$SV..........................................................................................21
8.2 System Identity – AT$SI............................................................................................21
8.3 System Default – AT$SD..........................................................................................22
8.4 System Configuration – AT$SC................................................................................23
8.5 System Reset – AT$ST ............................................................................................24
8.6 System Sleep – AT$SS ............................................................................................25
8.7 System Upgrade – AT$SU........................................................................................25
8.8 System Boot Mode – AT$SB ....................................................................................27
8.9 Error and Status Indication – AT$EI..........................................................................28
9SMS Command................................................................................................................29
9.1 SMS/Call Number List – $SL ....................................................................................29
10 Network Command.......................................................................................................31
10.1 TCP/IP Address List – AT$NT ..................................................................................31
10.2 UDP/IP Address List – AT$NU..................................................................................32
10.3 GPRS Profile List – AT$NG......................................................................................33
10.4 DNS Server Address – AT$ND.................................................................................34

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 5 /105
10.5 Network Connection – AT$NC..................................................................................35
11 Text Message Command .............................................................................................39
11.1 Text Message List – AT$TL......................................................................................39
11.2 Text Message – AT$TM............................................................................................40
12 Location Report Command...........................................................................................42
12.1 Standard Report – AT$SR........................................................................................42
12.2 NMEA Report – AT$NR............................................................................................47
12.3 Cell ID Report – AT$CR............................................................................................48
13 Data Log Command .....................................................................................................52
13.1 Data Buffer – AT$DB ................................................................................................52
13.2 Data Dump – AT$DD................................................................................................52
13.3 Data Clear – AT$DC.................................................................................................53
14 Call Command..............................................................................................................55
14.1 Originate Call – AT$CV.............................................................................................55
14.2 Auto Answer – AT$CA..............................................................................................56
14.3 Speaker Volume and MIC Gain – AT$CS.................................................................56
15 Geo Fence Command ..................................................................................................58
15.1 Geo Fence – AT$GF.................................................................................................58
15.2 Geo Fence Status – AT$GS .....................................................................................59
16 Speed and Mileage Command.....................................................................................61
16.1 Over Speed Detection – AT$OS...............................................................................61
16.2 Harsh Acceleration – AT$ACC..................................................................................62
16.3 Harsh Deceleration – AT$DEC.................................................................................62
16.4 Mileage Setting – AT$MS .........................................................................................63
16.5 Mileage Counter – AT$MC........................................................................................64
17 Dead Reckoning...........................................................................................................66
17.1 Gyro Calibration – AT$GC........................................................................................66
17.2 Dead Reckoning Calibration Accuracy – AT$GA......................................................67
18 Digital IO Command.....................................................................................................68
18.1 Port Configuration – AT$PC......................................................................................68
18.2 Output Port Default – AT$PD....................................................................................69
18.3 Port Status – AT$PS.................................................................................................70
18.4 Input Port – AT$IN ....................................................................................................71
18.5 Output Port – AT$OUT .............................................................................................71
19 Analog IO Command....................................................................................................73
19.1 Analog Input Port – AT$AI ........................................................................................73
19.2 Analog Output Port – AT$AO....................................................................................74
20 Fail Safe Output Command..........................................................................................75
20.1 Fail Safe Output Default – AT$FSD..........................................................................75
20.2 Fail Safe Output – AT$FSO......................................................................................76
21 Peripherals Command..................................................................................................77
21.1 Driver ID – AT$DI......................................................................................................77
21.2 Dual SIM – AT$SIM ..................................................................................................77
21.3 Panic Button – AT$PB ..............................................................................................78
21.4 Key On Reset – AT$KR............................................................................................79
21.5 Battery Charging – AT$BC........................................................................................80
21.6 Motion Detection Calibration – AT$MZ .....................................................................81
21.7 Motion Detection Sensitivity – AT$MD......................................................................82

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 6 /105
21.8 GSM Modem – AT$GM.............................................................................................82
21.9 UART Control – AT$UM............................................................................................83
22 Power Status Command...............................................................................................85
22.1 External Power Status – AT$XE...............................................................................85
22.2 Battery Power Status – AT$XB.................................................................................86
23 Timer and Counter Command......................................................................................88
23.1 Timer – AT$FT..........................................................................................................88
23.2 Counter – AT$FC......................................................................................................89
24 Event Command...........................................................................................................92
24.1 Event Table...............................................................................................................92
24.2 Event – $EV..............................................................................................................93
25 Miscellaneous Functions ..............................................................................................96
25.1 GSM Monitoring........................................................................................................96
25.2 GPS Monitoring.........................................................................................................96
25.3 GPS Antenna Detection............................................................................................96
25.4 Low Battery Shutdown..............................................................................................96
25.5 Watchdog Timer........................................................................................................97
25.6 Firmware Upgrade....................................................................................................97
25.7 Test Mode.................................................................................................................97
26 Appendix ......................................................................................................................98
26.1 NMEA Messages......................................................................................................98
26.1.1 GLL – Geographic Position (Latitude / Longitude).............................................98
26.1.2 GGA – Global Positioning System Fix Data.......................................................99
26.1.3 GSA – DOP and Active Satellites ......................................................................99
26.1.4 GSV – Satellites in View..................................................................................100
26.1.5 VTG – Course Over Ground and Ground Speed.............................................101
26.1.6 RMC – Recommended Minimum Specific GNSS Data....................................101
26.1.7 ZDA – Time and Date......................................................................................102
26.2 TCP Connection Setup ...........................................................................................104
26.2.1 Connecting from MTD to TCP Server..............................................................104
26.2.2 Disconnecting TCP Server from MTD..............................................................104
26.3 UDP Connection Setup...........................................................................................105
26.3.1 Connecting from MTD to UDP Server..............................................................105
26.3.2 Disconnecting UDP Server from MTD .............................................................105

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 7 /105
1 Introduction
This document defines the AT commands used for interfacing between a host
application and the MTD2000. The MTD2000 comes with a built-in event driven engine
which allow user to define the events for different applications.

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 8 /105
2 Features Summary
MTD2000 supports the following features:
1. LED
•Red LED for charging indication
•Green LED for GSM status indication
•Yellow LED for GPS status indication
2. Configuration
•Programmable unit ID
•5 battery power monitor
•5 external power monitor
•10 programmable SMS numbers
•10 programmable TCP/IP addresses
•10 programmable UDP/IP addresses
•10 programmable GPRS profiles
•10 programmable timers
•10 programmable counters
•20 geographical fences
•20 text messages
•20 user defined events
3. Message and Report
•User defined text message
•NMEA 0183 report (GLL, GGA, GSA, etc)
•Standard report (location, IO and system status, etc)
•Cell ID report (cell ID of serving cell and neighbor cells)
•Data logging of up to 300 / 5000 standard reports
4. Speed and Mileage
•Mileage counter
•Over speed detection
•Harsh acceleration / deceleration detection
5. Digital IO Port
•4 digital input ports
•4 programmable digital input / output ports

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 9 /105
•1 fail safe output port
6. Analog IO Port
•1 analog input port
•1 analog output port
7. Power Monitor
•Backup battery low power detection
•External power source low power detection
8. Data and Configuration
•Configure device via serial port, SMS and TCP/UDP channel
•Receive data via serial port, SMS and TCP/UDP channel
9. Firmware Upgrade
•Firmware upgrade via serial port
•Over the air firmware upgrade
10. General
•Driver ID
•Panic button
•Key on reset
•Dead reckoning
•Motion detection with programmable sensitivity
•Dual SIM cards for SIM fail switchover and border crossing
•GSM/GPRS command pass through
•GPS external antenna tamper sensing
•Support DNS for server PC with dynamic IP address
•Watchdog timer to prevent unit lockup
•Low battery shutdown
•Turn of battery charging when external voltage drops below a designated threshold
•Function as GSM/GPRS modem

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 10 /105
3 System Overview
3.1 End-User-Based Reporting (SMS)
The device can be configured to send reports or text messages in SMS to mobile phones as
illustrated below:
GSM/GPRS network
SMS Messages

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 11 /105
3.2 Server-Based Reporting (SMS)
The device can be configured to send reports in SMS to the server (with GSM Modem) as
illustrated below:
3.3 Server-Based Reporting (TCP/UDP Socket)
The device can be configured to send reports via TCP Socket to the server as illustrated
below:
GSM/GPRS
network
Application
Server
GSM Modem
SMS messages
Tracking Units
GSM/GPRS
network
Internet
Application
Server
TCP/UDP Socket

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 12 /105
4 AT Command Syntax
The MTD AT commands are accessible via serial port, SMS and TCP / UDP channel.
The maximum length of AT commands including the overhead is 120 characters. The
default settings of serial port are as follows: 115200 bps, 8 data bits, no parity bit, 1 stop
bit, hardware flow control. Upon power, the device will send out “MTD2000 READY” to
the serial port using the serial port setting.
The MTD AT command has the prefix of “AT$” or “at$” and is not case sensitive in both
the command and the parameters.
Note 1:
All settings via MTD AT commands (command with prefix “AT$”) are saved into the
flash at the point of entry.
Note 2:
The native GSM/GPRS AT commands (command with prefix “AT+” and “AT^”) will be
routed to the GSM module for handling and the corresponding response will be sent
back to the host via serial port. The GSM/GPRS AT commands are only available via
serial port.
4.1 AT Command
Serial Port
The "AT" or "at" prefix must be set at the beginning of each command line. To terminate
a command line enter <CR><LF>. Commands are usually followed by a response that
includes "<CR><LF><response><CR><LF>". Throughout this document, only the
responses are presented, <CR><LF> are omitted intentionally.
Single AT command can be sent to the device via serial port using the following format:
Syntax Example
<AT$Command><CR><LF>
AT$SV
SMS and TCP / UDP Channel
Single AT command can be sent to the device via SMS and TCP / UDP channel using
the following format without the “AT” or “at” prefix:
Syntax Example
<$Command> $SV

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 13 /105
4.2 Write Command
The write command is used to set the parameters in an AT command.
Command Response
AT$ABC=<parameter 1>,…,<parameter N>
OK
Other responses (if any)
4.3 Query Command
The query command is used to query the current setting of an AT command.
4.3.1
Single Index Command
Single index command is referred to the command that holds only one element (e.g.
AT$PC, port configuration). The following query command is used to query the current
setting of a single index AT command.
Command Response
AT$ABC?
OK
$ABC: <Parameter 1>,…,<Parameter N>
4.3.2
Multiple Index Command
Multiple index command is referred to the command that holds multiple elements (e.g.
AT$SL, SMS number list).
Query Individual Setting
The following query command is used to query the current setting of an element in a
multi index AT command.
Command Response
AT$ABC=<Index>
OK
$ABC: <Index>,<Parameter 1>,…,<Parameter N>
Query All Setting

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 14 /105
The following query command is used to query the current setting of all the elements in
a multi index AT command. The query all setting is not accessible via SMS due to large
amount of data.
If the user is trying to query all settings via SMS, the device will send out an unsolicited
response to indicate settings retrieval not allowed.
Command Response
AT$ABC?
OK
$ABC: 1,<Parameter 1>,…,<Parameter N>
…
$ABC: M,<Parameter 1>,…,<Parameter N>
4.4 Execution Command
The execution command is used to execute an AT command.
Command Response
AT$ABC
OK
Other responses (if any)
4.5 Command Response
4.5.1
Normal Response
For any command sent to the device, it will respond with either “OK” or “ERROR”. If
there is no syntax error in the command and all the parameters are correct, the device
will respond with “OK”, followed by the result (if any) after command execution.
Otherwise, the device will respond with “ERROR” and will not execute the command.
The command response (e.g. standard report) will be terminated by carriage return and
line feed (<CR><LF>) if the channel is serial port or TCP channel (no carriage return
and line feed for SMS channel).
Syntax Example
<CR><LF>OK<CR><LF>
Note: Successful response.
OK
<CR><LF>ERROR<CR><LF
Note: Failure response.
ERROR
<CR><LF><$Command>: <Parameter 1>,…,<Parameter n> $SL: 1,”91234567”

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 15 /105
<CR><LF>
Note: Response without device ID.
<CR><LF><$Command>: <Parameter 1>,…,<Parameter n>;
<Device ID><CR><LF>
Note: Response with device ID.
$SL: 1,”91234567”;ABC1234D
4.5.2
Unsolicited Response
When the device is unable to execute the command successfully or has status update,
it will send out unsolicited response for error and status indication via the selected
channels (serial port, SMS or TCP / UDP channel).
The unsolicited response will be terminated by carriage return and line feed
(<CR><LF>) if the channel is serial port or TCP channel (no carriage return and line
feed for SMS channel).
For example, if the user is trying to establish another TCP / UDP connection without
closing the existing TCP / UDP connection first, the device will send out an unsolicited
response to indicate network connection not allowed.
Syntax Example
<CR><LF>$MTD: <System Code><CR><LF>
$MTD: 5201
4.6 Command Interface
The command can be sent to the device via:
1. RS232 Serial Port
2. Over the air via SMS (GSM)
3. Over the air via TCP / UDP channel (GPRS)
Notes:
Only MTD2000 AT commands (command with prefix “AT$”) are allowed in SMS and
TCP / UDP channel.

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 16 /105
5 System Code
5.1 MTD System Code
Data Dump
1001 Data dump started
1002 Data dump completed
1003 No logged data in the memory
1004 Data dump not allowed while logging is in progress
AT Command
2001 Command input buffer is full
2002 Invalid command
2003 Invalid parameter
General
2101 Memory full for data log
2102 Data dump stopped due to communication link down
2103 Not allow to retrieve all settings via SMS due to large amount of data
2104 Device shutdown due to low battery
2105 Stop battery charging due to low external voltage or no battery connected
2106 Resume battery charging when low external voltage goes up
Input / Output
2201 Invalid input port
2202 Invalid output port
Send Report
2301 Network channel is not established to send report
2302 SMS number is not defined to send report
2303
Fail to send report via SMS
Network Connection
2401 New network connection not allowed until the existing connection is closed
2402 Network disconnection not allowed while data dump is in progress
OTA Firmware Upgrade
2501 Download complete and upgrade start
2502 Fail to download
2503 Invalid GPRS profile
2504 Invalid FTP URL
2505 Invalid user name
2506 Invalid user password
2507 Invalid image
5.2 GSM System Code
5000 GSM is in sleep mode
5001 GSM bearer connection failed
5002 GSM is not registered
5101 GPRS bearer connection failed

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 17 /105
5201 TCP / UDP channel establishment failed
5202 TCP / UDP channel connected
5203 TCP / UDP channel disconnected by remote (via SMS or TCP / UDP channel)
5204 TCP / UDP channel disconnected by local (via serial port or event)
5.3 GPS System Code
6001 GPS is in sleep mode
6002 GPS is not operational
6003 Calibration not supported
6004 Dead reckoning failed
6005 Calibration entry
6006 Calibration exit
6007 Motion Detect failed

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 18 /105
6 LED Indication
6.1 Charging LED
Charging status is indicated by a red LED as follows:
1. Red LED On
•Charging of Li-ion battery is in progress.
2. Red LED Off
•Charging of Li-ion battery is completed.
6.2 GSM LED
GSM status is indicated by a green LED as follows:
1. Green LED Blinking
•Fast Blink (600 ms on / 600ms off)
No SIM card inserted or network search in progress.
•Slow Blink (75 ms on / 3 s off)
Registered to the GSM network.
2. Green LED Off
•GSM module is in sleep or power down mode.
6.3 GPS LED
GPS status is indicated by a yellow LED as follows:
1. Yellow LED On
•GPS position is fixed, ready for tracking.
2. Yellow LED Off
•GPS position is not fixed, not ready for tracking.

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 19 /105
7 Basic Command
7.1 Command Mode – AT
This command will prompt the device to return a positive acknowledgement via the
command channel, which can be used to check the communication link between the
remote host and the device.
Syntax
Command Response
AT
OK
Parameters
Nil
Example
Command Response
AT
Note: Send this command via serial port to check
the corresponding communication link.
OK
Note: Send to serial port.
AT
Note: Send this command via SMS and check the
corresponding communication link.
OK
Note: Send to SMS number.
AT
Note: Send this command via network channel to
check the corresponding communication link.
OK
Note: Send to network channel.
7.2 Repeat Last Command – A/
This command will repeat the last valid command of the open session, only the A/
command itself cannot be repeated. If this command is the first one of the open
session, the response is OK without any treatment.
Syntax
Command Response
A/ <repeat last command>

MTD2000 AT Command Guide R12
Confidential DAVISCOMMS (S) PTE LTD 20 /105
Parameters
Nil
Example
Command Response
AT$SV
Note: Query firmware version.
OK
$SV: R0100
A/
Note: Repeat last command.
OK
$SV: R0100
Table of contents
Other Daviscomms GPS manuals