PHPackages                             track-any-device/jt808 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. track-any-device/jt808

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

track-any-device/jt808
======================

JT808 protocol driver, connector, and stream consumer for the Track Any Device platform.

v0.1.2(2w ago)0115↓100%[7 issues](https://github.com/track-any-device/package-jt808/issues)MITPHPPHP ^8.3CI passing

Since May 23Pushed 6d agoCompare

[ Source](https://github.com/track-any-device/package-jt808)[ Packagist](https://packagist.org/packages/track-any-device/jt808)[ RSS](/packages/track-any-device-jt808/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (1)Versions (4)Used By (0)

track-any-device/jt808
======================

[](#track-any-devicejt808)

JT/T 808-2019 protocol driver, connector, and Redis Stream consumer for the **Track Any Device** platform.

Devices communicate over a persistent TCP connection handled by the companion Go service (`jt808-server`). The Go service decodes binary frames, publishes normalised JSON events onto a Redis Stream (`jt808:telemetry`), and subscribes to a Redis pub/sub channel (`jt808:cmd:{phone}`) for outgoing commands.

---

Requirements
------------

[](#requirements)

DependencyVersionPHP^8.3Laravel^13.7`track-any-device/core`(sibling package — must be installed)Redis6.2+ (XAUTOCLAIM support)Go JT808 serverrunning and connected to the same Redis instance---

Installation
------------

[](#installation)

```
composer require track-any-device/jt808
```

Publish the config stub:

```
php artisan vendor:publish --tag=jt808-config
```

---

Environment variables
---------------------

[](#environment-variables)

Add to the host app's `.env`:

```
JT808_SERVER_HOST=your-tcp-server-host
JT808_SERVER_PORT=7018
JT808_REDIS_CONNECTION=jt808
```

---

Redis connection
----------------

[](#redis-connection)

The package exclusively uses the named Redis connection `jt808` (overridable via `JT808_REDIS_CONNECTION`). Add it to `config/database.php`:

```
'redis' => [
    // ...
    'jt808' => [
        'url'      => env('REDIS_URL'),
        'host'     => env('REDIS_HOST', '127.0.0.1'),
        'password' => env('REDIS_PASSWORD'),
        'port'     => env('REDIS_PORT', '6379'),
        'database' => env('REDIS_JT808_DB', '1'),
    ],
],
```

---

Config (`config/jt808.php`)
---------------------------

[](#config-configjt808php)

```
return [
    'server_host'      => env('JT808_SERVER_HOST', ''),
    'server_port'      => (int) env('JT808_SERVER_PORT', 7018),
    'redis_connection' => env('JT808_REDIS_CONNECTION', 'jt808'),
];
```

---

Host-app contracts
------------------

[](#host-app-contracts)

### Device type seed

[](#device-type-seed)

The stream consumer looks up the device type by slug `'jt808'`. Ensure it exists before starting the consumer:

```
php artisan db:seed --class=DeviceTypeSeeder
```

### Driver registration

[](#driver-registration)

Register `Jt808Driver` in the core `DeviceServiceProvider` for the `jt808` slug so `DeviceServiceProvider::driverFor('jt808')` resolves correctly.

### Auth / authorization

[](#auth--authorization)

`addOnCommand()` calls `auth()->id()` to record who requested a command. In CLI/queue contexts this returns `null` — that is acceptable. For Filament or API callers, ensure a guard is active before dispatching add-on commands.

---

Starting the stream consumer
----------------------------

[](#starting-the-stream-consumer)

```
php artisan jt808:consume
```

OptionDefaultDescription`--stream``jt808:telemetry`Redis Stream key published by the Go server`--group``laravel`Consumer group name`--consumer`hostnameUnique consumer name per replica`--batch``50`Messages read per XREADGROUP call`--block``2000`Block timeout (ms) when stream is emptyRun as a supervised long-lived process (Supervisor, systemd, or a Kubernetes Deployment). The command traps `SIGTERM`/`SIGINT` for graceful shutdown and re-claims any unacknowledged pending messages on startup.

---

Event flow
----------

[](#event-flow)

```
Device (TCP)
  └─▶ Go jt808-server
        ├─▶ Redis XADD jt808:telemetry  (inbound telemetry)
        │       └─▶ ConsumeJt808Stream (this package)
        │               └─▶ SignalService → InfluxDB + MySQL snapshot
        │
        └─▶ Redis SUBSCRIBE jt808:cmd:{phone}  (outbound commands)
                └─▶ Go jt808-server → binary JT808 frame → Device

```

---

Supported stream events
-----------------------

[](#supported-stream-events)

`event` fieldHandlerDescription`device.registered``handleRegistration`First TCP registration frame (0x0100)`device.authenticated``handleAuthenticated`Auth/login frame; updates `last_seen_at``location``handleLocation`Location report (0x0200) — persists signal, dispatches alarm jobs---

Add-on commands
---------------

[](#add-on-commands)

Commands are available to Filament users via the core add-on command interface.

### Tracking

[](#tracking)

CommandParametersJT808 msg\_id`query_location`—0x8201`set_report_interval``seconds` (int)0x8103`set_heartbeat_interval``seconds` (int)0x8103### Network

[](#network)

CommandParametersJT808 msg\_id`set_server``host` (string), `port` (int)0x8103`set_apn``apn` (string)0x8103### Utility

[](#utility)

CommandParametersJT808 msg\_id`restart`—0x8105`factory_reset`—0x8105`enable_acc`—0x8103---

Release workflow
----------------

[](#release-workflow)

Releases are created automatically on every push to `main` by `.github/workflows/release.yml`. Tags follow semver (`vMAJOR.MINOR.PATCH`). The bump type is inferred from [Conventional Commits](https://www.conventionalcommits.org/):

Commit prefixBump`feat!:` / any breaking `!`major`feat:`minor`fix:`, `chore:`, `docs:`, etc.patchA manual bump can be triggered via **Actions → Release → Run workflow**.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance98

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

15d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83275f3144d4cc4092e54dd8d5acf6a048536f6d7e454d741ae82a61f904c737?d=identicon)[ahmadkokab](/maintainers/ahmadkokab)

---

Top Contributors

[![afaryab](https://avatars.githubusercontent.com/u/68786248?v=4)](https://github.com/afaryab "afaryab (4 commits)")

### Embed Badge

![Health badge](/badges/track-any-device-jt808/health.svg)

```
[![Health](https://phpackages.com/badges/track-any-device-jt808/health.svg)](https://phpackages.com/packages/track-any-device-jt808)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

591.7k1](/packages/crumbls-layup)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
