Skip to content

Tracker installation

Josef edited this page Jun 30, 2025 · 3 revisions

Following tutorial will show you how to install and configure software on your Raspberry Pi.

Presumably you already have tracker-server and tracker-client installed.

Step 1: Generate API key in frontend

Create new tracker in Tracker section and copy the generated API key. You will need it in step 4.

Step 2: Power on/power off button

To enable powering off with the button you must add following line to the end of /boot/config.txt file:

dtoverlay=gpio-shutdown

Step 3: Download and install DEB package

Download the DEB file from this link and transfer it to your Raspberry Pi. Alternatively, you can directly download it to your Raspberry Pi using the following command in the terminal:

wget https://github.com/jsfraz/trek-tracker/releases/download/1.0.0/trek-tracker-1.0.0.deb

Once downloaded, navigate to the directory where the DEB file is located and run the following command to install it:

sudo dpkg -i trek-tracker-1.0.0.deb

Step 4: Configure trek-tracker

During installation you will be prompted to configure the tracker. If you refuse, you can change it afterwards. The configuration file is located at /etc/trek-tracker/trek-tracker.conf. It should look like this:

[trek-tracker]
Https = false
ServerAddress = trek.example.com
ServerPort = 8080
ApiKey = generate_your_key_in_frontend
ReconnectDelay = 1
InitialReconnectDelay = 10
BaudRate = 115200

Make sure to adjust the values according to your setup. Specifically, you may want to change the following settings:

  • Https: Set to true if you're using HTTPS, otherwise set it to false.
  • ServerAddress: Set to the IP address or hostname of your server.
  • ServerPort: Set to the port number on which your server is running.
  • ApiKey: Replace generate_your_key_in_frontend with the API key obtained from your frontend application.
  • ReconnectDelay: Set the delay (in seconds) for the device to attempt reconnection after disconnection.
  • InitialReconnectDelay: Set the initial delay (in seconds) before the device attempts reconnection for the first time.
  • BaudRate: Set the baud rate for serial communication with your GPS module.

Step 5: Restart the service and the device (optional)

If you configured the tracker manually after installation, you need to restart the trek-tracker.service. You can do this by running the following command:

sudo systemctl restart trek-tracker.service

If you did not reboot the device after installation, it is recommended to do so for the software and power button to work properly. You can do this by running the following command:

sudo systemctl restart trek-tracker.service

You are done!

Congratulations! You have completed the setup process for the tracker.