ElectricMotorcycleForum.com

Makes And Models => Zero Motorcycles Forum | 2013+ => Topic started by: BrianTRice@gmail.com on February 22, 2020, 12:19:42 AM

Title: Zero Log Parsing for 2017+ models
Post by: BrianTRice@gmail.com on February 22, 2020, 12:19:42 AM
This is a technical assistance request for owners of Zero models in the S+DS and FX/FXS platforms made on or after 2017.


Background:
The unofficial log parser is a community project to help owners decode Zero logs. The code is at:
https://github.com/zero-motorcycle-community/zero-log-parser/
and the service that uses it is at:
http://home.hasslers.net/zerologparser/


There is a format change that Zero introduced to the log header, currently documented as a bug:
https://github.com/zero-motorcycle-community/zero-log-parser/issues/15


I introduced a change recently to help address this, BUT we are missing files that help us understand how Zero decodes those logs, and this ultimately prevents us from a correct interpretation of those logs.


In this way, BTW, the unofficial log parser has become a victim of its own success, because it was built by emulating the output that Zero provides to owners when they share their logs with customer service. Because the unofficial log parser has become so commonplace to use and mostly correct, this process of correction stalled.


So, I'm looking for volunteers who can send me text-file logs that Zero has provided to them, NOT unofficial log parse text-file logs, so that we can compare and correct the unofficial log parser. Obviously, the original log (that ends in .bin) will also be helpful.


You can email me at (my forum handle) at gmail.com to avoid sharing it publicly and also to avoid forum attachment size limits.


Thanks!
Title: Re: Zero Log Parsing for 2017+ models
Post by: MrBlc on April 22, 2020, 08:50:23 PM
*bump*
is this the reason for this error?:
File "zero_log_parser.py", line 74
    def decode_str(log_text_segment: bytearray) -> str:
                                   ^
SyntaxError: invalid syntax
Title: Re: Zero Log Parsing for 2017+ models
Post by: BrianTRice@gmail.com on April 22, 2020, 10:16:55 PM
*bump*
is this the reason for this error?:
File "zero_log_parser.py", line 74
    def decode_str(log_text_segment: bytearray) -> str:
                                   ^
SyntaxError: invalid syntax


No, that's because you're using it with Python 2, which we've migrated off of because it's now deprecated. Please run it with Python 3.

The issue is that the header byte structure was changed significantly, and we have no official parsed logs from Zero to compare and emulate. That's how the log parser was built in the first place, and this process is now broken or non-existent anyway.
Title: Re: Zero Log Parsing for 2017+ models
Post by: MrBlc on April 23, 2020, 01:49:32 AM
To be honest i wanted to have a reason to bump the thread for you, and i just happened to get that error.
Weirdly enough i had installed python3, but you were right (as usual).
Thank you for quick reply :)
Title: Re: Zero Log Parsing for 2017+ models
Post by: BrianTRice@gmail.com on April 23, 2020, 03:09:06 AM
Okay, I'm glad someone is paying attention, because this does concern me. Access to bike data is important for owners to be able to independently understand and verify claims from the manufacturer and service technicians. We need to understand how our bikes operate (and how they sometimes fail!).

The specific request I have is: if you own a 2017+ year model, please get Zero customer service to send you a decoded log, and send me or someone who can work on the Python code your binary and decoded text log so we can understand what is contained in this header so we can emulate Zero's tools.
Title: Re: Zero Log Parsing for 2017+ models
Post by: MrBlc on April 29, 2020, 12:20:50 PM
Easier said than done.. I was hoping my last error would initiate such a request from customer service, but when i talked to them, he just replied "that error means we need to get the bike in to a shop to read out the diagnostics directly. The information you pull from the app is not enough".
Seems to me that they are aware and try to avoid divulging more information than they have to..
Title: Re: Zero Log Parsing for 2017+ models
Post by: valnar on April 29, 2020, 05:16:30 PM
It seems the easiest way to crack this nut is to have a good relationship with your local Zero dealer.  Maybe just ask them?
Title: Re: Zero Log Parsing for 2017+ models
Post by: BrianTRice@gmail.com on April 30, 2020, 12:56:51 AM
It seems the easiest way to crack this nut is to have a good relationship with your local Zero dealer.  Maybe just ask them?

That's not how the mobile application works. It sends the logs directly to Zero.

But yes, I would invite an owner to ask their dealer for a log decode. We need the actual files, though, not hearsay.
Title: Re: Zero Log Parsing for 2017+ models
Post by: JaimeC on April 30, 2020, 06:08:51 PM
Okay then... here's a stupid question:  Has anyone reached out to Harlan Flagg for this?
Title: Re: Zero Log Parsing for 2017+ models
Post by: BrianTRice@gmail.com on May 01, 2020, 12:44:37 AM
Okay then... here's a stupid question:  Has anyone reached out to Harlan Flagg for this?

They/you could. I'm not going to ask a dealer for one of their customers' logs, though. I'd hope I can ask them for one of their own bikes' logs. So hopefully a customer can ask for their own logs and forward them for study.

For what it's worth, I did get someone to help identify the firmware revision field, and I've inferred the board revision field if someone can run zero_log_parser.py directly to confirm (since Greg Hassler's site is broken lately).
Title: Re: Zero Log Parsing for 2017+ models
Post by: JaimeC on May 01, 2020, 04:22:07 AM
Unfortunately I'm on the other side of the country from Hollywood Electrics... but I'm assuming he has his own Zero, if not he could pull the logs from a demo bike...
Title: Re: Zero Log Parsing for 2017+ models
Post by: BrianTRice@gmail.com on May 01, 2020, 06:41:18 AM
Yeah, dealers can do this. What I need are matching copies of OFFICIALLY decoded and raw logs. Pretty simple, just not something we get access to, which is kind of my point - that Zero may be cutting owners off, and that is not in anyone's best interest, despite it likely appealing to Zero's self-protective nature.
Title: Re: Zero Log Parsing for 2017+ models
Post by: gadgetgirl on May 02, 2020, 09:49:38 AM
This may be old news, but I was told by Zero today that they consider decoded logs for my SR/F to be proprietary information, and have a policy to not disclose them.
Title: Re: Zero Log Parsing for 2017+ models
Post by: Crissa on May 02, 2020, 09:53:29 AM
Yes, their position is pretty legally shakey if also common.

-Crissa
Title: Re: Zero Log Parsing for 2017+ models
Post by: Auriga on May 02, 2020, 10:04:34 AM
Yes, their position is pretty legally shakey if also common.

-Crissa

I'm curious why you think it's legally shaky? Other than OBDII information, I'm not sure I've ever been able to access software logs in any vehicle I've owned. Tesla folks have been having this argument too, and it looks like they also have been unsuccessful(except for the crash data recorder).
Title: Re: Zero Log Parsing for 2017+ models
Post by: Crissa on May 02, 2020, 11:46:39 AM
If the documents exist, and they're part of the diagnosis of your vehicle, you have right to them.  It's no different than them being required to furnish you with the broken parts that they replace.

Getting it from them is more difficult, but it's not impossible.  They have to prove why repairs are needed, they also only vaguely have rights to diagnostic data from your vehicle... Courts have not always upheld the user agreements.

-Crissa
Title: Re: Zero Log Parsing for 2017+ models
Post by: BrianTRice@gmail.com on May 04, 2020, 01:55:08 AM
This may be old news, but I was told by Zero today that they consider decoded logs for my SR/F to be proprietary information, and have a policy to not disclose them.

That is not news to me, but it is to the public. I wanted to hear that from another owner before disclosing what I heard privately, for reasons. That is in fact why I started this thread.

Do you have that in writing? May I contact you offline about this?

If the documents exist, and they're part of the diagnosis of your vehicle, you have right to them.  It's no different than them being required to furnish you with the broken parts that they replace.

Getting it from them is more difficult, but it's not impossible.  They have to prove why repairs are needed, they also only vaguely have rights to diagnostic data from your vehicle... Courts have not always upheld the user agreements.

Aside from owner education and curiosity, proving the need for repair is where owners would seem to have a legal stake in the event log and the related data. The complement to proving the need for repair is proving responsibility / causation. The owner, without the logs, cannot prove anything about the operation of the vehicle without live diagnostics. This could become critical if an owner or fleet operator enters litigation with Zero.

I find that this is particularly of concern for items like the motor controller which are the single most expensive component outside the battery case, and are indicated for replacement by (what I can tell) very crude troubleshooting flowcharts provided to dealers by Zero.

If this turns out to be true, I would consider this an alienating act by Zero towards its customer base, and it would make my efforts with the unofficial manual and related tooling more difficult in general. I may reconsider my support for Zero entirely.

I do not have an alternate vendor I can point to with a better policy. I've never seen Energica data, and I expect them to be just as jealous if not moreso about vehicle data.
Title: Re: Zero Log Parsing for 2017+ models
Post by: Crissa on May 04, 2020, 02:05:35 AM
When push comes to shove, Zero so far has relented; but yeah, it's pretty standard in the vehicle industry not to share this data.

Standard, though, does not mean legal.

-Crissa
Title: Re: Zero Log Parsing for 2017+ models
Post by: Auriga on May 04, 2020, 02:17:26 AM
I have a feeling it has to do with what is stored in the logs. I don't think Zero cares at all about whether owners can get a record of a bike's activity, or a list of errors when they occur. I think they probably use the same logs on the new platform to store software outputs. Maybe they have algorithms they are tuning and storing info in the logs. These things could represent the entirety of their advantage over competition with a much larger player.

There should probably be two sets of logs, one accessible  for regular owners and one not for proprietary info.
I think you're right Brian, but the right to repair movement hasn't had much success as of yet. And I suspect there needs to be a middle ground. Especially since vehicles are becoming more like software every day.

Title: Re: Zero Log Parsing for 2017+ models
Post by: BrianTRice@gmail.com on May 04, 2020, 02:52:57 AM
When push comes to shove, Zero so far has relented; but yeah, it's pretty standard in the vehicle industry not to share this data.

Standard, though, does not mean legal.

An owner shouldn't need to serve Zero with a letter from a lawyer or sign an NDA to cooperate.

I have a feeling it has to do with what is stored in the logs. I don't think Zero cares at all about whether owners can get a record of a bike's activity, or a list of errors when they occur. I think they probably use the same logs on the new platform to store software outputs. Maybe they have algorithms they are tuning and storing info in the logs. These things could represent the entirety of their advantage over competition with a much larger player.

There should probably be two sets of logs, one accessible  for regular owners and one not for proprietary info.
I think you're right Brian, but the right to repair movement hasn't had much success as of yet. And I suspect there needs to be a middle ground. Especially since vehicles are becoming more like software every day.

If they don't want to disclose the information, it shouldn't be in the log. Logs are historically a legal record of the state and events encountered by a vessel (nautically, and yes I used to be a US Navy sailor who signed paper logs for nuclear engineering).

Let me explain it thus: whatever we can accomplish, industrial espionage and "blackhat" reverse engineering can do better. I'm trying to support the community in as ethical manner as I can. Zero cannot prevent data exfiltration, but it can make its customers experiences with these motorcycles more difficult.

I am definitely interested in the right to repair as it applies to EVs, and in fact this is one reason I selected and prefer Zero. I may have to vocally renounce my support of Zero and take a different position with regards to them in order to serve the community. This community role is already an unpaid part-time job, and I tire of compensating for Zero's lack of constructive outreach.
Title: Re: Zero Log Parsing for 2017+ models
Post by: BrianTRice@gmail.com on May 04, 2020, 02:58:36 AM
For what it's worth, I have seen decoded SR/F logs, and have examined the binary files. The messages in the logs are just strings, and the log entries are delimited in a funny way but they're not encrypted.

The level of work required to decode logs does not seem to constitute a DMCA violation as such but does require determining a "data dictionary" of the values stored in the header and in the records. As such, any professional reverse engineering effort engaged for industrial espionage will simply disassemble the firmware and simulate/replay CANbus data or operate the bike in a controlled environment to work out the decoding.

What they've done is raise the expense of engaging in this effort, which is nullified the moment the dictionary is filled in for an accessible piece of software. This penalizes the owner (and service technicians not within Zero's network) without impacting competitors.
Title: Re: Zero Log Parsing for 2017+ models
Post by: Crissa on May 04, 2020, 04:41:16 AM
Security by obscurity is not security.

-Crissa