ElectricMotorcycleForum.com

  • November 24, 2024, 03:59:36 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: [1]

Author Topic: Log parser for SR/F  (Read 625 times)

stevenh

  • Sr. Member
  • ****
  • Posts: 398
  • Newington NH
    • View Profile
Log parser for SR/F
« on: October 10, 2019, 05:40:33 AM »

I've tried both the online and python local log parsers on the SR/F MBB logs, and they seem to get very little from the log file before getting errors:

 (Traceback (most recent call last):
  File "zero_log_parser.py", line 855, in <module>
    parse_log(log_file, output_file)
  File "zero_log_parser.py", line 830, in parse_log
    f.write(' {line:05d}     {time:>19s}   {event}\n'.format(**entry))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u022f' in position 0: ordinal not in range(128))

Any one else had any luck?  I was trying to see if the log had the firmware version in it somewhere.

Steve
Logged
2020 SR/F Premium
2022 Ioniq 5 SEL

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: Log parser for SR/F
« Reply #1 on: October 11, 2019, 05:22:19 AM »

So, the method by which log parsers were made correct was to compare encoded log files to decoded log files. That means submitting them to Zero for decoding, at least once, for a baseline official comparison that covers common entries. Uncommon entries then require investigation which might work without official feedback.

Otherwise you’ll need to do some serious binary forensics.

We don’t know whether the SR/F AKA Cipher III log format is substantially the same or not.

Maybe if you post the file, multiple people can take a stab at decoding it. Note that it will contain your vehicle’s VIN and related details. The online log parser does collect those files for reference, but the site owner might take time before noticing and looking into it.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

stevenh

  • Sr. Member
  • ****
  • Posts: 398
  • Newington NH
    • View Profile
Re: Log parser for SR/F
« Reply #2 on: October 11, 2019, 07:34:36 PM »

So, the method by which log parsers were made correct was to compare encoded log files to decoded log files. That means submitting them to Zero for decoding, at least once, for a baseline official comparison that covers common entries. Uncommon entries then require investigation which might work without official feedback.

Otherwise you’ll need to do some serious binary forensics.

We don’t know whether the SR/F AKA Cipher III log format is substantially the same or not.

Maybe if you post the file, multiple people can take a stab at decoding it. Note that it will contain your vehicle’s VIN and related details. The online log parser does collect those files for reference, but the site owner might take time before noticing and looking into it.

I was able to correct for that error by editing line 830 of the python to add a encode('ascii', 'ignore') on the entry['event'] element.  I have a lot more data now...

from: f.write(' {0:05d}     {1:>19s}   {event}\n'.format(**entry))
to: f.write(' {0:05d}     {1:>19s}   {2}\n'.format(entry['line'], entry['time'], entry['event'].encode('ascii', 'ignore')))

I am sure there is a better way, I'm not much of a python guy...

Steve
Logged
2020 SR/F Premium
2022 Ioniq 5 SEL

stevenh

  • Sr. Member
  • ****
  • Posts: 398
  • Newington NH
    • View Profile
Re: Log parser for SR/F
« Reply #3 on: October 11, 2019, 07:58:15 PM »

Brian, Here are a few of the new unknown elements:

Code: [Select]
#0x48: unknown, ?, 20191009_22.08_x_MB, 0x48 0xf0 0x8a 0x0c 0x00 0x35 0xfc 0x43 0x68 0x61 0x72 0x67 0x65 0x72 0x00 0x00 0x00 0x80 0x04 0x06 0x9e 0x01 0x00 0xbc 0x16 0x25 0x35 0x48 0xe8 0x01 0x00 0x06 0x09 0x6e 0xa8 0x16 0x3c 0x4d 0x10 0x65 0x00 0xa8 0x3a 0x1c 0x00 0x09 0x00 0xd2 0xb8 0x01 0x00 0x65 0xe2 0x06 0x00 0x01 0x43 0x68 0x61 0x72 0x67 0x65 0x72 0x00 0x00 0x00 0x80 0x04 0xca 0x9d 0x01 0x00 0xbb 0x16 0x2c 0x35 0x48 0xe8 0x01 0x00 0x06 0x09 0x6e 0xa8 0x16 0x3c 0x4c 0x11 0x65 0x00 0x92 0x3a 0x1c 0x00 0x09 0x00 0xd2 0xb8 0x01 0x00 0x83 0xe2 0x06 0x00 0x01 ???
#0x49: unknown, ?, 20191009_22.08_x_MB, 0x49 0x40 0x13 0x02 0x00 0x6d 0xfc 0x98 0xca 0x01 0x00 0x80 0x00 0x5a 0xec 0x2c 0x33 0x2b 0x00 0x00 0x00 0x00 0x52 0x2b 0x00 0x20 0x01 0x0c 0x10 0x9e 0x01 0x00 ???
#0x4b: unknown, ?, 20191009_22.08_x_MB, 0x4b 0xf8 0x71 0x09 0x00 0x69 0xfc 0x01 0x00 0x00 0x00 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x52 0xb2 0xaf 0x01 0x00 0x4d 0xd0 0xff 0xff 0x43 0x48 0x52 0x47 0x00 0x00 0x00 0x00 0x00 0xaf 0x00 ???
#0x4c: unknown, ?, 20191009_22.08_x_MB, 0x4c 0x40 0x13 0x02 0x00 0x6c 0xfc 0x01 0x00 0x00 0x00 0x09 0xd4 0x0c 0x08 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x52 0xa2 0xb0 0x01 0x00 0xa3 0xd1 0xff 0xff 0x43 0x48 0x52 0x47 0x00 0x00 0x00 0x00 0x00 0xaf 0x00 0xa7 0xa5 0xa5 0xa5 0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x15 0x00 0x00 0x00 0x14 0x00 0x00 0x00 0x01 0x01 0xe4 ???
#0x4d: unknown, ?, 20191009_22.08_x_MB, 0x4d 0x18 0x61 0x04 0x00 0x5c 0xfc 0x01 0x00 0x00 0x00 0x1f 0x00 0x00 0x00 0xf1 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x4e 0x38 0xab 0x01 0x00 0x8b 0xd0 0xff 0xff 0x43 0x48 0x52 0x47 0x00 0x00 0x00 0x00 0x00 0xa6 0x00 0x0e 0xd4 0x0c 0x08 0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x14 0x00 0x00 0x00 0x13 0x00 0x00 0x00 0x01 0x01 0xe4 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ???
#0x4f: unknown, ?, 20191009_22.08_x_MB, 0x4f 0x10 0x03 0x06 0x00 0x30 0xfc 0x43 0x41 0x4e 0x31 0x74 0x78 0x51 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0xbe 0x00 0x00 0x00 ???

I am guessing 4b, and 48 are battery/system updates during riding based on the logs (lots of repeats during times I would have been riding).

Steve
« Last Edit: October 11, 2019, 11:01:06 PM by Shadow »
Logged
2020 SR/F Premium
2022 Ioniq 5 SEL

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: Log parser for SR/F
« Reply #4 on: October 16, 2019, 09:31:12 PM »

Well, it can’t hurt to ask Zero for a decoded log to jumpstart this process. But maybe comparing to ride events on an S/DS model would be enough.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: Log parser for SR/F
« Reply #5 on: November 06, 2019, 10:13:08 PM »

Can someone paste what they decoded from the logs before the errors started? I have some vague indication that there’s a context-sensitive transition in the format and want to see what shows up before things get dicey.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS
Pages: [1]