Skip to main content

GPS OBD2 tracker

This project is for Chinese GPS tracker for cars.

Which GPS ODB2 trackers are supported?

This is good question and very hard to find proper answer. It was developed and tested on devices bought on AliExpress which looks like this one: GPS ODB2 Tracker After reading attached instruction - I have found error - they say to connect to 3.tkstargps.net side but app is AIKA. What I found - that device is connecting (after sending SMS to it) to XX.aika168.com - and communication between mobile app and server is open (no ssl). This was an invitation to create this library. Other GPS OBD2 Trackers that work with AIKA mobile app should work with this library too. How to check that? Look at pictures of mobile app that usuary is shown on pages where somebody is selling device. If you see something like: AIKA APP

Map with blue top bar with reload button on right and back arrow on left. This is AIKA app. And here is a link to Google app store: AIKA app.

How to use this code?

It's an asynchronous library. To integrate with your code:

import asyncio
from obdtracker import API, Location, DeviceStatus

async def main():
    # Use the context manager to ensure connections are closed
    async with API("http://www.aika168.com/") as tracker:
        tracker.register_updater(Location(tracker))
        tracker.register_updater(DeviceStatus(tracker))

        # Login and update data
        await tracker.login('<Your device id>', '<Your server password>')
        await tracker.update()

        # Access typed data
        if tracker.location:
             print(f"Position: {tracker.location.lat}, {tracker.location.lng}")
        
        if tracker.status:
             print(f"Battery: {tracker.status.battery}%")
             print(f"Ignition is {'ON' if tracker.status.is_ignition_on else 'OFF'}")
             print(f"Warning: {tracker.status.warning_type.name}")

        # You can also send commands to the device across the network
        # await tracker.send_command("DY") # Cut oil/electricity
        
if __name__ == "__main__":
    asyncio.run(main())

SMS Fallback Generator

If the GPS tracker doesn't connect to the internet, you can create standard SMS commands using SMSCommandBuilder:

from obdtracker.sms import SMSCommandBuilder
sms = SMSCommandBuilder(password="123456")
message = sms.set_speed_alarm(80) 
print(message) # "speed123456 080"

NEW: list of UNSUPPORTED mobile applications

If you are going to buy GPS OBD2 Tracker checkout this list to see which mobile apps are unsupported. Acually it means that those mobile apps use cloud service that is not supported with this tool: (Unsupported cloud / OBD2 GPS Trackers)[/doc/unsupported.md]

Supported apps / cloud services:

  1. aika168.com / www.aika168.com - developed using this cloud service - works
  2. gpscj.net / gps18.com - not sure - possibly it is working

What is next step?

Right now I'm working on:

  • App for getting information about protocol between device and gateway at XX.aika168.com
  • Further expanding commands and mapping hardware protocols.

Home Assistant Integration: The Home Assistant custom component for this library is available at maika.

Metadata

Release files for obdtracker 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for obdtracker 0.2.7
File Size Uploaded
obdtracker-0.2.7.tar.gz 26.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for obdtracker 0.2.7
File Interpreter ABI Platform
obdtracker-0.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 49.9 kB

Release files / obdtracker-0.2.7.tar.gz

Download URL obdtracker-0.2.7.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8584764cfe8ab3a50de5a94174c0dc34e31095d3a0285df2ec1cf7013b963481
BLAKE2b-256 checksum
How to use checksums
baecf355ac66489a695e3ac5ead3ec9930eecefdb0f85ae0482f1241efb0b05b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / obdtracker-0.2.7-py3-none-any.whl

Download URL obdtracker-0.2.7-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8be84c9a71faa1c4029e9b861291531fdeab6c9194428734fce589a33ce705e2
BLAKE2b-256 checksum
How to use checksums
2a447bd261c723441fcf683b3f384b536af738c53edb2a506aa6e62d2fa15b4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.2.7 This release

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page