.gitignore | ||
base64.c | ||
base64.h | ||
config.h.example | ||
config.mk | ||
file.c | ||
file.h | ||
geo.c | ||
geo.h | ||
geohash.c | ||
geohash.h | ||
ghash.c | ||
ghash.h | ||
jget.h | ||
json.c | ||
json.h | ||
LICENSE | ||
Makefile | ||
misc.c | ||
misc.h | ||
mkpath.c | ||
ocat.c | ||
ot-recorder.c | ||
README.md | ||
safewrite.c | ||
safewrite.h | ||
storage.c | ||
storage.h | ||
TODO.md | ||
udata.h | ||
utarray.h | ||
utstring.h |
recorder
Recorder
Requirements
- hiredis unless
HAVE_REDIS
is false.
Installation
- Copy
config.h.example
toconfig.h
- Edit
config.h
- Edit
config.mk
and select features - Type
make
Reverse Geo
If not disabled with option -G
, the recorder will attempt to perform a reverse-geo lookup on the location coordinates it obtains. This is stored in Redis (ghash:xxx) if available or in files. If a lookup is not possible, for example because you're over quota, the service isn't available, etc., recorder keeps tracks of the coordinates which could not be resolved in a missing
file:
$ cat store/ghash/missing
u0tfsr3 48.292223 8.274535
u0m97hc 46.652733 7.868803
...
This can be used to subsequently obtain said geo lookups.
Monitoring
In order to monitor the recorder, whenever an MQTT message is received, the recorder will add an epoch timestamp and the last received topic a Redis key (if configured) or a file otherwise. The Redis key looks like this:
redis 127.0.0.1:6379> hgetall ot-recorder-monitor
1) "time"
2) "1439738692"
3) "topic"
4) "owntracks/jjolie/ipad"
The monitor
file is located relative to STORE and contains a single line, the epoch timestamp at the moment of message reception and the topic separated from eachother by a single space:
1439738692 owntracks/jjolie/ipad