====== Owntrack OT-Recoder ======
[[https://github.com/owntracks/recorder|OT Recoder GITHUB]]\\
[[https://play.google.com/store/apps/details?id=org.owntracks.android| Owntrack APP (Achtung Google Play Store)]]
===== Informationen =====
TODO: FIXME
===== Installation =====
TODO: FIXME
===== Configs =====
==== OT-Recoder starten ====
port 1883
protocol mqtt
autosave_interval 1800
port 8883
protocol mqtt
certfile /etc/ssl/cert.pem
cafile /etc/ssl/chain.pem
keyfile /etc/ssl/privkey.pem
persistence true
persistence_location /var/lib/mosquitto/
persistence_file mosquitto.db
log_dest syslog
log_dest stdout
log_dest topic
log_type error
log_type warning
log_type notice
log_type information
log_type debug
connection_messages true
log_timestamp true
allow_anonymous false
password_file /etc/mosquitto/pwfile
echo | openssl s_client -servername -connect :8883 2>/dev/null | openssl x509 -text > /etc/ssl/ca.pem
OTR_CAFILE=/etc/ssl/ca.pem
OTR_HOST=
OTR_USER=
OTR_PASS=
nohup ot-recorder --precision 9 --http-host 0.0.0.0 --port 8883 --debug 'owntracks/#'
==== Entferne Falsche Punkte ====
dieser python gibt dir sed commandos zum entfernen alle punkte die vermutlich falsch sind da schneller als 500km/h
/home/progamler # python3 test.py /var/spool/owntracks/recorder/store/rec/progamler/hwgra/2017-05.rec
import json
from geopy.distance import vincenty
import sys
data = []
with open(sys.argv[1]) as f:
for line in f:
tmp = json.loads("{" + line.split('{',1)[-1])
if "lat" in tmp:
data.append(tmp)
a=(0,0)
t=0
for d in data:
if a != (0,0):
dist = vincenty(a, (d['lat'], d['lon'])).km
if dist > 1:
#print(dist)
delta=int(d['tst'])-int(t)
if float(dist) == 0:
continue
if delta == 0:
continue
speed=(float(dist)/delta)*3600
if speed > 500:
#print(speed)
print("sed -i.bak '/" + str(d['tst']) + "/d' " + sys.argv[1])
a = (d['lat'], d['lon'])
t = int(d['tst'])
===== Bilder =====
{{:projekte:map.png?200|}}