Compare commits

...

2 commits

Author SHA1 Message Date
03f011fb80 update for 2024 2024-03-18 23:38:33 +01:00
a95e164595 cron make .txt 2024-03-18 23:37:58 +01:00
2 changed files with 8 additions and 4 deletions

View file

@ -1,3 +1,3 @@
#! /bin/bash
make -C /home/ncrs1/stephan/tk102gpx TIMELIMIT=-t1d tk102-1.gpx tk102-1.png tk102-2.gpx tk102-2.png
make -C /home/ncrs1/stephan/tk102gpx TIMELIMIT=-t1d tk102-1.gpx tk102-1.png tk102-2.gpx tk102-2.png tk102-1.txt tk102-2.txt

View file

@ -55,9 +55,11 @@ for o,v in options:
serial = time.strftime("%y%m%d%H%M", time.gmtime(time.time()-t)).encode()
if verbose:
print(f"--serial={serial}", file=sys.stderr)
"""
2403182137,<E9><F0><8F><CC>^]<CB><FE><CD>g<EE>^]}<FE><FD><DC>_<FF>P,GPRMC,213722.000,A,5416.3748,N,00952.1328,E,0.01,0.00,180324,,,A*6C,F,imei:013777002752663,110<D1>i
"""
tk_re = re.compile(b"".join((
b"(?P<SERIAL>23[0-9]+),",
b"(?P<SERIAL>24[0-9]+),",
b"(?P<PHONE>[^,]+(,[^,]*)?),",
b"GPRMC,",
b"(?P<TIME>[0-9]{6}(\.[0-9]+)?),",
@ -76,7 +78,7 @@ tk_re = re.compile(b"".join((
b"(?P<MESSAGE>[^,]+,)?",
b"imei:(?P<IMEI>[0-9]+),",
b"(?P<LEN>[0-9]{3})",
b"(?P<BCKS>2[^23]|[^2][^2])?"
b"(?P<BCKS>2[^234]|[^2][^2])?"
)), flags=re.DOTALL)
def gprmc2deg(d,dd):
@ -114,6 +116,8 @@ class TKGPX(gpxpy.gpx.GPX):
while data or follow or files:
m = tk_re.search(data)
while not m:
if verbose >= 3:
print(len(data), repr(data[-80:]))
ndata = inp.read(0x100000)
while not ndata and files:
inp.close()