In New Zealand there are nearly 50,000 motor vehicle thefts every year and unfortunately, one of the most popular models stolen is my car: the Subaru Legacy. But- car alarms are expensive and of no guarantee to prevent car theft so I decided to look into GPS tracking devices. Sure... my car could be stolen but at least I'll have a fair idea where it ends up and it would give the police -at minimum- solid information on who stole it.
This guide aims to be comprehensive and beginner friendly.
You should end up with something like:

Ingredients List
- A Vehicle GPS tracking device. I purchased the OBD II. There are other good options. Some are battery powered and others plug into different ports in your car. This guide will be based on the OBD II but it should be easy to alter to setup other trackers. If you have an older car (like very very old) you may need to check for alternatives.
- A VPS (with good uptime and 256mb of ram or more). I have mine running on a 128mb ram VPS from BuyVM but it may need upgrading (Java is memory hungry).
- A SIM card (one of the old big fat ones - most likely- that runs on 2G). You will need 300mb of data (per month) and a decent number of texts.
- Putty client.
Setting up the VPS.1. My recommendation is to use a Ubuntu 16.x 32bit template (if it is not an option under when purchasing your VPS, you may be able to reinstall in your VPS's control panel). You can use other Ubunutu releases (or other linux releases for that matter), just ensure the correct Java version is available.
2. Login to your VPS using Putty (using root and your password). It would probably be a good idea to point out that using "root" as a login is a seriously bad idea... (
setup a Sudo user and disable root!!)
Notes with the following commands...
Putty allows right-click pasting. You can also use Ctrl C to copy as well.
If you are given a
command not found error, you may not have the package installed. Simply running:
- Code: Select all
apt-get install
packagename should fix this... e.g.
- Code: Select all
apt-get install unzip
.
Preference all commands with
sudoif you are not logged in as root.
3. Run these commands:
The template will be out-of-date... we need to get the latest updates. Run.=
- Code: Select all
apt-get update
We need Java! (specifically 7 +)
- Code: Select all
apt-get install default-jre
- Code: Select all
java –version
- this will let you check your version!
Download and unzip Traccar...
- Code: Select all
mkdir /traccartemp
- temp directory
- Code: Select all
cd /traccartemp
- navigate into this directory (cd by itself will navigate up).
- Code: Select all
wget https://sourceforge.net/projects/traccar/files/traccar-linux-3.11.zip/download
The latest downloads are here:
https://sourceforge.net/projects/traccar/files/. You can copy the link for the latest linux version and wget it.
- Code: Select all
ls
- we need to list whats in the directory to know what to unzip...
- Code: Select all
unzip download
- yours may be different based on ^
install...
- Code: Select all
/traccartemp/traccar.run
run....
- Code: Select all
/opt/traccar/bin/startDaemon.sh
- this is for the latest Traccar version...
4. You should now be able to login to Traccar. Navigate to:
- Code: Select all
yourIPAddress:8082
and login using "admin" for both the username and password. This should obviously be changed in the settings on the page.
Add your device by clicking the + button:

The identifier is the IMEI number of the tracking device. For the OBDII, it is a little different, being the last 11 digits preceded by a "0".
Setting up the Tracker.1. The sim card should slot nicely into the device. If it doesn't... you'll probably be like me wondering (in sadness) why your car won't reply to your texts!

(note... if you were given a power supply cable with your device, save step 2 until the end and just plug it in).
2. The OBD II plugs into the OBD port (the diagnostics port of your car).
Here's a website to help you find it.
3. Unfortunately for me, my tracker did not come with a cable for power. So... the car had to be running for me to run commands (perhaps include this step in a daily errand?).
Have a conversation with your device! Your device's manual should give you commands to run... (you might wish to change some of the default settings e.g. the interval between updates).

Text the following...
Set the admin phone number.
- Code: Select all
710#yourmobilenumber#
Replies --->ADD admin account 1 OK!
Set the APN - this is the data APN specific to your SIM. A quick google search or asking your provider should reveal this. Mine was "warehouse".
- Code: Select all
820#APN#
Set your IP and port. The port is dependent on your device. It basically sets up a protocol for the device to communicate with the server. With Chinese devices... there are a number of possible ports so try these:
https://www.traccar.org/ports-for-tk-gt ... s-devices/. :/
- Code: Select all
803#VPSIPADDRESS#5002#
At any time you wish to see the location of your Car/ Vehicle:
- Code: Select all
666#
Not working?You can attempt to manually identify the port... Check the log file by running:
- Code: Select all
less /opt/traccar/logs/tracker-server.log
Press
q to exit.
If there is a protocol issue... copy the long code into this
HEX decoder and try to determine which device it matches from here:
https://raw.githubusercontent.com/tanan ... gration.py.
If you see something like the following, you haven't set your identifier correctly.

If there is nothing in the server log (i.e. no attempt at communication), there may be something wrong with the settings on your tracking device (e.g. APN, IP).
Use the code:
- Code: Select all
886#
to double check.
Any questions, feel free to comment below!
A big thanks to
baZzz as well as Anton Tananaev, founder of Traccar.
https://www.traccar.org/quick-start/https://www.traccar.org/linux/
In New Zealand there are nearly 50,000 motor vehicle thefts every year and unfortunately, one of the most popular models stolen is my car: the Subaru Legacy. But- car alarms are expensive and of no guarantee to prevent car theft so I decided to look into GPS tracking devices. Sure... my car could be stolen but at least I'll have a fair idea where it ends up and it would give the police -at minimum- solid information on who stole it.
This guide aims to be comprehensive and beginner friendly.
[center]You should end up with something like:
[img]http://i.imgur.com/HWstDmO.png?1[/img][/center]
[b]Ingredients List :lol: [/b]
[list][*] A Vehicle GPS tracking device. I purchased the [url=http://www.ebay.com/itm/302225389424?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT]OBD II[/url]. There are other good options. Some are battery powered and others plug into different ports in your car. This guide will be based on the OBD II but it should be easy to alter to setup other trackers. If you have an older car (like very very old) you may need to check for alternatives.
[*]A VPS (with good uptime and 256mb of ram or more). I have mine running on a 128mb ram VPS from [url=https://my.frantech.ca/cart.php?a=confproduct&i=1?aff=2028]BuyVM[/url] but it may need upgrading (Java is memory hungry).
[*]A SIM card (one of the old big fat ones - most likely- that runs on 2G). You will need 300mb of data (per month) and a decent number of texts.
[*] [url=http://www.putty.org/]Putty[/url] client.[/list]
[hr][/hr]
[b]Setting up the VPS.[/b]
1. My recommendation is to use a Ubuntu 16.x 32bit template (if it is not an option under when purchasing your VPS, you may be able to reinstall in your VPS's control panel). You can use other Ubunutu releases (or other linux releases for that matter), just ensure the correct Java version is available.
2. Login to your VPS using Putty (using root and your password). It would probably be a good idea to point out that using "root" as a login is a seriously bad idea... ([url=https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart]setup a Sudo user[/url] and disable root!!)
[u]Notes with the following commands...
[/u]
Putty allows right-click pasting. You can also use Ctrl C to copy as well.
If you are given a [b]command not found[/b] error, you may not have the package installed. Simply running:
[code]apt-get install [/code] [i]packagename[/i] should fix this... e.g. [code]apt-get install unzip[/code].
Preference all commands with [b]sudo[/b]if you are not logged in as root.
3. Run these commands:
The template will be out-of-date... we need to get the latest updates. Run.=
[code]apt-get update[/code]
We need Java! (specifically 7 +)
[code]apt-get install default-jre[/code]
[code]java –version[/code] - this will let you check your version!
Download and unzip Traccar...
[code]mkdir /traccartemp[/code] - temp directory
[code]cd /traccartemp[/code] - navigate into this directory (cd by itself will navigate up).
[code]wget https://sourceforge.net/projects/traccar/files/traccar-linux-3.11.zip/download[/code] The latest downloads are here: https://sourceforge.net/projects/traccar/files/. You can copy the link for the latest linux version and wget it.
[code]ls[/code] - we need to list whats in the directory to know what to unzip...
[code]unzip download[/code] - yours may be different based on ^
install...
[code]/traccartemp/traccar.run[/code]
run....
[code]/opt/traccar/bin/startDaemon.sh[/code] - this is for the latest Traccar version...
4. You should now be able to login to Traccar. Navigate to:
[code]yourIPAddress:8082[/code] and login using "admin" for both the username and password. This should obviously be changed in the settings on the page.
Add your device by clicking the + button:
[img]http://i.imgur.com/uH4zDMz.png?1[/img]
The identifier is the IMEI number of the tracking device. For the OBDII, it is a little different, being the last 11 digits preceded by a "0".
[hr][/hr]
[b]Setting up the Tracker.[/b]
[b]1.[/b] The sim card should slot nicely into the device. If it doesn't... you'll probably be like me wondering (in sadness) why your car won't reply to your texts!
[img]http://i.imgur.com/K69ak2X.png?1[/img]
(note... if you were given a power supply cable with your device, save step 2 until the end and just plug it in).
[b]2. [/b] The OBD II plugs into the OBD port (the diagnostics port of your car). [url=https://www.hum.com/port]Here's a website[/url] to help you find it.
[img]http://i.imgur.com/M4Z3PXU.png?1[/img]
[b]3. [/b] Unfortunately for me, my tracker did not come with a cable for power. So... the car had to be running for me to run commands (perhaps include this step in a daily errand?).
Have a conversation with your device! Your device's manual should give you commands to run... (you might wish to change some of the default settings e.g. the interval between updates).
[img]http://i.imgur.com/G5tzPMy.png?1[/img]
Text the following...
Set the admin phone number.
[code]710#yourmobilenumber#[/code]
Replies --->ADD admin account 1 OK!
Set the APN - this is the data APN specific to your SIM. A quick google search or asking your provider should reveal this. Mine was "warehouse".
[code]820#APN#[/code]
Set your IP and port. The port is dependent on your device. It basically sets up a protocol for the device to communicate with the server. With Chinese devices... there are a number of possible ports so try these: https://www.traccar.org/ports-for-tk-gt-and-other-gps-devices/. :/
[code]803#VPSIPADDRESS#5002#[/code]
At any time you wish to see the location of your Car/ Vehicle:
[code]666#[/code]
[hr][/hr]
[b]Not working?[/b]
You can attempt to manually identify the port... Check the log file by running:
[code]less /opt/traccar/logs/tracker-server.log[/code]
Press [b]q[/b] to exit.
If there is a protocol issue... copy the long code into this [url=https://www.traccar.org/hex-decoder/]HEX decoder[/url] and try to determine which device it matches from here: https://raw.githubusercontent.com/tananaev/traccar/master/tools/test-integration.py.
If you see something like the following, you haven't set your identifier correctly.
[img]http://i.imgur.com/UNNrG3K.png?1[/img]
If there is nothing in the server log (i.e. no attempt at communication), there may be something wrong with the settings on your tracking device (e.g. APN, IP).
Use the code:
[code]886#[/code] to double check.
[hr][/hr]
Any questions, feel free to comment below!
[hr][/hr]
A big thanks to [url=https://www.traccar.org/forums/topic/tk206-obd-ii-instructions/]baZzz[/url] as well as Anton Tananaev, founder of Traccar.
https://www.traccar.org/quick-start/
https://www.traccar.org/linux/