Self-Built In-Car GPS Services, Software-Hardware Integration Practices

This article delves into configuring GPS system services in conjunction with compatible hardware to achieve the privatization of the complete process of GPS services within an automobile.

Rumors suggest that 2G devices will only be functional until 2027, and mobile operators may retract 2G networks at any time. While the precise timing remains unclear, future devices and solutions can be upgraded to 4G devices and cards.

Next Steps: Following practical operations, fill in the gaps and then share refined updates…

Utility

Procuring GPS devices that are compatible for use with IoT SIM cards

Establishing GPS system services

Configuring GPS system services in conjunction with compatible hardware to achieve the complete privatization process of GPS services

How to Use

Procuring compatible hardware and IoT SIM cards

Installing Traccar on the server side using docker

Installing Traccar Android client on the mobile side

Routine Usage

Related Content

Implementation Method

Procuring Compatible Hardware and IoT SIM Cards

  • Configuring or modifying the GPS locator/In-car GPS on the server
  • Requires preparing two usable SIM cards:
    • One IoT card #1 (permanently inserted in the device to send GPS data to the server), currently priced around 50 yuan in the market for the first 3 years
    • One regular SIM card #2 for the initial/one-time insertion into the GPS device, sending a message from another phone to this SIM card #2 for configuration/modification of the GPS device

Experience with purchasing IoT cards: Personal preference is to buy 3 or 5-year IoT cards. After using for 3 or 5 years, it is often challenging to find the original seller and obtain the original after-sales service. Renewal prices from the manufacturer are often not the same as the originally agreed upon renewal price after 3/5 years. Therefore, personally, after 3 or 5 years of usage, it’s preferable to discard the old IoT card and replace it with a new one, necessitating device and platform support for this long-term operational approach.

Installing Traccar on the Server Side using Docker

What is Traccar

Modern GPS Tracking Platform
Traccar is an outstanding open-source GPS server platform supporting numerous devices and protocols (although mostly foreign devices, with the vast majority of supported protocols in China being gt06 and gt02). It offers comprehensive features such as positioning, geofencing, alarms, SMS control, notifications, trajectory tracking, and provides deployment on multiple platforms including Windows, Linux, and Docker containers. Furthermore, it offers web, Android, and iOS clients. The key feature is that Hass natively supports Traccar, requiring no additional plugins for integration. Before Traccar, there was another longstanding open-source GPS platform - Opengts, with a more extensive history. However, it lacks support for Chinese language environments, features an unattractive interface, and is less user-friendly for Chinese users.

Traccar official website: https://www.traccar.org/

Installation Deployment

  1. Create a “traccar” directory at any location on the server, with subdirectories “logs” and “templates” within the traccar directory.

  2. Deploy a container to fetch initialized configuration files (the fetching operation will delete itself upon completion, no manual deletion required)

    docker run --rm --entrypoint cat traccar/traccar:latest /opt/traccar/conf/traccar.xml > /$yourself_dir/traccar/traccar.xml

  3. Officially deploy the Traccar server container

    1. Create a docker-compose.yml file with the following content
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    version: '3.9'
    services:
    traccar:
    image: 'traccar/traccar:latest'
    environment:
    - TZ=Asia/Shanghai
    volumes:
    - '/$yourself_dir/traccar/traccar.xml:/opt/traccar/conf/traccar.xml'
    ports:
    - '5055:5055/udp'
    - '5055:5055'
    - '5023:5023/udp'
    - '5023:5023'
    - '8082:8082'
    hostname: traccar
    container_name: traccar
    restart: always
  4. Access the web interface to verify successful installation.

    After a short wait, access http://your_ip:8082. If installed correctly, the Traccar login page will appear, with the default credentials being admin. It is recommended to change the password after logging in.

Configuring Traccar to Add GPS Devices

Add respective in-car GPS devices via the Traccar web interface

Installing Traccar Android Client on Mobile Devices

Can be installed on smartphones and in-car systems, providing personal and vehicle tracking. Visit the official website to download the Android or Apple app.

After installation, refer to the full tutorial on using Traccar from scratch to perfection for configuration steps.

Next is the configuration; enter the “device code” created earlier,

Enter the “server address” as the public domain name + port (the mobile app uses OsmAnd protocol, with ports being TCP and UDP 5055).

Determine the “update frequency” and “accuracy” as needed; excessively frequent updates may impact device battery life.

Sources of Inspiration

gps-through-traccar-server-integration-with-homeassistant

full-tutorial-on-using-Traccar from scratch to perfection

Setting up GPS tracking server Traccar

full-tutorial-on-using-Traccar from scratch to perfection (Images & Text)