Skip to content

SkyRC IMAX B6 / B6AC USB data reader

Notifications You must be signed in to change notification settings

labdiy/skyrcimaxb6ac

 
 

Repository files navigation

SkyRC IMAX B6AC USB data reader

This is a copy of the code found here:
http://blog.dest-unreach.be/2012/01/29/imax-b6-charger-protocol-reverse-engineered

The protocol
============

The protocol seems to be fairly simple. Just connecting the charger to PC already produces a stream of bytes. There is no need for the computer to send any requests. I use a simple perl script that opens the serial port in the correct mode and produces the read bytes on STDOUT. The bytestream consists of 74 byte long messages wrapped in curly braces (`{` (0x7b) and `}` (0x7d)).

7B 9E 84 84  D0 85 80 EE  81 81 81 80  81 94 8A 80
81 96 82 8A  82 8E 86 81  81 80 8A 80  8A 80 8C B2
80 82 95 87  CC 80 80 80  80 8D CF 80  BA 83 D8 83
D6 80 80 80  80 80 80 80  80 80 80 80  80 80 80 80
80 80 80 80  80 80 81 8F  A4 38 30 7D
The last two bytes each contain 4 bits of the 8-bit checksum of the first 72 bytes:

(0x9e + 0x84 + … + 0x8f + 0xa4) % 0x100 = 0x80 -> 0x38 0x30
The 72 data-bytes all have their high 0×80 bit set, it only contains 7 bits of data. For the rest of this discussion, I’m only referring to the lower 7 bits of each byte. Here are the data-pieces that I discovered. Byte numbers start at 0 for the first data byte (i.e. 0x9e).

Byte 7 contains part of the state
bit 0×01 is set when charging, clear when discharging
bit 0×10 is set when cycling, clear when single charging or discharging
Byte 8 contains the set NiCd charge current in dA
Byte 9 contains the set NiCd discharge current in dA
Byte 12 contains the set NiMH charge current in dA
Byte 13 contains the set NiMH discharge current in dA
Byte 14, bit 0×01 contains the cycle mode, set for {Charge,Discharge}, clear for {Discharge,Charge}
Byte 15 contains the cycle count
Byte 16 contains the set Li__ charge current in dA
Byte 17 contains the set Li__ charge cell count
Byte 18 contains the set Li__ discharge current in dA
Byte 19 contains the set Li__ discharge cell count
Byte 20 contains the set Pb charge current in dA
Byte 21 contains the set Pb cell count
Byte 22 contains the mode:
0×80: Config
0×81: Li
0×82: NiMH
0×83: NiCd
0×84: Pb
0×85: Save
0×86: Load
Byte 23 contains the running state: bit 0×01 is set when running, cleared when standby
Byte 24 & 25 contain the set NiMH discharge voltage in daV and cV
Byte 26 & 27 contains the set NiCd discharge voltage in daV and cV
Byte 32 & 33 contain the actual current in A and cA
Byte 34 & 35 contain the catual voltage in V and cV
Byte 40 & 41 contain the input voltage in V and cV
Byte 42 & 43 contain the charge in dAh and mAh
Bytes 44 & 45; 46 & 47; 48 & 49; 50 & 51; 52 & 53; 54 & 55 contain the individual Li__ cell voltages in V and cV
Byte 69 contains the time in minutes
Or if you’re lazy, just feed in the bytes into this perl script.

About

SkyRC IMAX B6 / B6AC USB data reader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 73.3%
  • Perl 26.7%