Hallo, Ich bschäftige mich gerade mit dem Rohdatenformat eines Datenloggers (Selbstbau von jemandem, der leider nicht mehr greifbar ist), an den drei Temperatursensoren angeschlossen sind. Die Daten werden als Folge von je 3 Bytes pro Kanal gespeichert, die letzten beiden repräsentieren den 16bit Messwert. "FF FF FF FF" markiert den Beginn eines neuen Datensatzes. Soweit ist alles klar. FF FF FF FF FC 08 51 89 FD 0C E8 7D 01 10 XX XX 02 10 XX XX 03 10 XX XX FF FF FF FF FC 08 51 89 FD 0C E9 00 01 10 XX XX 02 10 XX XX 03 10 XX XX FF FF FF FF FC 08 51 89 FD 0C E9 7C 01 10 XX XX 02 10 XX XX 03 10 XX XX Allerdings komme ich gerade nicht darauf, wie in den 8 Bytes dazwischen Datum und Uhrzeit verpackt sind. Ich vermute mal, dass es sich um eine Art Unix Timestamp (Sekunden seit 1/1/1970 UTC) oder ähnliches handelt. Ich habe schon etwas mit den Werten herumgespielt, habe aber nie ein plausibles Ergebnis (Datum muss in diesem Jahr liegen) erhalten. Hat vielleicht jemand Erfahrung mit dieser Art Datumsformat und kann mir helfen, die Bytes richtig zusammenzusetzen und in ein direkt lesbares Datumsformat umzurechnen? Ich bin für jede Hilfe Dankbar!
Ist den bekannt, in welchem Zeitintervall der Logger loggt?
SondenFuchs schrieb: > Datum muss in diesem Jahr liegen Gehts vielleicht ein bisschen genauer und hast du noch ein paar mehr Datensätz im Sekunden-, Minuten-, Stunden-, Tagesabstand?
Hallo, Schön, dass es jemanden interessiert :) Es sieht für mich so aus: Es werden mit bis zu 4 Hz Daten geloggt, Datum und Uhrzeit jedoch nur sekündlich "dazwischen" gespeichert. Im Anhang ein kurzes Logfile einer Messung mit 9 Kanälen vom 10.04.2013 08:20h.
besser lesbar wird die datei mit einem hex editor: http://mh-nexus.de/downloads/HxDSetupDE.zip fensterbreite auf 4 einstellen, dann sieht man die anordnung.
Es gibt auch noch ein format ab 1.1.0000, ich glaube matlab verwendet das gerne.
Meine Vermutung: 2 Bytes: was wird gespeichert 2 Bytes: Daten FC 08: Timestamp Bytes 1+2 FD 0C: Timestamp Bytes 3+4 Das ergäbe einen Anfangs-Timestamp von 0x5189e27f, was als Unix-Timestamp laut Wolfram Alpha 05:28:31 UTC am 08.05.2013 entspricht. Vielleicht rechnet der Entwickler hier anders oder hat einen Bug eingebaut. fchk
ich habe mir gerade nochmal ein längeres file angesehen. leider bleiben nur FC und FD konstant. aber so in der richtung wird es wohl sein.
Im Anhang gibts die Demodaten aufbereitet. Man nehmen nur die Timestamps (auch im Anhang) und jage sie durch folgendes Python-Skript:
1 | #!/usr/bin/env python3
|
2 | import datetime |
3 | |
4 | fobj = open("./demodata.hexform.timestamps.nowhitespaces", "r") |
5 | |
6 | print("Timestamps:") |
7 | |
8 | for line in fobj: |
9 | line_dec = str(int("0x"+line,16)) |
10 | line_time = line[6:14] |
11 | line_time_dec = str(int("0x"+line_time,16)) |
12 | print("hex: "+line[:-1] + " dec: " + line_dec + " time only: " + line_time + " time only dec: " + line_time_dec + " converted: " + str(datetime.datetime.fromtimestamp(int(line_time_dec)).strftime('%Y-%m-%d %H:%M:%S'))) |
13 | fobj.close() |
Und bekommt:
1 | Timestamps: |
2 | hex: 08fc89510cfd7fe2 dec: 647543427637805026 time only: 510cfd7f time only dec: 1359805823 converted: 2013-02-02 12:50:23 |
3 | hex: 08fc89510cfd02e3 dec: 647543427637773027 time only: 510cfd02 time only dec: 1359805698 converted: 2013-02-02 12:48:18 |
4 | hex: 08fc89510cfd7fe3 dec: 647543427637805027 time only: 510cfd7f time only dec: 1359805823 converted: 2013-02-02 12:50:23 |
5 | hex: 08fc89510cfd01e4 dec: 647543427637772772 time only: 510cfd01 time only dec: 1359805697 converted: 2013-02-02 12:48:17 |
6 | hex: 08fc89510cfd7ee4 dec: 647543427637804772 time only: 510cfd7e time only dec: 1359805822 converted: 2013-02-02 12:50:22 |
7 | hex: 08fc89510cfd01e5 dec: 647543427637772773 time only: 510cfd01 time only dec: 1359805697 converted: 2013-02-02 12:48:17 |
8 | hex: 08fc89510cfd7ee5 dec: 647543427637804773 time only: 510cfd7e time only dec: 1359805822 converted: 2013-02-02 12:50:22 |
9 | hex: 08fc89510cfd03e6 dec: 647543427637773286 time only: 510cfd03 time only dec: 1359805699 converted: 2013-02-02 12:48:19 |
10 | hex: 08fc89510cfd7ee6 dec: 647543427637804774 time only: 510cfd7e time only dec: 1359805822 converted: 2013-02-02 12:50:22 |
11 | hex: 08fc89510cfd00e7 dec: 647543427637772519 time only: 510cfd00 time only dec: 1359805696 converted: 2013-02-02 12:48:16 |
12 | hex: 08fc89510cfd7de7 dec: 647543427637804519 time only: 510cfd7d time only dec: 1359805821 converted: 2013-02-02 12:50:21 |
13 | hex: 08fc89510cfd00e8 dec: 647543427637772520 time only: 510cfd00 time only dec: 1359805696 converted: 2013-02-02 12:48:16 |
14 | hex: 08fc89510cfd7de8 dec: 647543427637804520 time only: 510cfd7d time only dec: 1359805821 converted: 2013-02-02 12:50:21 |
15 | hex: 08fc89510cfd00e9 dec: 647543427637772521 time only: 510cfd00 time only dec: 1359805696 converted: 2013-02-02 12:48:16 |
16 | hex: 08fc89510cfd7ce9 dec: 647543427637804265 time only: 510cfd7c time only dec: 1359805820 converted: 2013-02-02 12:50:20 |
17 | hex: 08fc89510cfd00ea dec: 647543427637772522 time only: 510cfd00 time only dec: 1359805696 converted: 2013-02-02 12:48:16 |
18 | hex: 08fc89510cfd7cea dec: 647543427637804266 time only: 510cfd7c time only dec: 1359805820 converted: 2013-02-02 12:50:20 |
19 | hex: 08fc89510cfdf9ea dec: 647543427637836266 time only: 510cfdf9 time only dec: 1359805945 converted: 2013-02-02 12:52:25 |
20 | hex: 08fc89510cfd7ceb dec: 647543427637804267 time only: 510cfd7c time only dec: 1359805820 converted: 2013-02-02 12:50:20 |
21 | hex: 08fc89510cfdf9eb dec: 647543427637836267 time only: 510cfdf9 time only dec: 1359805945 converted: 2013-02-02 12:52:25 |
22 | hex: 08fc89510cfd7bec dec: 647543427637804012 time only: 510cfd7b time only dec: 1359805819 converted: 2013-02-02 12:50:19 |
23 | hex: 08fc89510cfdf8ec dec: 647543427637836012 time only: 510cfdf8 time only dec: 1359805944 converted: 2013-02-02 12:52:24 |
24 | hex: 08fc89510cfd7bed dec: 647543427637804013 time only: 510cfd7b time only dec: 1359805819 converted: 2013-02-02 12:50:19 |
25 | hex: 08fc89510cfdf7ed dec: 647543427637835757 time only: 510cfdf7 time only dec: 1359805943 converted: 2013-02-02 12:52:23 |
26 | hex: 08fc89510cfd7bee dec: 647543427637804014 time only: 510cfd7b time only dec: 1359805819 converted: 2013-02-02 12:50:19 |
27 | hex: 08fc89510cfdf7ee dec: 647543427637835758 time only: 510cfdf7 time only dec: 1359805943 converted: 2013-02-02 12:52:23 |
28 | hex: 08fc89510cfd7aef dec: 647543427637803759 time only: 510cfd7a time only dec: 1359805818 converted: 2013-02-02 12:50:18 |
29 | hex: 08fc89510cfdf7ef dec: 647543427637835759 time only: 510cfdf7 time only dec: 1359805943 converted: 2013-02-02 12:52:23 |
30 | hex: 08fc89510cfd7af0 dec: 647543427637803760 time only: 510cfd7a time only dec: 1359805818 converted: 2013-02-02 12:50:18 |
31 | hex: 08fc89510cfdf7f0 dec: 647543427637835760 time only: 510cfdf7 time only dec: 1359805943 converted: 2013-02-02 12:52:23 |
32 | hex: 08fc89510cfd7af1 dec: 647543427637803761 time only: 510cfd7a time only dec: 1359805818 converted: 2013-02-02 12:50:18 |
33 | hex: 08fc89510cfdf6f1 dec: 647543427637835505 time only: 510cfdf6 time only dec: 1359805942 converted: 2013-02-02 12:52:22 |
34 | hex: 08fc89510cfd78f2 dec: 647543427637803250 time only: 510cfd78 time only dec: 1359805816 converted: 2013-02-02 12:50:16 |
35 | hex: 08fc89510cfdf6f2 dec: 647543427637835506 time only: 510cfdf6 time only dec: 1359805942 converted: 2013-02-02 12:52:22 |
36 | hex: 08fc89510cfd79f3 dec: 647543427637803507 time only: 510cfd79 time only dec: 1359805817 converted: 2013-02-02 12:50:17 |
37 | hex: 08fc89510cfdf5f3 dec: 647543427637835251 time only: 510cfdf5 time only dec: 1359805941 converted: 2013-02-02 12:52:21 |
38 | hex: 08fc89510cfd78f4 dec: 647543427637803252 time only: 510cfd78 time only dec: 1359805816 converted: 2013-02-02 12:50:16 |
39 | hex: 08fc89510cfdf5f4 dec: 647543427637835252 time only: 510cfdf5 time only dec: 1359805941 converted: 2013-02-02 12:52:21 |
40 | hex: 08fc89510cfd78f5 dec: 647543427637803253 time only: 510cfd78 time only dec: 1359805816 converted: 2013-02-02 12:50:16 |
41 | hex: 08fc89510cfdf4f5 dec: 647543427637834997 time only: 510cfdf4 time only dec: 1359805940 converted: 2013-02-02 12:52:20 |
42 | hex: 08fc89510cfd77f6 dec: 647543427637802998 time only: 510cfd77 time only dec: 1359805815 converted: 2013-02-02 12:50:15 |
43 | hex: 08fc89510cfdf5f6 dec: 647543427637835254 time only: 510cfdf5 time only dec: 1359805941 converted: 2013-02-02 12:52:21 |
44 | hex: 08fc89510cfd77f7 dec: 647543427637802999 time only: 510cfd77 time only dec: 1359805815 converted: 2013-02-02 12:50:15 |
45 | hex: 08fc89510cfdf4f7 dec: 647543427637834999 time only: 510cfdf4 time only dec: 1359805940 converted: 2013-02-02 12:52:20 |
46 | hex: 08fc89510cfd76f8 dec: 647543427637802744 time only: 510cfd76 time only dec: 1359805814 converted: 2013-02-02 12:50:14 |
47 | hex: 08fc89510cfdf3f8 dec: 647543427637834744 time only: 510cfdf3 time only dec: 1359805939 converted: 2013-02-02 12:52:19 |
48 | hex: 08fc89510cfd76f9 dec: 647543427637802745 time only: 510cfd76 time only dec: 1359805814 converted: 2013-02-02 12:50:14 |
49 | hex: 08fc89510cfdf3f9 dec: 647543427637834745 time only: 510cfdf3 time only dec: 1359805939 converted: 2013-02-02 12:52:19 |
50 | hex: 08fc89510cfd75fa dec: 647543427637802490 time only: 510cfd75 time only dec: 1359805813 converted: 2013-02-02 12:50:13 |
51 | hex: 08fc89510cfdf2fa dec: 647543427637834490 time only: 510cfdf2 time only dec: 1359805938 converted: 2013-02-02 12:52:18 |
52 | hex: 08fc89510cfd75fb dec: 647543427637802491 time only: 510cfd75 time only dec: 1359805813 converted: 2013-02-02 12:50:13 |
53 | hex: 08fc89510cfdf2fb dec: 647543427637834491 time only: 510cfdf2 time only dec: 1359805938 converted: 2013-02-02 12:52:18 |
54 | hex: 08fc89510dfd7600 dec: 647543427654579712 time only: 510dfd76 time only dec: 1359871350 converted: 2013-02-03 07:02:30 |
55 | hex: 08fc89510dfdf200 dec: 647543427654611456 time only: 510dfdf2 time only dec: 1359871474 converted: 2013-02-03 07:04:34 |
56 | hex: 08fc89510dfd7501 dec: 647543427654579457 time only: 510dfd75 time only dec: 1359871349 converted: 2013-02-03 07:02:29 |
57 | hex: 08fc89510dfdf101 dec: 647543427654611201 time only: 510dfdf1 time only dec: 1359871473 converted: 2013-02-03 07:04:33 |
58 | hex: 08fc89510dfd7402 dec: 647543427654579202 time only: 510dfd74 time only dec: 1359871348 converted: 2013-02-03 07:02:28 |
59 | hex: 08fc89510dfdf102 dec: 647543427654611202 time only: 510dfdf1 time only dec: 1359871473 converted: 2013-02-03 07:04:33 |
60 | hex: 08fc89510dfd7403 dec: 647543427654579203 time only: 510dfd74 time only dec: 1359871348 converted: 2013-02-03 07:02:28 |
61 | hex: 08fc89510dfdf103 dec: 647543427654611203 time only: 510dfdf1 time only dec: 1359871473 converted: 2013-02-03 07:04:33 |
62 | hex: 08fc89510dfd7404 dec: 647543427654579204 time only: 510dfd74 time only dec: 1359871348 converted: 2013-02-03 07:02:28 |
63 | hex: 08fc89510dfdf004 dec: 647543427654610948 time only: 510dfdf0 time only dec: 1359871472 converted: 2013-02-03 07:04:32 |
64 | hex: 08fc89510dfd7305 dec: 647543427654578949 time only: 510dfd73 time only dec: 1359871347 converted: 2013-02-03 07:02:27 |
65 | hex: 08fc89510dfdef05 dec: 647543427654610693 time only: 510dfdef time only dec: 1359871471 converted: 2013-02-03 07:04:31 |
66 | hex: 08fc89510dfd7306 dec: 647543427654578950 time only: 510dfd73 time only dec: 1359871347 converted: 2013-02-03 07:02:27 |
67 | hex: 08fc89510dfdef06 dec: 647543427654610694 time only: 510dfdef time only dec: 1359871471 converted: 2013-02-03 07:04:31 |
68 | hex: 08fc89510dfd7207 dec: 647543427654578695 time only: 510dfd72 time only dec: 1359871346 converted: 2013-02-03 07:02:26 |
69 | hex: 08fc89510dfdef07 dec: 647543427654610695 time only: 510dfdef time only dec: 1359871471 converted: 2013-02-03 07:04:31 |
70 | hex: 08fc89510dfd7108 dec: 647543427654578440 time only: 510dfd71 time only dec: 1359871345 converted: 2013-02-03 07:02:25 |
71 | hex: 08fc89510dfdee08 dec: 647543427654610440 time only: 510dfdee time only dec: 1359871470 converted: 2013-02-03 07:04:30 |
72 | hex: 08fc89510dfd7109 dec: 647543427654578441 time only: 510dfd71 time only dec: 1359871345 converted: 2013-02-03 07:02:25 |
73 | hex: 08fc89510dfdee09 dec: 647543427654610441 time only: 510dfdee time only dec: 1359871470 converted: 2013-02-03 07:04:30 |
74 | hex: 08fc89510dfd710a dec: 647543427654578442 time only: 510dfd71 time only dec: 1359871345 converted: 2013-02-03 07:02:25 |
75 | hex: 08fc89510dfded0a dec: 647543427654610186 time only: 510dfded time only dec: 1359871469 converted: 2013-02-03 07:04:29 |
76 | hex: 08fc89510dfd710b dec: 647543427654578443 time only: 510dfd71 time only dec: 1359871345 converted: 2013-02-03 07:02:25 |
77 | hex: 08fc89510dfdee0b dec: 647543427654610443 time only: 510dfdee time only dec: 1359871470 converted: 2013-02-03 07:04:30 |
78 | hex: 08fc89510dfd710c dec: 647543427654578444 time only: 510dfd71 time only dec: 1359871345 converted: 2013-02-03 07:02:25 |
79 | hex: 08fc89510dfded0c dec: 647543427654610188 time only: 510dfded time only dec: 1359871469 converted: 2013-02-03 07:04:29 |
80 | hex: 08fc89510dfd6f0d dec: 647543427654577933 time only: 510dfd6f time only dec: 1359871343 converted: 2013-02-03 07:02:23 |
81 | hex: 08fc89510dfdec0d dec: 647543427654609933 time only: 510dfdec time only dec: 1359871468 converted: 2013-02-03 07:04:28 |
82 | hex: 08fc89510dfd6f0e dec: 647543427654577934 time only: 510dfd6f time only dec: 1359871343 converted: 2013-02-03 07:02:23 |
83 | hex: 08fc89510dfded0e dec: 647543427654610190 time only: 510dfded time only dec: 1359871469 converted: 2013-02-03 07:04:29 |
84 | hex: 08fc89510dfd6f0f dec: 647543427654577935 time only: 510dfd6f time only dec: 1359871343 converted: 2013-02-03 07:02:23 |
85 | hex: 08fc89510dfdec0f dec: 647543427654609935 time only: 510dfdec time only dec: 1359871468 converted: 2013-02-03 07:04:28 |
86 | hex: 08fc89510dfd7110 dec: 647543427654578448 time only: 510dfd71 time only dec: 1359871345 converted: 2013-02-03 07:02:25 |
87 | hex: 08fc89510dfdef10 dec: 647543427654610704 time only: 510dfdef time only dec: 1359871471 converted: 2013-02-03 07:04:31 |
88 | hex: 08fc89510dfd6e11 dec: 647543427654577681 time only: 510dfd6e time only dec: 1359871342 converted: 2013-02-03 07:02:22 |
89 | hex: 08fc89510dfdeb11 dec: 647543427654609681 time only: 510dfdeb time only dec: 1359871467 converted: 2013-02-03 07:04:27 |
90 | hex: 08fc89510dfd6e12 dec: 647543427654577682 time only: 510dfd6e time only dec: 1359871342 converted: 2013-02-03 07:02:22 |
91 | hex: 08fc89510dfdea12 dec: 647543427654609426 time only: 510dfdea time only dec: 1359871466 converted: 2013-02-03 07:04:26 |
92 | hex: 08fc89510dfd6d13 dec: 647543427654577427 time only: 510dfd6d time only dec: 1359871341 converted: 2013-02-03 07:02:21 |
93 | hex: 08fc89510dfdea13 dec: 647543427654609427 time only: 510dfdea time only dec: 1359871466 converted: 2013-02-03 07:04:26 |
94 | hex: 08fc89510dfd6c14 dec: 647543427654577172 time only: 510dfd6c time only dec: 1359871340 converted: 2013-02-03 07:02:20 |
95 | hex: 08fc89510dfde914 dec: 647543427654609172 time only: 510dfde9 time only dec: 1359871465 converted: 2013-02-03 07:04:25 |
96 | hex: 08fc89510dfd6c15 dec: 647543427654577173 time only: 510dfd6c time only dec: 1359871340 converted: 2013-02-03 07:02:20 |
Irgendwas stimmt da wohl noch nicht xD Aber so wie es scheint, kann man erkennen, dass es zwei Datensätze sind und die neuesten Daten (Uhrzeitmäßig) oben sind, was irgendwie komisch ist...
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.