Giter Club home page Giter Club logo

qtripp's Introduction

qtripp

The Queclink Track (air) Interface Protocol Processor is a TCP GPRS server for Queclink devices: qtripp obtains GPS positions from these devices and publishes those over MQTT in OwnTracks JSON format as `location objects.

qtripp

requirements

  • an Internet-facing server with an open TCP port
  • a Queclink device. We have tested GV65, GV65+, GV55, GV200MT, and GV500. Others ought to be no problem, though you might have to adapt device configurations from the Protocol documentation.
  • an MQTT broker (see the OwnTracks Booklet)
  • a bit of patience

features

  • configurable MQTT publish topics (device lookup)
  • extensible
  • copious debugging
  • support for device reports with embedded segments (e.g. GTFRI/GTERI)
  • ignore specific device reports
  • configurable reports per/device and on a per/firmware basis
  • fast
  • extra JSON data can be merged in to data from devices
  • OwnTracks JSON support
  • MQTT, TLS, TLS client certificates, user/password authentication
  • list devices connected (console & MQTT)
  • statistics over MQTT
  • statistics dump including subtype stats and IMEI stats.
  • (pseudo-) LWT for devices (when a device disconnects, qtripp publishes LWT)
  • support for 1-Wire temperature sensors (on GV65/GV65+)
  • raw data is copied to file for backup, replay, debugging, etc.
  • optional beanstalkd support (requires beanstalk-client) for mirroring. (sample workers are provided.) beanstalk host/port/tube are configurable; payload is OwnTracks JSON enriched with a field imei and a raw_line field which contains original ASCII device data (+RESP:GT ... $)

commands

-t owntracks/qtripp/*/cmd -m list
-t owntracks/qtripp/*/cmd -m stats
-t owntracks/qtripp/*/cmd -m dump

logging

2017-08-16T17:25:55Z 1502904355 pid=564 +++ I=863123456789090 (JP car) M=GV65 np=200 P=310603 C=2 T=RESP:GTERI (scheduled report) LINE=+RESP:GTERI,310603,8...
---------+---------- ----+----- ---+---     +---------------- -+------ +----- +----- +------- +-- +----------  +----------------  +-------------------------
         |               |         |        |                  |       |      |      |        |   |            |                  |
         |               |         |        |                  |       |      |      |        |   |            |                  +-----------------  raw data received
         |               |         |        |                  |       |      |      |        |   |            +------------------------------------  (description of T=)
         |               |         |        |                  |       |      |      |        |   +-------------------------------------------------  T=type/subtype
         |               |         |        |                  |       |      |      |        +-----------------------------------------------------  C=counter (total reports handled so far)
         |               |         |        |                  |       |      |      +--------------------------------------------------------------  P=protov (proto, maj/min)
         |               |         |        |                  |       |      +---------------------------------------------------------------------  np=number of parts (csv)
         |               |         |        |                  |       +----------------------------------------------------------------------------  M=model (from protov)
         |               |         |        |                  +------------------------------------------------------------------------------------  (name)
         |               |         |        +-------------------------------------------------------------------------------------------------------  I=<imei>
         |               |         +----------------------------------------------------------------------------------------------------------------  process ID
         |               +--------------------------------------------------------------------------------------------------------------------------  epoch
         +------------------------------------------------------------------------------------------------------------------------------------------  date/timestamp ISO (Zulu)

beanstalk

  1. clone beanstalk-client into qtripp's directory, cd into that and make. (Apply this fix on macOS.)
  2. in qtripp's Makefile, define BEANSTALK

credits

authors

  • Jan-Piet Mens (@jpmens)
  • Christoph Krey (@ckrey)

qtripp's People

Contributors

ckrey avatar danboothdev avatar jpmens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qtripp's Issues

Add UUID to outgoing MQTT payload?

Should we add a UUID to the JSON payloads we publish over MQTT? UUIDs are helpful in tracking unique messages, and in this case, it's just a couple lines of code.

Consider device-specific data logs

instead of a single data.log we can store a device's data in data-<IMEI>. This simplifies things greatly when we have to replay a device's log or for long-term data storage.

Model String M=unknown

2023-07-20T11:27:57Z 1689852477 pid=1038 +++ I=867488060201307 (GV58CEU) M=unknown np=31 P=8020030100 C=15782 T=RESP:GTFRI (fixed report information) LINE=+RESP:GTFRI,8020030100,867488060201307 ...
2023-07-20T11:29:06Z 1689852546 pid=1038 +++ I=867488060201307 (GV58CEU) M=unknown np=31 P=8020030100 C=15786 T=RESP:GTFRI (fixed report information) LINE=+RESP:GTFRI,8020030100,867488060201307  ...
2023-07-20T11:29:46Z 1689852586 pid=1038 +++ I=867488060201307 (GV58CEU) M=GV58CEU np=31 P=8020030100 C=15789 T=RESP:GTFRI (fixed report information) LINE=+RESP:GTFRI,8020030100,867488060201307 ...
2023-07-20T11:30:23Z 1689852623 pid=1038 +++ I=867488060201307 (GV58CEU) M=GV58CEU np=31 P=8020030100 C=15792 T=RESP:GTFRI (fixed report information) LINE=+RESP:GTFRI,8020030100,867488060201307 ...
2023-07-20T11:31:00Z 1689852660 pid=1038 +++ I=867488060201307 (GV58CEU) M=GV58CEU np=31 P=8020030100 C=15793 T=RESP:GTFRI (fixed report information) LINE=+RESP:GTFRI,8020030100,867488060201307 ...
2023-07-20T11:31:37Z 1689852697 pid=1038 +++ I=867488060201307 (GV58CEU) M=GV58CEU np=31 P=8020030100 C=15797 T=RESP:GTFRI (fixed report information) LINE=+RESP:GTFRI,8020030100,867488060201307 ...
2023-07-20T11:32:14Z 1689852734 pid=1038 +++ I=867488060201307 (GV58CEU) M=unknown np=31 P=8020030100 C=15801 T=RESP:GTFRI (fixed report information) LINE=+RESP:GTFRI,8020030100,867488060201307 ...
2023-07-20T11:32:51Z 1689852771 pid=1038 +++ I=867488060201307 (GV58CEU) M=unknown np=31 P=8020030100 C=15802 T=RESP:GTFRI (fixed report information) LINE=+RESP:GTFRI,8020030100,867488060201307 ...

Add pid to xlog

Add PID to log output in order to easily detect restarts (a.k.a crashes).

Use CDB for device_to_topic() instead of INI file

We should probably use a CDB (e.g. TinyCDB) file for device_to_topic() instead of using configuration from the INI file because we'd be able to re-create CDB on changes and have qtripp re-open the CDB -- easier than mucking about with the INI.

HTTP Emitter

It looks like qtripp is only able to emit OwnTracks JSON via MQTT.

It would be great if it were also able to emit over HTTP, so that it could be used in a scenario where the Recorder is running in HTTP mode (thus eliminating the need for running a separate MQTT server), or when using alternative backends (i.e. orion-server/orion-web) :)

getting mongoose error in make

mongoose.c:1110:33: error: argument 1 of type 'unsigned char[16]' with mismatched bound [-Werror=array-parameter=] 1110 | void cs_md5_final(unsigned char digest[16], cs_md5_ctx *ctx) { | ~~~~~~~~~~~~~~^~~~~~~~~~ In file included from mongoose.c:1: mongoose.h:1765:34: note: previously declared as 'unsigned char *' 1765 | void cs_md5_final(unsigned char *md, cs_md5_ctx *c); | ~~~~~~~~~~~~~~~^~ cc1: all warnings being treated as errors make: *** [<builtin>: mongoose.o] Error 1

Process Power On and Off Messages?

GL300(W) devices (battery driven, not car connected) send GTPNA / GTPFA messages when manually switched on or off. As these messages do not contain a position (lat/lon), they are not processed

Add support for GTVER

GTVER is a very useful report for firmware/hardware versions. I added it in #14 but only implemented GL300M devices.

We might also want to add support for more items in devices.h such as:

int device_type;    /* String representation of the device type e.g. gl300m */
int ver_fw;            /* HEX firmware version MAMI for MAjor MInor */
int ver_hw            /* HEX hardware version MAMI for MAjor MInor */

This is something that I could happily undertake and submit a PR when ready.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.