Author Topic: Data Logger  (Read 5067 times)

Ain

  • Enertia Master
  • ***
  • Posts: 41
    • View Profile
Data Logger
« on: December 31, 2012, 01:27:38 AM »
The Empulse R has an 8GB USB flash drive for logging your riding and charging.  When I picked up the bike, I was told I wouldn't be able to make sense of the files, but I figured it might be worth looking anyway while I had the seat off.  There are .DRV files and .CHG files (I'm guessing the obvious - "driving" and "charging").

Logger cable under the seat:





Closeup of the SanDisk 8GB drive:



Here's what the top-level directory looks like on the drive:



Here's what the LOGS directory looks like:



Just in case anyone is motivated to try and figure out what's in the files, I've attached both a .DRV and .CHG file from my data logger (I picked a couple smaller ones).  It's unclear if they're encrypted using any of the SanDisk "Secure Access" stuff, or if they're just in a format designed for whatever program Brammo uses for logging.  There's obviously a structure to them, but it's not in plain text.

It would be fun to figure out what's in the files for any future "do it yourself" diagnostics.

- Ain
2013 Empulse R  (Delivered 12/7/12)
2009 BMW K1300S
2002 MV Agusta F4 Senna

protomech

  • Brammovangelist
  • *****
  • Posts: 1987
    • View Profile
    • ProtoBlog
Re: Data Logger
« Reply #1 on: December 31, 2012, 08:31:26 AM »
Awesome. I'll see if I can update my log decoder.
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

oml

  • Empulse Guru
  • ****
  • Posts: 102
    • View Profile
Re: Data Logger
« Reply #2 on: December 31, 2012, 09:18:58 AM »
im currently trying to analyze the distribution of the bytes.

idea: uniform distribution of bytes would be aequivalent* to encryptioned data

im "a bit" slowed down by the decision to use haskell to write the analyzer, but I want to work on my haskellskills :D

@ protomech: could you consider showing the sourcecode to your old analyzer? I would try to implement it myself (in haskell) for the first reason, and cant use your .exe as second reason (using linux here).


---
* not in hard binarian logic of course, which is sadly impossible to use in real life.

protomech

  • Brammovangelist
  • *****
  • Posts: 1987
    • View Profile
    • ProtoBlog
Re: Data Logger
« Reply #3 on: December 31, 2012, 09:57:36 AM »
Yep, it's a couple of posts down in that thread. C# code.

Quick glance through the .DRV file shows a much less regular structure than the Enertia logs.
« Last Edit: December 31, 2012, 10:06:26 AM by protomech »
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

oml

  • Empulse Guru
  • ****
  • Posts: 102
    • View Profile
Re: Data Logger
« Reply #4 on: December 31, 2012, 11:14:05 AM »
well, my 5h-oneliner is now ready :D

[florian@frankenstein haskell]$ ./brammoLogAnalyzer < ~/Downloads/41875A2F.CHG
[47159,2061,2024,661,795,2051,1666,2436,770,1958,1005,2013,1955,328,6605,181,530,2065,4241,168,64,34,210,695,695,640,0,177,8,2,93,143,172,341,240,46,37,87,319,330,36,52,0,0,0,181,18,0,1175,412,216,208,210,214,247,315,2206,33,175,0,1928,12,1929,0,495,34,384,386,209,385,208,33,33,125,89,0,0,1382,18,0,38,33,36,33,33,23,373,24,203,972,368,1278,83,242,185,483,695,717,159,0,175,24,0,0,0,0,0,0,27,0,0,0,0,0,319,0,175,0,0,0,0,79,0,0,0,525,0,175,1412,0,0,0,1,524,7,175,0,0,0,0,0,1,0,0,0,0,0,171,0,0,0,0,0,0,32,0,0,0,0,0,101,0,0,0,0,0,0,15,0,0,0,0,0,5,0,0,2,0,0,93,434,2,0,0,0,0,7,0,0,0,0,0,175,76,0,0,0,0,0,39,0,0,0,0,0,0,63,0,0,0,0,22,85,94,433,74,27,115,69,2,0,0,0,2,119,94,0,349,0,0,0,0,57,172,0,0,0,261,57,0,0,0,0,43,46,154,45,1225,0,0,8,37,36,35,35,847]

thats the number of occurences of a byte with the intvalue of the index in this list. I think we are looking at unencrypted and uncomprehended data.
<edit> But why are there the encryptiontools on the stick? </edit>

most important part: haskellskillz +1 :D



<edit>@ protomech: thanks, didnt read your previous posts any farther. whupps :D </edit>
« Last Edit: December 31, 2012, 11:18:49 AM by oml »

Ain

  • Enertia Master
  • ***
  • Posts: 41
    • View Profile
Re: Data Logger
« Reply #5 on: December 31, 2012, 11:20:27 AM »
I realized afterward that my bike's VIN number was visible in the clear at the top of the .DRV file, so it might be looking like binary data and not encrypted data.

- Ain
2013 Empulse R  (Delivered 12/7/12)
2009 BMW K1300S
2002 MV Agusta F4 Senna

protomech

  • Brammovangelist
  • *****
  • Posts: 1987
    • View Profile
    • ProtoBlog
Re: Data Logger
« Reply #6 on: December 31, 2012, 11:35:56 AM »
Yes. Here's a snippet from the charging file:

Code: [Select]
3c1212071117003e49ff2807000000000000000000000000003c2020202020203e56353152554235353658444130303030323500
3c1212071117003e4330322e30312e373130312e30322e303430312e30312e323138372e30302e343530312e30312e32312d2d2e2d2d2e2d2d30312e30312e323130312e30302e313630352e30302e3232

3c1212071117003e440000000000000000000000000000000159
3c1212071117003e423a38383838383800160100000000000064008000000000002d740000007f00004e4a00000f0e010e87004500004272610e060e070e070e040e060e0a0e080e050e010e040e080e050e040e090e080e050e050e080e090e050e080e0a0e0a0e070e0c0e0f0e0d0e090e060e060e060e06ffe3ffe30000ffe3ffed0000ffe30000595b595a5d5e5f006060606061616200

3c1212071117003e4600000000000000c0858585b4b4b47d7d7d5e5e5e010d0d010101050505010102585858
3c1212071117003e4500000100000040ff0303000000e8030110120100d60b43561000001bd60b4356

3c1212071117003e4d3130a0000000000537f500040bd5220000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117003e4d3231300000000005382700020be1260000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117003e4d3330ee0000000005384000040bd3260000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117003e4d3430930000000005385900020bda210000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117003e4d3530c70000000005385900020bf6210000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117003e4d3630790000000005380e00020bff200000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117003e4d3730720000000005382700020c0a1e0000000000005b00f700000000000000000000090c06020002800000000000

3c1212071117013e440000000000000000000000000000000159
3c1212071117013e423a38383838383800160100000000000064008000000000002d740000007f00004e4a00000f0e010e87004500004272610e060e070e070e040e060e0a0e080e050e010e040e080e050e040e090e080e050e050e080e090e050e080e0a0e0a0e070e0c0e0f0e0d0e090e060e060e060e06ffe3ffe30000ffe3ffed0000ffe30000595b595a5d5e5f006060606061616200

3c1212071117013e4600000000000000c0858585b4b3b47d7d7d5e5e5e030202010101050505010101585858
3c1212071117013e4500000100000040ff0303000000e8030110120100d60b43561000001bd60b4356

3c1212071117013e4d313093000000000537f500040bd5220000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117013e4d3231300000000005382700020be1260000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117013e4d3330ee0000000005380e00040bd3280000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117013e4d34309a0000000005385900020bda210000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117013e4d3530c10000000005384000020bf6220000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117013e4d363065000000000537f500020bff1f0000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117013e4d37306c000000000537f500020c0a1e0000000000005b00f700000000000000000000090c06020002800000000000

3c1212071117023e440000000000000000000000000000000159
3c1212071117023e423a38383838383800160100000000000064008000000000002d740000007f00004e4a00000f0e010e87004500004272610e060e070e080e040e070e0b0e080e060e010e040e080e050e040e090e080e050e050e090e090e060e080e0a0e0a0e070e0c0e0f0e0d0e090e060e060e060e0600000000ffedffe30000000000000000595b595a5d5e5f006060606061616200

3c1212071117023e4600000000000000c0858585b4b4b47d7d7d5e5e5e010107010101050506020202585858
3c1212071117023e4500000100000040ff0303000000e9030110120100d60b43561000001bd60b4356

3c1212071117023e4d313093000000000537f500040bd5220000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117023e4d3231360000000005382700020be1260000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117023e4d3331020000000005384000040bd3260000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117023e4d3430930000000005384000020bda210000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117023e4d3530c70000000005384000020bf6210000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117023e4d3630580000000005380e00020bff200000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117023e4d3730790000000005382700020c0a1e0000000000005b00f700000000000000000000090c06020002800000000000

3c1212071117033e440000000000000000000000000000000159
3c1212071117033e423a38383838383800160100000000000064008000000000002d740000007f00004e4a00000f0e010e87004500004272610e060e070e080e040e070e0b0e080e060e010e040e080e050e040e090e080e050e050e090e090e060e080e0a0e0a0e070e0c0e0f0e0d0e090e060e060e060e0600000000ffedffe30000000000000000595b595a5d5e5f006060606061616200

3c1212071117033e4600000000000000c0858585b4b4b37d7d7d5e5e5e080104010101050505010101585858
3c1212071117033e4500000100000040ff0303000000e9030110120100d60b43561000001bd60b4356

3c1212071117033e4d3130a0000000000537f500040bd5220000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117033e4d3231290000000005382700040be1260000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117033e4d3330e80000000005384000040bd3260000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117033e4d3430c10000000005384000020bda210000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117033e4d3530c10000000005384000040bf6210000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117033e4d363058000000000537f500020bff1f0000000000005b00f700000000000000000000090c06020002800000000000
3c1212071117033e4d3730790000000005380e00020c0a1e0000000000005b00f700000000000000000000090c06020002800000000000

Line returns added by me to show structure.

Probably the 3c121207 bit is a datetime structure, as in the Enertia log files. So perhaps not as irregular as I supposed.

Edit: I'm assuming the grouping of 7 records there are the 7 battery modules.
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

oml

  • Empulse Guru
  • ****
  • Posts: 102
    • View Profile
Re: Data Logger
« Reply #7 on: December 31, 2012, 11:47:37 AM »
ain: could you provide us with a charging log with a external measured date?

like charging it for 5 minutes giving us the new log file :)

bwt, I think those 7-blocks are every 10 seconds.

> 3c1212071117-003-e4d3...
> 3c1212071117-013-e4d3...
etc

protomech

  • Brammovangelist
  • *****
  • Posts: 1987
    • View Profile
    • ProtoBlog
Re: Data Logger
« Reply #8 on: December 31, 2012, 11:56:06 AM »
The header looks the same as the Enertia log file.

3c 3e bracket the datetime group.

3c 12 12 07 11 17 00 3e
=
2012 Dec 07 11:17:00

You can see this btw where it skips from

3c1212071117593e
to
3c1212071118003e

One group of log samples every second, which explains the large file sizes.
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

protomech

  • Brammovangelist
  • *****
  • Posts: 1987
    • View Profile
    • ProtoBlog
Re: Data Logger
« Reply #9 on: December 31, 2012, 12:05:41 PM »
Ain,

Can you verify that 41875A2F.CHG has a creation/modification date in the filesystem around Dec 7 11:17?
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

oml

  • Empulse Guru
  • ****
  • Posts: 102
    • View Profile
Re: Data Logger
« Reply #10 on: December 31, 2012, 12:17:20 PM »
One group of log samples every second, which explains the large file sizes.

With ~10 lines per group that would mean 100 seconds charging in that file. Thats not much.
Given a consumption of 1kb / s it also would mean it would run out of memory after just 90 days of consecutive charging :D

"Insert new device to charge" :D

protomech

  • Brammovangelist
  • *****
  • Posts: 1987
    • View Profile
    • ProtoBlog
Re: Data Logger
« Reply #11 on: December 31, 2012, 12:29:36 PM »
Edit: Whoops, forgot I was looking at hex characters and not bytes.

Approximately 650 bytes/second of charging. A full 3.5 hour charge would write around 8 MB of logs, or about 2.3 MB/hour, which seems to be more or less consistent with his directory screencapture above.

His CHG file sizes are 3.1 MB, 2 KB, 1.4 MB, 1.4 MB, 10.8 MB.

I'm assuming the 10.8 MB log file is very close to a full charge + balance.

Probably if the device approaches a full state then it will erase older log files. It probably writes at a much reduced rate once it enters a sustain mode - look at the 1.4 MB charge file, which I assume was generated from a ~44 hour charge.
« Last Edit: December 31, 2012, 12:40:08 PM by protomech »
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

Gavin

  • Brammovangelist
  • *****
  • Posts: 2652
    • View Profile
    • Sol Power.  BrammoBlog
Re: Data Logger
« Reply #12 on: December 31, 2012, 04:32:22 PM »
Hackers Unite....


It's fun to see you two having such a good time with freaking numerical gibberish :)

And while I assume Brammo looks at some of that info as proprietary, well once the bikes are in the wild, the geeks are gonna play...

Me? I killed way too many brain cells in college...I was hacking mainframes on campus at 12...by 19 the only numbers I was crunching were phone numbers of all the pretty ladies**

Gavin




Ain

  • Enertia Master
  • ***
  • Posts: 41
    • View Profile
Re: Data Logger
« Reply #13 on: December 31, 2012, 04:33:17 PM »
Ain,

Can you verify that 41875A2F.CHG has a creation/modification date in the filesystem around Dec 7 11:17?

Correct - thats the 12/7 11:17am file!  It was only plugged into for a few minutes on that charge.

The forum only lets me attached small files (<500 bytes) which is why I picked a couple smaller ones.

A "full" charge can generate a 30MB file, so it's obviously logging pretty frequently while charging.

Edit: I'm assuming the grouping of 7 records there are the 7 battery modules.

It also looks like there are some repeating numbers in the 7-line groupings, so I wouldn't be surprised if there's a serial number in there for each battery module.  There are stickers on the top of each module, so I'll see if I can grab a photo of one next time I have the seat off.  That might unravel one more field.

- Ain
« Last Edit: December 31, 2012, 04:39:12 PM by Ain »
2013 Empulse R  (Delivered 12/7/12)
2009 BMW K1300S
2002 MV Agusta F4 Senna

protomech

  • Brammovangelist
  • *****
  • Posts: 1987
    • View Profile
    • ProtoBlog
Re: Data Logger
« Reply #14 on: December 31, 2012, 06:35:18 PM »
Source/binary distribution attached.

I haven't been able to pull much useful yet out of the log files, but it does appear to log bank voltages (1..28) and pack voltage. I would assume there would be some throttle positions, speeds, ambient temperatures, module temperature, regen mode, sport mode switch, etc logged in there as well.

Here's an example data record with my interpretation:

Code: [Select]
Hex string representing a single log record:
3c1212071117013e423a38383838383800160100000000000064008000000000
002d740000007f00004e4a00000f0e010e87004500004272610e060e070e070e
040e060e0a0e080e050e010e040e080e050e040e090e080e050e050e080e090e
050e080e0a0e0a0e070e0c0e0f0e0d0e090e060e060e060e06ffe3ffe30000ff
e3ffed0000ffe30000595b595a5d5e5f006060606061616200

Broken down into parts:
3c1212071117013e
'<', YYMMDDHHMMSS, '>' date time tag

42
block id

3a383838383838001601000000000000
unknown data, often invariant

64
pack voltage? (seems to vary as the sum of cell voltages)

008000000000002d740000007f00004e4a00000f0e010e8700450000427261
unknown data, often invariant

0e060e070e070e040e060e0a0e080e050e010e040e080e050e040e090e080e05
0e050e080e090e050e080e0a0e0a0e070e0c0e0f0e0d0e090e060e060e060e06
32 16bit values, seems to represent 28 bank voltages in millivolts + bank 1 repeated 4 times

ffe3ffe30000ffe3ffed0000ffe30000595b595a5d5e5f006060606061616200
unknown data, often invariant

You can edit the Log Settings.xml to add new values if you identify them. The XML file contains a series of "blocks" with an associated id tag. Each block type seems to have a consistent record structure.

The charge and discharge logs share block ids, or at least both logs contain the bank voltage records.
« Last Edit: December 31, 2012, 06:40:10 PM by protomech »
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/