When trying to read file, I get:
WARNING:2022-06-27 22:21:56,012:datafile.py:517:joulescope.datafile:length was not written, use file length 4293777544
WARNING:2022-06-27 22:22:06,015:datafile.py:549:joulescope.datafile:invalid tag crc: 0x6ba650ae != 0x19ca2a98
WARNING:2022-06-27 22:22:11,636:datafile.py:549:joulescope.datafile:invalid tag crc: 0x6bb372ea != 0x28b51a32
Traceback (most recent call last):
File "…/bin/joulescope", line 8, in <module>
sys.exit(run())
File "…/joulescope/entry_points/runner.py", line 105, in run
return args.func(args)
File "…/joulescope/entry_points/recording.py", line 79, in on_cmd
r = DataReader().open(args.filename)
File "…/joulescope/data_recorder.py", line 466, in open
tag, value = self._f.peek()
File "…/joulescope/datafile.py", line 592, in peek
tag, flags, value, _ = self._read_tag()
File "…/joulescope/datafile.py", line 544, in _read_tag
raise ValueError('File too short')
ValueError: File too short
Looks like it’s trying to read the last (truncated) TLV block and fails.
I also tried patching the code to avoid the error:
$ diff datafie.py.orig datafie.py.patched
544c544,545
< raise ValueError('File too short')
---
> return None, 0, b'', b''
> #raise ValueError('File too short')
$ diff data_recorder.py.orig data_recorder.py.patched
611c611,612
< self._f.advance()
---
> try: self._f.advance()
> except OSError: break
But than the reader would only parse one second (a single block).
Also, here is a run of DataFileReader.pretty_print (i modified it to also print physical file offset):
length was not written, use file length 4293777544
20 SUB 1128
498 MJS 325
5f0 CLS id=0, type=0, start=0, end=0
608 CLS id=1, type=0, start=0, end=8001688
648 ABN 1600000
187058 ABN 1600000
30da68 ABN 1600000
494478 ABN 1600000
61ae88 ABN 1600000
7a1898 CLE 10616
…
ff739c30 CLS id=1, type=0, start=0, end=4293766848
ff739c70 ABN 1600000
ff8c0680 ABN 1600000
ffa47090 ABN 1600000
ffbcdaa0 ABN 1600000
ffd544b0 ABN 1600000
ffedaec0 CLE 10616
ffedd848 CLS id=1, type=0, start=0, end=0
So one thing is that file is truncated, but is it also that all the blocks have start=0?