]> www.average.org Git - loctrkd.git/blob - README.md
expand README
[loctrkd.git] / README.md
1 # A server to collect data from zx303 ZhongXun Topin Locator
2
3 zx303 GPS+GPRS module is a cheap and featureful GPS tracker for pets,
4 children, elderly family members, and, of course, illegal tracking
5 of people and objects, though the latter absolutely must not be done.
6
7 This work is inspired by [this project](https://github.com/tobadia/petGPS),
8 but it is more of a complete reimplementation than a derived work.
9
10 When powered up, the module makes TCP connection to the configured
11 (via SMS) server, identifies itself (via IMEI) in the first message,
12 and continue to send periodic messages with location and other status
13 updates. Some of these messages require a response from the server.
14 In particular, when the module has no GPS coverage, it sends information
15 about neaby GSM+ cell towers and WiFi access points, to which the server
16 is expected to respond with a message contaning approximate location
17 derived from this data. That may require querying some external service.
18
19 Because we would usually want location information reach consumer
20 instantly upon arrival, and _also_ to be stored, it makes sense to
21 design the system in "microservices" way, using a message bus in
22 "publish-subscribe" model. And then, as we already have a message-
23 passing infrastructure anyway, it makes sense to decouple processes
24 that prepare responses to the module's messages from the server that
25 keeps TCP connections with the modules.
26
27 This leads us to the current implementation that has consists of
28 four daemons that talk to each other via zeromq:
29
30 - **collector** that keeps open TCP connections with the terminals
31   and publishes received messages,
32 - **storage** that subscribes to the messages from the collector and
33   stores them in a database,
34 - **termconfig** that subscribes to messages that need non-trivial
35   response (most of them are about configuring various settings in
36   the terminal, hence the name), and
37 - **lookaside** that subscribes to "rough" location messages, quieries
38   an external source (in our implementation, opencellid database),
39   and responds with approximated location.
40
41 There is also a command-line tool to send messages to the terminal.
42 There is a number of useful things that can be requested in this way.