Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read config settings #18

Open
syssi opened this issue Feb 26, 2022 · 38 comments
Open

Read config settings #18

syssi opened this issue Feb 26, 2022 · 38 comments
Labels
enhancement New feature or request

Comments

@syssi
Copy link
Owner

syssi commented Feb 26, 2022

# name(address, desc, format, ratio, unit),
SingleOverWarningVoltage(1, "单体过压警告", 0.001d, "%.3f", "V"),
SingleUnderWarningVoltage(2, "单体欠压警告", 0.001d, "%.3f", "V"),
SingleOverProtectVoltage(3, "单体过压保护", 0.001d, "%.3f", "V"),
SingleUnderProtectVoltage(4, "单体欠压保护", 0.001d, "%.3f", "V"),
SingleOverVoltageRestore(5, "单体过压恢复", 0.001d, "%.3f", "V"),
SingleUnderVoltageRestore(6, "单体欠压恢复", 0.001d, "%.3f", "V"),
TotalOverProtectVoltage(7, "总体过压保护", 0.1d, "%.1f", "V"),
TotalUnderProtectVoltage(8, "总体欠压保护", 0.1d, "%.1f", "V"),
ChargeOverCurrentProtect(9, "充电过流保护", 0.1d, "%.1f", "A"),
ChargeOverCurrentProtectDelay(10, "充电过流保护延时", 1.0d, "%.1f", "秒"),
DischargeOverCurrentProtect(11, "放电过流保护", 0.1d, "%.1f", "A"),
DischargeOverCurrentProtectDelay(12, "放电过流保护延时", 1.0d, "%.1f", "秒"),
BalanceExtremeVoltage(13, "均衡极限电压", 0.001d, "%.3f", "V"),
BalanceControlVoltage(14, "均衡开启电压", 0.001d, "%.3f", "V"),
BalanceVoltageDifferential(15, "均衡开启压差", 0.001d, "%.3f", "V"),
BalanceCurrent(16, "均衡电流", 10.0d, "%.0f", "mA"),
SystemBaseVoltage(17, "系统基准电压", 0.001d, "%.3f", "V"),
CurrentSensorRange(18, "电流传感器量程", 0.1d, "%.1f", "A"),
LaunchCurrent(19, "功率启动电流", 1.0d, "%.0f", "A"),
ShortedPretectCurrent(20, "短路保护电流", 1.0d, "%.0f", "A"),
ShortedPretectDelay(21, "短路保护延时", 1.0d, "%.0f", "us"),
NoCurrentAutoStandbyTime(22, "自动待机时间", 1.0d, "%.0f", "us"),
TotoalAd2RealVoltage(23, "总压调节参数", 1.0d, "%.0f", ""),
BatterySerialNumber(24, "电池串数", 1.0d, "%.0f", "S"),
BatteryOverTemperatureChargeProtect(25, "充电高温保护", 1.0d, "%.0f", "℃"),
BatteryOverTemperatureChargeRestore(26, "充电高温恢复", 1.0d, "%.0f", "℃"),
BatteryOverTemperatureDischargeProtect(27, "放电高温保护", 1.0d, "%.0f", "℃"),
BatteryOverTemperatureDischargeRestore(28, "放电高温恢复", 1.0d, "%.0f", "℃"),
PowertubeOverTemperatureProtect(29, "功率高温保护", 1.0d, "%.0f", "℃"),
PowertubeOverTemperatureRestore(30, "功率高温恢复", 1.0d, "%.0f", "℃"),
BatteryLowCapacity(31, "电池物理容量", 1.0E-6d, "%.3f", "AH"),
BatteryHighCapacity(32, "电池高字节容量", 1.0E-6d, "%.3f", "AH"),
BatteryLeftCapacity(33, "电池剩余容量", 0.001d, "%.3f", "AH"),
BatteryLeftHighBitCapacity(34, "剩余容量高位字节", 0.001d, "%.3f", "AH"),
BatteryTotalCycleCapacity(35, "电池总循环容量", 0.001d, "%.3f", "AH"),
BatteryTotalCycleHighBitCapacity(36, "电池循环容量高位字节", 0.001d, "%.3f", "AH"),
ChargeLowTemperatureProtect(37, "充电低温保护", 1.0d, "%.0f", "℃"),
ChargeLowTemperatureRestore(38, "充电低温恢复", 1.0d, "%.0f", "℃"),
DisChargeLowTemperatureProtect(39, "放电低温保护", 1.0d, "%.0f", "℃"),
DisChargeLowTemperatureRestore(40, "放电低温恢复", 1.0d, "%.0f", "℃"),
TireLength(41, "一周轮胎长度", 1.0d, "%.0f", "mm"),
PauseLength(42, "一周脉冲次数", 1.0d, "%.0f", ""),
AutoShutdownVoltage(43, "自动关机电压", 0.001d, "%.3f", "V"),
SingleDiffVoltageProtect(44, "单体压差保护", 0.001d, "%.3f", "V"),
SlaveNumber(45, "从机模块数", 1.0d, "%.0f", ""),
UnderVoltageComplete(46, "欠压内阻补偿", 0.1d, "%.1f", "mΩ"),
StaticCurrent(47, "静态消耗电流", 0.1d, "%.1f", "mA"),
SensorTemperatureMask(48, "温度传感器屏蔽", 1.0d, "%.0f", ""),
BluetoothAddress(49, "蓝牙地址", 1.0d, "%.0f", ""),
HardwareVersion(90, "固件版本号", 1.0d, "%.0f", ""),
RunningTime(100, "运行时间", 1.0d, "%.0f", ""),
SecondDischargeOverCurrentProtect(162, "二级放电过流保护", 0.1d, "%.0f", "A"),
SecondDischargeOverCurrentProtectDelay(163, "二级放电延时", 1.0d, "%.0f", "us"),
IronLithium(251, "铁锂参数", 1.0d, "%.0f", "N"),
TernaryParameter(Callback.DEFAULT_SWIPE_ANIMATION_DURATION, "三元参数", 1.0d, "%.0f", "V"),
LithiumTitanate(240, "钛酸锂参数", 1.0d, "%.0f", "A"),
FirstSoc(150, "初始SOC", 1.0d, "%.0f", ""),
PasswordCheck(245, "密码校验", 1.0d, "%.0f", ""),
FactorySerialNo(255, "出厂序列号", 1.0d, "%.0f", ""),
SocUnderLimit(255, "SOC过低告警", 1.0d, "%.0f", ""),
DefaultType(255, "", 1.0d, "%.0f", "");

https://github.com/klotztech/VBMS/wiki/Serial-protocol#parameter-addresses

@syssi
Copy link
Owner Author

syssi commented Feb 26, 2022

I don't want to provide sensors here. A service to read and write on address on demand should be sufficient.

@syssi syssi added the enhancement New feature or request label Mar 5, 2022
@bchiu
Copy link

bchiu commented Oct 24, 2022

I could really use the request/response format for reading/writing BMS paramaters on the 2021 version.

@syssi
Copy link
Owner Author

syssi commented Oct 24, 2022

Do you own an ANT-BMS and would you do some testing?

@bchiu
Copy link

bchiu commented Oct 24, 2022

sure but it's not for the esphome...it's for an ev application. it's a web app using (web bluetooth api) and all my protocol configs are in yaml (not hardcoded). i've only gotten as far you. on the pre-2021, i've pretty much got all the functionality.

@bchiu
Copy link

bchiu commented Oct 24, 2022

here is the read request for ParameterConfig > CellHighProtect:

request: 7e a1 02 00 00 02 19 a0 aa 55
response: 7e a1 12 00 00 02 36 10 1f 14 ff 0b 00 00 41 f2 aa 55

7e - start
a1 - address
02 - command
00 - param id
00 - param id
02 - datalen
19 - crc
a0 - crc
aa - end
55 - end

response command always seems to be request command + 0x10 (ie. 0x02 -> 0x12). it looks like the param id's are all different from the pre-2021 ver. the pc app doesn't play nice with my serial port monitor and freezes after a few minutes making decoding verrrrry slow :(

@bchiu
Copy link

bchiu commented Oct 24, 2022

Volt
----
CellHighProtect (V)            7e a1 02 00 00 02 19 a0 aa 55
CellHighRecover (V)            7e a1 02 02 00 02 b8 60 aa 55
Level2CellHighProtect (V)      7e a1 02 04 00 02 58 61 aa 55
Level2CellHighRecover (V)      7e a1 02 06 00 02 f9 a1 aa 55
PackVoltHighProtect (V)        7e a1 02 08 00 02 98 62 aa 55
PackVoltHighRecover (V)        7e a1 02 0a 00 02 39 a2 aa 55

CellLowProtect (V)             7e a1 02 0c 00 02 d9 a3 aa 55
CellLowRecover (V)             7e a1 02 0e 00 02 78 63 aa 55
Level2CellLowProtect (V)       7e a1 02 10 00 02 18 65 aa 55
Level2CellLowRecover (V)       7e a1 02 12 00 02 b9 a5 aa 55
PackVoltLowProtect (V)         7e a1 02 14 00 02 59 a4 aa 55
PackVoltLowRecover (V)         7e a1 02 16 00 02 f8 64 aa 55

CellDiffProtect (V)            7e a1 02 18 00 02 99 a7 aa 55
CellDiffRecover (V)            7e a1 02 1a 00 02 38 67 aa 55
CellHighWarning (V)            7e a1 02 20 00 02 18 6a aa 55
CellHighWarningRecover (V)     7e a1 02 22 00 02 b9 aa aa 55
PackVoltHighWarning (V)        7e a1 02 24 00 02 59 ab aa 55
PackVoltHighWarningRecover (V) 7e a1 02 26 00 02 f8 6b aa 55

CellLowWarning (V)             7e a1 02 28 00 02 99 a8 aa 55   
CellLowWarningRecover (V)      7e a1 02 2a 00 02 38 68 aa 55
PackVoltLowWarning (V)         7e a1 02 2c 00 02 d8 69 aa 55
PackVoltLowWarningRecover (V)  7e a1 02 2e 00 02 79 a9 aa 55
CellDiffWarning (V)            7e a1 02 30 00 02 19 af aa 55
CellDiffWarningRecover (V)     7e a1 02 32 00 02 b8 6f aa 55

Current
-------
C_OverCurProtect (A)           7e a1 02 68 00 02 98 7c aa 55
C_OverCurProtect_Delay (s)     7e a1 02 6a 00 02 39 bc aa 55
D_OverCurProtect (A)           7e a1 02 6c 00 02 d9 bd aa 55
D_OverCurProtect_Delay (s)     7e a1 02 6e 00 02 78 7d aa 55
D_OverCurProtect2 (A)          7e a1 02 70 00 02 18 7b aa 55
D_OverCurProtect2_Delay (s)    7e a1 02 72 00 02 b9 bb aa 55
S_C_Protect (A)                7e a1 02 74 00 02 59 ba aa 55
S_C_Protect_Delay (s)          7e a1 02 76 00 02 f8 7a aa 55

C_OverCurWarning (A)           7e a1 02 7c 00 02 d8 78 aa 55
C_OverCurWarning_Recover (A)   7e a1 02 7e 00 02 79 b8 aa 55
D_OverCurWarning (A)           7e a1 02 80 00 02 18 48 aa 55
D_OverCurWarning_Recover (A)   7e a1 02 82 00 02 b9 88 aa 55

SOCLowLevel1Warning            7e a1 02 84 00 02 59 89 aa 55
SOCLowLevel2Warning            7e a1 02 86 00 02 f8 49 aa 55

Balance
-------
CellBalLimit (V)    7e a1 02 8c 00 02 d8 4b aa 55
CellBalStart (V)    7e a1 02 8e 00 02 79 8b aa 55

CellDiffOn (V)      7e a1 02 90 00 02 19 8d aa 55
CellDiffOff (V)     7e a1 02 92 00 02 b8 4d aa 55

Bal_Current (ma)    7e a1 02 94 00 02 58 4c aa 55
Bal_Chg_Current (A) 7e a1 02 96 00 02 f9 8c aa 55

Pack
----
Pack_ID              7e a1 02 06 01 20 78 28 aa 55    
PackCellType         7e a1 02 98 00 02 98 4f aa 55
CellNumber (S)       7e a1 02 9a 00 02 39 8f aa 55
CellLowR_Cal (mohm)  7e a1 02 9c 00 02 d9 8e aa 55
TurnOffVolt (V)      7e a1 02 9e 00 02 78 4e aa 55
ChargeCurrentReq (A) 7e a1 02 a0 00 02 19 82 aa 55
PhysicalAH (Ah)      7e a1 02 a2 00 04 38 40 aa 55
RemainingAH (Ah)     7e a1 02 a6 00 04 79 81 aa 55
TotalCycleAH (Ah)    7e a1 02 aa 00 04 b9 82 aa 55
SOC_Method           7e a1 02 c4 00 02 58 5d aa 55

Other
-----
TireLength (mm) 7e a1 02 7a 01 02 39 e9 aa 55
PulseValue      7e a1 02 7c 01 02 d9 e8 aa 55
SlaveModuleNum  7e a1 02 7e 01 02 78 28 aa 55

Not implemented:
System 
Factory
GPRS

@syssi
Copy link
Owner Author

syssi commented Oct 25, 2022

Good job!

@syssi
Copy link
Owner Author

syssi commented Oct 25, 2022

Do you like to share some details about the pre-2021 version to read the settings? I would like to collect all protocol details to be able to extend the component.

@bchiu
Copy link

bchiu commented Oct 25, 2022

sure no problem.

read parameter

request: [0x5A, 0x5A, address, 0, 0, address]
response: [0x5A, 0x5A, address, value, crc]

address is the parameter id (uint8). value is uint16. simple crc1 checksum (8bit) is calculated on [address, value]. byte order is big endian. i've provided the list of parameters (id's are decimal values NOT hex).

write parameter

request: [0xA5, 0xA5, address, value, crc, 0xA5, 0xA5, 255, 0, 0, 255]
response: [0x5A, 0x5A, address, value, crc]

parameters

1:  { title: "Cell over-voltage alarm (V)", scale: 0.001, decimals: 2 }
2:  { title: "Cell under-voltage alarm (V)", scale: 0.001, decimals: 2 }
3:  { title: "Cell over-voltage protection (V)", scale: 0.001, decimals: 2 }
4:  { title: "Cell under-voltage protection (V)", scale: 0.001, decimals: 2 }
5:  { title: "Cell over-voltage recovery (V)", scale: 0.001, decimals: 2 }
6:  { title: "Cell under-voltage recovery (V)", scale: 0.001, decimals: 2 }
7:  { title: "Pack over-voltage protection (V)", scale: 0.1, decimals: 2 }
8:  { title: "Pack under-voltage protection (V)", scale: 0.1, decimals: 2 }
9:  { title: "Charge over-current protection (A)", scale: 0.1, decimals: 0 }
10: { title: "Charge over-current protection delay (s)", scale: 1, decimals: 0 }
11: { title: "Discharge over-current protection (A)", scale: 0.1, decimals: 0 }
12: { title: "Discharge over-current protection delay (s)", scale: 1, decimals: 0 }
13: { title: "Balance voltage limit (V)", scale: 0.001, decimals: 2 }
14: { title: "Balance start voltage (V)", scale: 0.001, decimals: 2 }
15: { title: "Balance voltage difference (V)", scale: 0.001, decimals: 2 }
16: { title: "Balance current (mA)", scale: 10, decimals: 0 }
17: { title: "System reference voltage (V)", scale: 0.001, decimals: 2 }
18: { title: "Current sensor max (A)", scale: 0.1, decimals: 0 }
19: { title: "Max startup current (A)", scale: 1, decimals: 0 }
20: { title: "Short-circuit protection current (A)", scale: 0.1, decimals: 0 }
21: { title: "Short-circuit protection delay (µs)", scale: 1, decimals: 0 }
22: { title: "Automatic standby time (s)", scale: 1, decimals: 0 }
23: { title: "Total voltage adjustment (N)", scale: 1, decimals: 0 }
24: { title: "Number of cells in series (N)", scale: 1, decimals: 0 }
25: { title: "Charge temperature protection (°C)", scale: 1, decimals: 0 }
26: { title: "Charge temperature recovery (°C)", scale: 1, decimals: 0 }
27: { title: "Discharge temperature protection (°C)", scale: 1, decimals: 0 }
28: { title: "Discharge temperature recovery (°C)", scale: 1, decimals: 0 }
29: { title: "Mosfet temperature protection (°C)", scale: 1, decimals: 0 }
30: { title: "Mosfet temperature recovery (°C)", scale: 1, decimals: 0 }
31: { title: "Battery physical capacity (Ah)", scale: 1, decimals: 2 }
32: { title: "Battery physical capacity (Ah)", scale: 1, decimals: 2 }
33: { title: "Battery remaining capacity (Ah)", scale: 1, decimals: 2 }
34: { title: "Battery remaining capacity (Ah)", scale: 1, decimals: 2 }
35: { title: "Total accumulated capacity (Ah)", scale: 1, decimals: 2 }
36: { title: "Total accumulated capacity (Ah)", scale: 1, decimals: 2 }
41: { title: "Wheel circumference (mm)", scale: 1, decimals: 0 }
42: { title: "Wheel pulses per revolution (N)", scale: 1, decimals: 0 }
43: { title: "Automatic shutdown voltage (V)", scale: 0.001, decimals: 2 }
44: { title: "Cell voltage differential protection (V)", scale: 0.001, decimals: 2 }
45: { title: "Slave module number (N)", scale: 1, decimals: 0 }
46: { title: "Under-voltage IR compensation (mΩ)", scale: 1, decimals: 0 }
47: { title: "Static consumption current (mA)", scale: 10, decimals: 0 }
48: { title: "Temperature sensor shielding (N)", scale: 1, decimals: 0 }
49: { title: "Bluetooth Address code (N)", scale: 1, decimals: 0 }
51: { title: "Internal resistance cell1 (mΩ)", scale: 1, decimals: 0 }
52: { title: "Internal resistance cell2 (mΩ)", scale: 1, decimals: 0 }
53: { title: "Internal resistance cell3 (mΩ)", scale: 1, decimals: 0 }
54: { title: "Internal resistance cell4 (mΩ)", scale: 1, decimals: 0 }
55: { title: "Internal resistance cell5 (mΩ)", scale: 1, decimals: 0 }
56: { title: "Internal resistance cell6 (mΩ)", scale: 1, decimals: 0 }
57: { title: "Internal resistance cell7 (mΩ)", scale: 1, decimals: 0 }
58: { title: "Internal resistance cell8 (mΩ)", scale: 1, decimals: 0 }
59: { title: "Internal resistance cell9 (mΩ)", scale: 1, decimals: 0 }
60: { title: "Internal resistance cell10 (mΩ)", scale: 1, decimals: 0 }
61: { title: "Internal resistance cell11 (mΩ)", scale: 1, decimals: 0 }
62: { title: "Internal resistance cell12 (mΩ)", scale: 1, decimals: 0 }
63: { title: "Internal resistance cell13 (mΩ)", scale: 1, decimals: 0 }
64: { title: "Internal resistance cell14 (mΩ)", scale: 1, decimals: 0 }
65: { title: "Internal resistance cell15 (mΩ)", scale: 1, decimals: 0 }
66: { title: "Internal resistance cell16 (mΩ)", scale: 1, decimals: 0 }
67: { title: "Internal resistance cell17 (mΩ)", scale: 1, decimals: 0 }
68: { title: "Internal resistance cell18 (mΩ)", scale: 1, decimals: 0 }
69: { title: "Internal resistance cell19 (mΩ)", scale: 1, decimals: 0 }
70: { title: "Internal resistance cell20 (mΩ)", scale: 1, decimals: 0 }
71: { title: "Internal resistance cell21 (mΩ)", scale: 1, decimals: 0 }
72: { title: "Internal resistance cell22 (mΩ)", scale: 1, decimals: 0 }
73: { title: "Internal resistance cell23 (mΩ)", scale: 1, decimals: 0 }
74: { title: "Internal resistance cell24 (mΩ)", scale: 1, decimals: 0 }
90: { title: "Firmware version (N)", scale: 1, decimals: 0 }
162: { title: "Secondary discharge over-current protection (A)", scale: 0.1, decimals: 0 }
163: { title: "Secondary discharge over-current protection delay (mS)", scale: 10, decimals: 0 }

@bchiu
Copy link

bchiu commented Oct 26, 2022

i've got it working now for the new protocol. haven't tested the write parameters yet but it should be straight-forward.

read parameter

request:
0x7E - start1
0xA1 - start2
0x02 - command
address - uint16 parameter id (little endian)
0x02 - data length (usually 2 but 4 in some cases)
crc - crc16modbus
0xAA - end1
0x55 - end2

response:
[0x7E, 0xA1, 0x12, address (uint16), datalen (uint8), value (varies), crc, 0xAA, 0x55]

note: value is uint16 in all cases except for: PhysicalAH, RemainingAH, TotalCycleAH (these are uint32 datalen 4).

i've verified all the values, scales and decimals match those in the Android App. Thanks for sending me the Windows version--that helped a lot. I ended up creating a bluetooth serial port on my PC to connect to the bms. BTW, it seems you need to send the first read parameter request twice or it gets dropped. Subsequent requests do not need to be repeated.

  PARAMETERS: 
    0:   { group: "Voltage", title: "CellHighProtect (V)", scale: 0.001, decimals: 3 }
    2:   { group: "Voltage", title: "CellHighRecover (V)", scale: 0.001, decimals: 3 }
    4:   { group: "Voltage", title: "CellHighProtectL2 (V)", scale: 0.001, decimals: 3 }
    6:   { group: "Voltage", title: "CellHighRecoverL2 (V)", scale: 0.001, decimals: 3 }
    8:   { group: "Voltage", title: "PackVoltHighProtect (V)", scale: 0.1, decimals: 1 }
    10:  { group: "Voltage", title: "PackVoltHighRecover (V)", scale: 0.1, decimals: 1 }
    12:  { group: "Voltage", title: "CellLowProtect (V)", scale: 0.001, decimals: 3 }
    14:  { group: "Voltage", title: "CellLowRecover (V)", scale: 0.001, decimals: 3 }
    16:  { group: "Voltage", title: "CellLowProtectL2 (V)", scale: 0.001, decimals: 3 }
    18:  { group: "Voltage", title: "CellLowRecoverL2 (V)", scale: 0.001, decimals: 3 }
    20:  { group: "Voltage", title: "PackVoltLowProtect (V)", scale: 0.1, decimals: 1 }
    22:  { group: "Voltage", title: "PackVoltLowRecover (V)", scale: 0.1, decimals: 1 }
    24:  { group: "Voltage", title: "CellDiffProtect (V)", scale: 0.001, decimals: 3 }
    26:  { group: "Voltage", title: "CellDiffRecover (V)", scale: 0.001, decimals: 3 }
    32:  { group: "Voltage", title: "CellHighWarning (V)", scale: 0.001, decimals: 3 }
    34:  { group: "Voltage", title: "CellHighWarningRecover (V)", scale: 0.001, decimals: 3 }
    36:  { group: "Voltage", title: "PackVoltHighWarning (V)", scale: 0.1, decimals: 1 }
    38:  { group: "Voltage", title: "PackVoltHighWarningRecover (V)", scale: 0.1, decimals: 1 }
    40:  { group: "Voltage", title: "CellLowWarning (V)", scale: 0.001, decimals: 3 }
    42:  { group: "Voltage", title: "CellLowWarningRecover (V)", scale: 0.001, decimals: 3 }
    44:  { group: "Voltage", title: "PackVoltLowWarning (V)", scale: 0.1, decimals: 1 }
    46:  { group: "Voltage", title: "PackVoltLowWarningRecover (V)", scale: 0.1, decimals: 1 }
    48:  { group: "Voltage", title: "CellDiffWarning (V)", scale: 0.001, decimals: 3 }
    50:  { group: "Voltage", title: "CellDiffWarningRecover (V)", scale: 0.001, decimals: 3 }
    104: { group: "Current", title: "ChargeOverCurProtect (A)", scale: 0.1, decimals: 1 }
    106: { group: "Current", title: "ChargeOverCurProtectDelay (s)", scale: 1, decimals: 0 }
    108: { group: "Current", title: "DischargeOverCurProtect (A)", scale: 0.1, decimals: 1 }
    110: { group: "Current", title: "DischargeOverCurProtectDelay (s)", scale: 1, decimals: 0 }
    112: { group: "Current", title: "DischargeOverCurProtectL2 (A)", scale: 0.1, decimals: 1 }
    114: { group: "Current", title: "DischargeOverCurProtectDelayL2 (ms)", scale: 1, decimals: 0 }
    116: { group: "Current", title: "ShortCircuitProtect (A)", scale: 1, decimals: 0 }
    118: { group: "Current", title: "ShortCircuitProtectDelay (µs)", scale: 1, decimals: 0 }
    124: { group: "Current", title: "ChargeOverCurWarning (A)", scale: 0.1, decimals: 1 }
    126: { group: "Current", title: "ChargeOverCurWarningRecover (A)", scale: 0.1, decimals: 1 }
    128: { group: "Current", title: "DischargeOverCurWarning (A)", scale: 0.1, decimals: 1 }
    130: { group: "Current", title: "DischargeOverCurWarningRecover (A)", scale: 0.1, decimals: 1 }
    132: { group: "Current", title: "SOCLowLevel1Warning", scale: 1, decimals: 0 }
    134: { group: "Current", title: "SOCLowLevel2Warning", scale: 1, decimals: 0 }
    140: { group: "Balance", title: "CellBalLimit (V)", scale: 0.001, decimals: 3 }
    142: { group: "Balance", title: "ChargingCellBalStart (V)", scale: 0.001, decimals: 3 }
    144: { group: "Balance", title: "CellDiffOn (V)", scale: 0.001, decimals: 3 }
    146: { group: "Balance", title: "CellDiffOff (V)", scale: 0.001, decimals: 3 }
    148: { group: "Balance", title: "BalanceCurrent (mA)", scale: 1, decimals: 0 }
    150: { group: "Balance", title: "BalanceChargingCurrent (A)", scale: 0.1, decimals: 1 }
    152: { group: "Pack",    title: "CellType", scale: 1, decimals: 0 }
    154: { group: "Pack",    title: "CellNumber (S)", scale: 1, decimals: 0 }
    156: { group: "Pack",    title: "CellLowR_Cal (mΩ)", scale: 1, decimals: 1 }
    158: { group: "Pack",    title: "ShutDownVolt (V)", scale: 0.001, decimals: 3 }
    160: { group: "Pack",    title: "RequestChargeCurrent (A)", scale: 0.1, decimals: 1 }
    162: { group: "Pack",    title: "PhysicalAH (Ah)", scale: 1, decimals: 1 }
    166: { group: "Pack",    title: "RemainingAH (Ah)", scale: 1, decimals: 1 }
    170: { group: "Pack",    title: "TotalCycleAH (Ah)", scale: 1, decimals: 1 }
    196: { group: "Pack",    title: "SOC_Method", scale: 1, decimals: 0 }
    378: { group: "Other",   title: "TireLength (mm)", scale: 1, decimals: 0 }
    380: { group: "Other",   title: "PulseValue (N)", scale: 1, decimals: 0 }
    382: { group: "Other",   title: "SlaveModuleNum (N)", scale: 1, decimals: 0 }

@syssi
Copy link
Owner Author

syssi commented Oct 26, 2022

Just for completeness: Could you provide a traffic capture of some commands? Having some PDUs by hand speeds up the implementation and can be used as fixtures for testing. Thanks in advance! You did a great job extracting all these details.

@bchiu
Copy link

bchiu commented Oct 26, 2022

here's a dump of all the Voltage read parameters from top to bottom, left to right column in the PC app.


[26/10/2022 20:21:14] Written data (COM4) 
    7e a1 02 00 00 02 19 a0 aa 55                     ~¡..... ªU       
[26/10/2022 20:21:14] Read data (COM4) 
    7e a1 12 00 00 02 36 10 1f 14 ff 0b 00 00 41 f2   ~¡....6...ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:15] Written data (COM4) 
    7e a1 02 02 00 02 b8 60 aa 55                     ~¡....¸`ªU       
[26/10/2022 20:21:15] Read data (COM4) 
    7e a1 12 02 00 02 04 10 73 b4 ff 0b 00 00 41 f2   ~¡......s´ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:16] Written data (COM4) 
    7e a1 02 04 00 02 58 61 aa 55                     ~¡....XaªU       
[26/10/2022 20:21:16] Read data (COM4) 
    7e a1 12 04 00 02 cc 10 ac 74 ff 0b 00 00 41 f2   ~¡....Ì.¬tÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:17] Written data (COM4) 
    7e a1 02 06 00 02 f9 a1 aa 55                     ~¡....ù¡ªU       
[26/10/2022 20:21:17] Read data (COM4) 
    7e a1 12 06 00 02 68 10 af 74 ff 0b 00 00 41 f2   ~¡....h.¯tÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:17] Written data (COM4) 
    7e a1 02 08 00 02 98 62 aa 55                     ~¡....˜bªU       
[26/10/2022 20:21:18] Read data (COM4) 
    7e a1 12 08 00 02 58 02 52 b8 ff 0b 00 00 41 f2   ~¡....X.R¸ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:18] Written data (COM4) 
    7e a1 02 0a 00 02 39 a2 aa 55                     ~¡....9¢ªU       
[26/10/2022 20:21:18] Read data (COM4) 
    7e a1 12 0a 00 02 44 02 23 b8 ff 0b 00 00 41 f2   ~¡....D.#¸ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:20] Written data (COM4) 
    7e a1 02 0c 00 02 d9 a3 aa 55                     ~¡....Ù£ªU       
[26/10/2022 20:21:20] Read data (COM4) 
    7e a1 12 0c 00 02 54 0b 66 7e ff 0b 00 00 41 f2   ~¡....T.f~ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:20] Written data (COM4) 
    7e a1 02 0e 00 02 78 63 aa 55                     ~¡....xcªU       
[26/10/2022 20:21:20] Read data (COM4) 
    7e a1 12 0e 00 02 80 0c 01 7c ff 0b 00 00 41 f2   ~¡....€..|ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:21] Written data (COM4) 
    7e a1 02 10 00 02 18 65 aa 55                     ~¡.....eªU       
[26/10/2022 20:21:21] Read data (COM4) 
    7e a1 12 10 00 02 28 0a 56 bc ff 0b 00 00 41 f2   ~¡....(.V¼ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:22] Written data (COM4) 
    7e a1 02 12 00 02 b9 a5 aa 55                     ~¡....¹¥ªU       
[26/10/2022 20:21:22] Read data (COM4) 
    7e a1 12 12 00 02 54 0b ce 7c ff 0b 00 00 41 f2   ~¡....T.Î|ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:23] Written data (COM4) 
    7e a1 02 14 00 02 59 a4 aa 55                     ~¡....Y¤ªU       
[26/10/2022 20:21:23] Read data (COM4) 
    7e a1 12 14 00 02 68 01 d7 7b ff 0b 00 00 41 f2   ~¡....h.×{ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:24] Written data (COM4) 
    7e a1 02 16 00 02 f8 64 aa 55                     ~¡....ødªU       
[26/10/2022 20:21:24] Read data (COM4) 
    7e a1 12 16 00 02 7c 01 a1 bb ff 0b 00 00 41 f2   ~¡....|.¡»ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:25] Written data (COM4) 
    7e a1 02 18 00 02 99 a7 aa 55                     ~¡....™§ªU       
[26/10/2022 20:21:25] Read data (COM4) 
    7e a1 12 18 00 02 e8 03 27 7b ff 0b 00 00 41 f2   ~¡....è.'{ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:26] Written data (COM4) 
    7e a1 02 1a 00 02 38 67 aa 55                     ~¡....8gªU       
[26/10/2022 20:21:26] Read data (COM4) 
    7e a1 12 1a 00 02 20 03 09 7b ff 0b 00 00 41 f2   ~¡.... ..{ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:27] Written data (COM4) 
    7e a1 02 20 00 02 18 6a aa 55                     ~¡. ...jªU       
[26/10/2022 20:21:27] Read data (COM4) 
    7e a1 12 20 00 02 9a 10 e3 d3 ff 0b 00 00 41 f2   ~¡. ..š.ãÓÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:28] Written data (COM4) 
    7e a1 02 22 00 02 b9 aa aa 55                     ~¡."..¹ªªU       
[26/10/2022 20:21:28] Read data (COM4) 
    7e a1 12 22 00 02 68 10 df 73 ff 0b 00 00 41 f2   ~¡."..h.ßsÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:28] Written data (COM4) 
    7e a1 02 24 00 02 59 ab aa 55                     ~¡.$..Y«ªU       
[26/10/2022 20:21:29] Read data (COM4) 
    7e a1 12 24 00 02 58 02 c3 7e ff 0b 00 00 41 f2   ~¡.$..X.Ã~ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:29] Written data (COM4) 
    7e a1 02 26 00 02 f8 6b aa 55                     ~¡.&..økªU       
[26/10/2022 20:21:29] Read data (COM4) 
    7e a1 12 26 00 02 44 02 b2 7e ff 0b 00 00 41 f2   ~¡.&..D.²~ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:30] Written data (COM4) 
    7e a1 02 28 00 02 99 a8 aa 55                     ~¡.(..™¨ªU       
[26/10/2022 20:21:30] Read data (COM4) 
    7e a1 12 28 00 02 80 0c 08 bb ff 0b 00 00 41 f2   ~¡.(..€..»ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:31] Written data (COM4) 
    7e a1 02 2a 00 02 38 68 aa 55                     ~¡.*..8hªU       
[26/10/2022 20:21:31] Read data (COM4) 
    7e a1 12 2a 00 02 e4 0c 5b bb ff 0b 00 00 41 f2   ~¡.*..ä.[»ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:31] Written data (COM4) 
    7e a1 02 2c 00 02 d8 69 aa 55                     ~¡.,..ØiªU       
[26/10/2022 20:21:31] Read data (COM4) 
    7e a1 12 2c 00 02 68 01 76 be ff 0b 00 00 41 f2   ~¡.,..h.v¾ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:32] Written data (COM4) 
    7e a1 02 2e 00 02 79 a9 aa 55                     ~¡....y©ªU       
[26/10/2022 20:21:32] Read data (COM4) 
    7e a1 12 2e 00 02 7c 01 00 7e ff 0b 00 00 41 f2   ~¡....|..~ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:33] Written data (COM4) 
    7e a1 02 30 00 02 19 af aa 55                     ~¡.0...¯ªU       
[26/10/2022 20:21:33] Read data (COM4) 
    7e a1 12 30 00 02 20 03 10 bd ff 0b 00 00 41 f2   ~¡.0.. ..½ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:34] Written data (COM4) 
    7e a1 02 32 00 02 b8 6f aa 55                     ~¡.2..¸oªU       
[26/10/2022 20:21:34] Read data (COM4) 
    7e a1 12 32 00 02 bc 02 c1 bd ff 0b 00 00 41 f2   ~¡.2..¼.Á½ÿ...Aò 
    aa 55                                             ªU               
[26/10/2022 20:21:39] - Close port COM4 

@bchiu
Copy link

bchiu commented Oct 26, 2022

dump after opening com port. i've tried to decode 0x01 system update but the datalen is 142 (as opposed to 140 in old ver) and probably in different order. for now you can stick with the old protocol.

[26/10/2022 20:25:23] Written data (COM4) 
    7e a1 04 00 00 0c 98 ec aa 55                     ~¡....˜ìªU       
[26/10/2022 20:25:23] Read data (COM4) 
    7e a1 14 00 00 0c 54 c1 ee 89 77 89 93 cd 8b 94   ~¡....TÁî‰w‰“Í‹” 
    76 01 03 d5 aa 55                                 v..ÕªU           
[26/10/2022 20:25:23] Written data (COM4) 
    7e a1 02 6c 02 20 58 c4 aa 55                     ~¡.l. XĪU       
[26/10/2022 20:25:23] Read data (COM4) 
    7e a1 12 6c 02 20 32 34 42 48 41 30 54 42 31 32   ~¡.l. 24BHA0TB12 
    30 41 00 00 00 00 32 34 42 48 55 42 30 30 2d 32   0A....24BHUB00-2 
    32 30 33 30 31 41 06 fd ff 0b 00 00 41 f2 aa 55   20301A.ýÿ...AòªU 
[26/10/2022 20:25:23] Written data (COM4) 
    7e a1 23 4a 01 08 31 32 33 34 35 36 37 38 db 50   ~¡#J..12345678ÛP 
    aa 55                                             ªU               
[26/10/2022 20:25:23] Read data (COM4) 
    7e a1 43 4a 01 02 05 00 9f 9b ff 05 00 00 20 31   ~¡CJ....Ÿ›ÿ... 1 
    aa 55                                             ªU               
[26/10/2022 20:25:25] Written data (COM4) 
    7e a1 01 00 00 be 18 55 aa 55                     ~¡...¾.UªU       
[26/10/2022 20:25:25] Read data (COM4) 
    7e a1 11 00 00 8e 05 01 04 0e 02 00 00 00 00 00   ~¡...Ž.......... 
    00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00   ................ 
    00 00 11 10 11 10 11 10 11 10 11 10 11 10 11 10   ................ 
    11 10 11 10 11 10 11 10 11 10 11 10 11 10 1c 00   ................ 
    1c 00 d8 ff 1c 00 1c 00 1c 00 7e 16 00 00 60 00   ..Øÿ......~...`. 
    64 00 01 02 00 00 80 c3 c9 01 4f 55 b3 01 08 53   d.....€ÃÉ.OU³..S 
    00 00 00 00 00 00 cb 26 12 00 00 00 00 00 11 10   ......Ë&........ 
    01 00 11 10 01 00 00 00 11 10 01 00 70 00 03 00   ............p... 
    ac 02 f1 fa 7d 2e 00 00 94 77 00 00 de 07 00 00   ¬.ñú}...”w..Þ... 
    77 76 00 00 8f 5f aa 55                           wv..�_ªU         
[26/10/2022 20:25:27] Written data (COM4) 
    7e a1 01 00 00 be 18 55 aa 55                     ~¡...¾.UªU       
[26/10/2022 20:25:27] Read data (COM4) 
    7e a1 11 00 00 8e 05 01 04 0e 02 00 00 00 00 00   ~¡...Ž.......... 
    00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00   ................ 
    00 00 11 10 11 10 11 10 11 10 11 10 11 10 11 10   ................ 
    11 10 11 10 11 10 11 10 11 10 11 10 11 10 1c 00   ................ 
    1c 00 d8 ff 1c 00 1c 00 1c 00 7e 16 00 00 60 00   ..Øÿ......~...`. 
    64 00 01 02 00 00 80 c3 c9 01 4f 55 b3 01 08 53   d.....€ÃÉ.OU³..S 
    00 00 00 00 00 00 cd 26 12 00 00 00 00 00 11 10   ......Í&........ 
    01 00 11 10 01 00 00 00 11 10 02 00 70 00 03 00   ............p... 
    ac 02 f1 fa 7d 2e 00 00 94 77 00 00 de 07 00 00   ¬.ñú}...”w..Þ... 
    77 76 00 00 e7 34 aa 55                           wv..ç4ªU         
[26/10/2022 20:25:29] Written data (COM4) 
    7e a1 01 00 00 be 18 55 aa 55                     ~¡...¾.UªU       
[26/10/2022 20:25:29] Read data (COM4) 
    7e a1 11 00 00 8e 05 01 04 0e 02 00 00 00 00 00   ~¡...Ž.......... 
    00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00   ................ 
    00 00 11 10 11 10 11 10 11 10 11 10 11 10 11 10   ................ 
    11 10 11 10 11 10 11 10 11 10 11 10 11 10 1c 00   ................ 
    1c 00 d8 ff 1c 00 1c 00 1c 00 7e 16 00 00 60 00   ..Øÿ......~...`. 
    64 00 01 02 00 00 80 c3 c9 01 4f 55 b3 01 08 53   d.....€ÃÉ.OU³..S 
    00 00 00 00 00 00 cf 26 12 00 00 00 00 00 11 10   ......Ï&........ 
    01 00 11 10 01 00 00 00 11 10 01 00 70 00 03 00   ............p... 
    ac 02 f1 fa 7d 2e 00 00 94 77 00 00 de 07 00 00   ¬.ñú}...”w..Þ... 
    77 76 00 00 cd 6d aa 55                           wv..ÍmªU         
[26/10/2022 20:25:31] - Close port COM4 

@bchiu
Copy link

bchiu commented Oct 26, 2022

some sample write parameter commands from Current tab:

[26/10/2022 20:30:48] Written data (COM4) 
    7e a1 22 68 00 02 f4 01 ea 41 aa 55               ~¡"h..ô.êAªU     
[26/10/2022 20:30:48] Read data (COM4) 
    7e a1 42 68 00 02 f4 01 e3 e1 ff 0a 00 00 10 32   ~¡Bh..ô.ãáÿ....2 
    aa 55                                             ªU               
[26/10/2022 20:30:50] Written data (COM4) 
    7e a1 22 6a 00 02 05 00 17 d1 aa 55               ~¡"j.....ѪU     
[26/10/2022 20:30:50] Read data (COM4) 
    7e a1 42 6a 00 02 05 00 1e 71 ff 0a 00 00 10 32   ~¡Bj.....qÿ....2 
    aa 55                                             ªU               
[26/10/2022 20:30:51] Written data (COM4) 
    7e a1 22 6c 00 02 b8 0b af 46 aa 55               ~¡"l..¸.¯FªU     
[26/10/2022 20:30:51] Read data (COM4) 
    7e a1 42 6c 00 02 b8 0b a6 e6 ff 0a 00 00 10 32   ~¡Bl..¸.¦æÿ....2 
    aa 55                                             ªU               
[26/10/2022 20:30:53] Written data (COM4) 
    7e a1 22 6e 00 02 05 00 e6 11 aa 55               ~¡"n....æ.ªU     
[26/10/2022 20:30:53] Read data (COM4) 
    7e a1 42 6e 00 02 05 00 ef b1 ff 0a 00 00 10 32   ~¡Bn....ï±ÿ....2 
    aa 55                                             ªU               
[26/10/2022 20:31:06] - Close port COM4 
 

@bchiu
Copy link

bchiu commented Oct 26, 2022

SystemInformation dump:


[26/10/2022 20:32:18] Written data (COM4) 
    7e a1 01 00 00 be 18 55 aa 55                     ~¡...¾.UªU       
[26/10/2022 20:32:18] Read data (COM4) 
    7e a1 11 00 00 8e 05 01 04 0e 02 00 00 00 00 00   ~¡...Ž.......... 
    00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00   ................ 
    00 00 11 10 11 10 11 10 11 10 11 10 11 10 11 10   ................ 
    11 10 11 10 11 10 11 10 11 10 11 10 11 10 1c 00   ................ 
    1c 00 d8 ff 1c 00 1c 00 1c 00 7e 16 00 00 60 00   ..Øÿ......~...`. 
    64 00 01 02 00 00 80 c3 c9 01 4f 55 b3 01 08 53   d.....€ÃÉ.OU³..S 
    00 00 00 00 00 00 6b 28 12 00 00 00 00 00 11 10   ......k(........ 
    01 00 11 10 01 00 00 00 11 10 02 00 70 00 03 00   ............p... 
    ac 02 f1 fa 7d 2e 00 00 94 77 00 00 de 07 00 00   ¬.ñú}...”w..Þ... 
    77 76 00 00 35 e2 aa 55                           wv..5âªU         
[26/10/2022 20:32:19] Written data (COM4) 
    7e a1 05 00 00 28 99 0b aa 55                     ~¡...(™.ªU       
[26/10/2022 20:32:19] Read data (COM4) 
    7e a1 15 00 00 28 0a 00 00 00 0a 00 00 00 0a 00   ~¡...(.......... 
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................ 
    0a 00 00 00 07 00 00 00 02 00 00 00 00 00 44 60   ..............D` 
    aa 55                                             ªU               
[26/10/2022 20:32:19] Written data (COM4) 
    7e a1 02 06 01 20 78 28 aa 55                     ~¡... x(ªU       
[26/10/2022 20:32:19] Read data (COM4) 
    7e a1 12 06 01 20 44 4f 47 41 54 49 00 00 00 00   ~¡... DOGATI.... 
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................ 
    00 00 00 00 00 00 3f 12 ff 0b 00 00 41 f2 aa 55   ......?.ÿ...AòªU 
[26/10/2022 20:32:20] Written data (COM4) 
    7e a1 04 00 00 0c 98 ec aa 55                     ~¡....˜ìªU       
[26/10/2022 20:32:20] Read data (COM4) 
    7e a1 14 00 00 0c 54 c1 ee 89 77 89 93 cd 8b 94   ~¡....TÁî‰w‰“Í‹” 
    76 01 03 d5 aa 55                                 v..ÕªU           
[26/10/2022 20:32:20] Written data (COM4) 
    7e a1 02 6c 02 20 58 c4 aa 55                     ~¡.l. XĪU       
[26/10/2022 20:32:20] Read data (COM4) 
    7e a1 12 6c 02 20 32 34 42 48 41 30 54 42 31 32   ~¡.l. 24BHA0TB12 
    30 41 00 00 00 00 32 34 42 48 55 42 30 30 2d 32   0A....24BHUB00-2 
    32 30 33 30 31 41 06 fd ff 0b 00 00 41 f2 aa 55   20301A.ýÿ...AòªU 
[26/10/2022 20:32:20] Written data (COM4) 
    7e a1 01 00 00 be 18 55 aa 55 7e a1 02 6c 02 20   ~¡...¾.UªU~¡.l.  
    58 c4 aa 55                                       XĪU             
[26/10/2022 20:32:20] Read data (COM4) 
    7e a1 11 00 00 8e 05 01 04 0e 02 00 00 00 00 00   ~¡...Ž.......... 
    00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00   ................ 
    00 00 11 10 11 10 11 10 11 10 11 10 11 10 11 10   ................ 
    11 10 11 10 11 10 11 10 11 10 11 10 11 10 1c 00   ................ 
    1c 00 d8 ff 1c 00 1c 00 1c 00 7e 16 00 00 60 00   ..Øÿ......~...`. 
    64 00 01 02 00 00 80 c3 c9 01 4f 55 b3 01 08 53   d.....€ÃÉ.OU³..S 
    00 00 00 00 00 00 6d 28 12 00 00 00 00 00 11 10   ......m(........ 
    01 00 11 10 01 00 00 00 11 10 02 00 70 00 03 00   ............p... 
    ac 02 f1 fa 7d 2e 00 00 94 77 00 00 de 07 00 00   ¬.ñú}...”w..Þ... 
    77 76 00 00 56 c9 aa 55 7e a1 12 6c 02 20 32 34   wv..VɪU~¡.l. 24 
    42 48 41 30 54 42 31 32 30 41 00 00 00 00 32 34   BHA0TB120A....24 
    42 48 55 42 30 30 2d 32 32 30 33 30 31 41 06 fd   BHUB00-220301A.ý 
    ff 0b 00 00 41 f2 aa 55                           ÿ...AòªU         
[26/10/2022 20:32:31] - Close port COM4 
 

@bchiu
Copy link

bchiu commented Oct 26, 2022

If there is anything more specific you need let me know.

@syssi
Copy link
Owner Author

syssi commented Oct 26, 2022

This is completely sufficient for now. It will take me a while to get the new information into the code.

@bchiu
Copy link

bchiu commented Oct 26, 2022

ant-bms-device-16zm.zip

here is my device config yaml. hope this helps. also parameter config with hex values:

[start, start, command, address16, datalen, crc16, end, end]


Volt
----
CellHighProtect (V)             7e a1 02 00 00 02 19 a0 aa 55    0
CellHighRecover (V)             7e a1 02 02 00 02 b8 60 aa 55    2
CellHighProtectL2 (V)           7e a1 02 04 00 02 58 61 aa 55    4
CellHighRecoverL2 (V)           7e a1 02 06 00 02 f9 a1 aa 55    6
PackVoltHighProtect (V)         7e a1 02 08 00 02 98 62 aa 55    8
PackVoltHighRecover (V)         7e a1 02 0a 00 02 39 a2 aa 55    10

CellLowProtect (V)              7e a1 02 0c 00 02 d9 a3 aa 55    12
CellLowRecover (V)              7e a1 02 0e 00 02 78 63 aa 55    14
CellLowProtectL2 (V)            7e a1 02 10 00 02 18 65 aa 55    16
CellLowRecoverL2 (V)            7e a1 02 12 00 02 b9 a5 aa 55    18
PackVoltLowProtect (V)          7e a1 02 14 00 02 59 a4 aa 55    20
PackVoltLowRecover (V)          7e a1 02 16 00 02 f8 64 aa 55    22

CellDiffProtect (V)             7e a1 02 18 00 02 99 a7 aa 55    24
CellDiffRecover (V)             7e a1 02 1a 00 02 38 67 aa 55    26
CellHighWarning (V)             7e a1 02 20 00 02 18 6a aa 55    32
CellHighWarningRecover (V)      7e a1 02 22 00 02 b9 aa aa 55    34
PackVoltHighWarning (V)         7e a1 02 24 00 02 59 ab aa 55    36
PackVoltHighWarningRecover (V)  7e a1 02 26 00 02 f8 6b aa 55    38

CellLowWarning (V)              7e a1 02 28 00 02 99 a8 aa 55    40
CellLowWarningRecover (V)       7e a1 02 2a 00 02 38 68 aa 55    42
PackVoltLowWarning (V)          7e a1 02 2c 00 02 d8 69 aa 55    44
PackVoltLowWarningRecover (V)   7e a1 02 2e 00 02 79 a9 aa 55    46
CellDiffWarning (V)             7e a1 02 30 00 02 19 af aa 55    48
CellDiffWarningRecover (V)      7e a1 02 32 00 02 b8 6f aa 55    50

Current
-------
ChargeOverCurProtect (A)        7e a1 02 68 00 02 98 7c aa 55    104
ChargeOverCurProtectDelay (s)   7e a1 02 6a 00 02 39 bc aa 55    106
DischargeOverCurProtect (A)     7e a1 02 6c 00 02 d9 bd aa 55    108
DischargeOverCurProtectDelay (s) 7e a1 02 6e 00 02 78 7d aa 55   110
DischargeOverCurProtectL2 (A)    7e a1 02 70 00 02 18 7b aa 55   112
DischargeOverCurProtectDelayL2 (ms) 7e a1 02 72 00 02 b9 bb aa 55    114
ShortCircuitProtect (A)         7e a1 02 74 00 02 59 ba aa 55    116
ShortCircuitProtectDelay (us)   7e a1 02 76 00 02 f8 7a aa 55    118

ChargeOverCurWarning (A)        7e a1 02 7c 00 02 d8 78 aa 55    124
ChargeOverCurWarningRecover (A) 7e a1 02 7e 00 02 79 b8 aa 55    126
DischargeOverCurWarning (A)     7e a1 02 80 00 02 18 48 aa 55    128
DischargeOverCurWarningRecover (A) 7e a1 02 82 00 02 b9 88 aa 55    130

SOCLowLevel1Warning             7e a1 02 84 00 02 59 89 aa 55    132
SOCLowLevel2Warning             7e a1 02 86 00 02 f8 49 aa 55    134

Balance
-------
CellBalLimit (V)                7e a1 02 8c 00 02 d8 4b aa 55    140
ChargingCellBalStart (V)        7e a1 02 8e 00 02 79 8b aa 55    142

CellDiffOn (V)                  7e a1 02 90 00 02 19 8d aa 55    144
CellDiffOff (V)                 7e a1 02 92 00 02 b8 4d aa 55    146

BalanceCurrent (mA)             7e a1 02 94 00 02 58 4c aa 55    148
BalanceChargingCurrent (A)      7e a1 02 96 00 02 f9 8c aa 55    150

Pack
----
PackID                          7e a1 02 06 01 20 78 28 aa 55    262 datalen 20
CellType                        7e a1 02 98 00 02 98 4f aa 55    152
CellNumber (S)                  7e a1 02 9a 00 02 39 8f aa 55    154
CellLowR_Cal (mohm)             7e a1 02 9c 00 02 d9 8e aa 55    156
ShutDownVolt (V)                7e a1 02 9e 00 02 78 4e aa 55    158
RequestChargeCurrent (A)        7e a1 02 a0 00 02 19 82 aa 55    160
PhysicalAH (Ah)                 7e a1 02 a2 00 04 38 40 aa 55    162 datalen 4
RemainingAH (Ah)                7e a1 02 a6 00 04 79 81 aa 55    166 datalen 4
TotalCycleAH (Ah)               7e a1 02 aa 00 04 b9 82 aa 55    170 datalen 4
SOC_Method                      7e a1 02 c4 00 02 58 5d aa 55    196

Other
-----
TireLength (mm)                 7e a1 02 7a 01 02 39 e9 aa 55    378
PulseValue                      7e a1 02 7c 01 02 d9 e8 aa 55    380
SlaveModuleNum                  7e a1 02 7e 01 02 78 28 aa 55    382

Not implemented:
Temperature
System 
Factory
GPRS

@bchiu
Copy link

bchiu commented Oct 26, 2022

it responds with the value written but i still can't figure out what the extra 6 bytes are (in square brackets). anyone care to take a guess?

[26/10/2022 20:30:48] Written data (COM4) 
    7e a1 22 68 00 02 f4 01 ea 41 aa 55
[26/10/2022 20:30:48] Read data (COM4) 
    7e a1 42 68 00 02 f4 01 [e3 e1 ff 0a 00 00] 10 32 aa 55  

@syssi
Copy link
Owner Author

syssi commented Oct 26, 2022

The second half is called "second packet" at the MY-APP-1116 android app. It looks like frame can be divided into two packets:

7e  SOF
a1  SOF
42  Func
68
00
02  DateLen
f4  Data
01  Data
e3  CRC?
e1  CRC?

ff  SOF2
0a  Value uint16
00  Value uint16
00  DataLen2
10  CRC2
32  CRC2
aa  EOF
55  EOF

The uint16 0x0a00 is passed to a method called bmsPermissionCallback.onError(val).

@bchiu
Copy link

bchiu commented Oct 27, 2022

ok that helps. checksum passes using the first crc (0xe3e1). in the pc app, write responses always returning 10 for the error code whether or not it is authenticated. i've tried both 000000000000 and 123456789abc for the level 5 password and still get the same result. so...either it can't get the chip id or it isnt authenticated properly. in either case, it still writes the value.

public interface BmsPermissionCallback {
    void onChipIdResult(String str);
    void onError(int i);
    void onPermissionLevel(int i);
}

in a possibly newer version of the app, this is what i found:

} else if (b == 66) {
      int uInt162 = BitUtils.getUInt16(poll, 3);
      if (this.mBmsParamsCallback != null) {
          if (uInt8 > 2) {
              this.mBmsParamsCallback.onBmsWrite(uInt162, BitUtils.getUInt32(poll, 6));
          } else if (uInt162 < 68 || uInt162 > 98) {
              this.mBmsParamsCallback.onBmsWrite(uInt162, BitUtils.getUInt16(poll, 6));
          } else {
              this.mBmsParamsCallback.onBmsWrite(uInt162, BitUtils.getShort(poll, 6));
          }
      }
      parse2Packet(Arrays.copyOfRange(poll, uInt8 + 6 + 2, poll.length));
      return;

public interface BmsParamsCallback {
    void onBmsParamsCallback(int i, int[] iArr);
    void onBmsWrite(int i, int i2);
    void onBmsWrite(int i, long j);
    void onError(int i, int i2, int i3);
    void onSuccess();
}

@dl4mea
Copy link

dl4mea commented Feb 27, 2023

I came here searching for a description of the 0x7e 0xa1 0x01 and found bchiu on Oct 26, 2022 describing that message. Mentioning it is 142 bytes long. However, the format given here is not correct, it looks as if between the message length and cell voltages some other values were inserted.
Did you meanwhile find out a message description before I start reverse engineering?

@syssi
Copy link
Owner Author

syssi commented Feb 27, 2023

Did you see the attachment (ant-bms-device-16zm.zip) above? It does contain some (but unused) descriptions:

request 7e a1 01 00 00 be 18 55 aa 55
7e a1 11 00 00 8e (7e, a1, command+0x10, param, param, datalen)
05 01 04 0e 02 00 00 00 00 00
00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00
00 00 27 10 27 10 27 10 27 10 27 10 27 10 27 10
27 10 27 10 27 10 27 10 27 10 27 10 27 10 19 00
1a 00 d8 ff 1a 00 1a 00 1a 00 9d 16 00 00 62 00
64 00 01 02 00 00 80 c3 c9 01 df 07 bc 01 70 37
00 00 00 00 00 00 77 f4 0f 00 00 00 00 00 27 10
01 00 27 10 01 00 00 00 27 10 01 00 70 00 03 00
ac 02 f1 fa d3 11 00 00 0d 5d 00 00 17 03 00 00
e8 5b 00 00 
2e 46 aa 55 (crc, crc, aa, 55)
datalen = 142

- name: Get Basic Data
  event: update
  setdata: true
  endian: true
  crctype: crc16modbus
  skipcrc: false
  request: [0x7E, 0xA1, 0x01, 0, 0, 0xBE, 0x18, 0x55, 0xAA, 0x55]
  headers: [0x7E, 0xA1, 0x11, .., 0xAA, 0x55]
  datalen: 142
  response:
    - { id: start1,    type: uint8, nocrc: true }
    - { id: address,   type: uint8  }
    - { id: command,   type: uint8  }
    - { id: parameter, type: uint16 }
    - { id: datalen,   type: uint8  }
    - { id: unknown1,              type: uint8 }
    - { id: unknown2,              type: uint8 }
    - { id: bms.voltage,           type: uint16, scale: 0.1 }
    - { id: bms.cells_voltage,     type: uint16array, length: 32, scale: 0.001 }
    - { id: bms.current,           type: int32,  scale: 0.1 }
    - { id: bms.pct_capacity,      type: uint8  }
    - { id: bms.nom_capacity,      type: uint32, scale: 0.000001 }
    - { id: bms.rem_capacity,      type: uint32, scale: 0.000001 }
    - { id: bms.used_capacity,     type: uint32, scale: 0.000001 }
    - { id: bms.runtime,           type: uint32 }
    - { id: bms.ntc_values,        type: uint16array, length: 6 }
    - { id: bms.charge_status,     type: uint8  }
    - { id: bms.discharge_status,  type: uint8  }
    - { id: bms.balance_status,    type: uint8  }
    - { id: bms.wheel_length,      type: uint16 }
    - { id: bms.pulses_per_rev,    type: uint16 }
    - { id: bms.relay_status,      type: uint8  }
    - { id: bms.power,             type: int32  }
    - { id: bms.max_cell_series,   type: uint8  }
    - { id: bms.high_cell_voltage, type: uint16, scale: 0.001 }
    - { id: bms.low_cell_id,       type: uint8  }
    - { id: bms.low_cell_voltage,  type: uint16, scale: 0.001 }
    - { id: bms.avg_cell_voltage,  type: uint16, scale: 0.001 }
    - { id: bms.series,            type: uint8  }
    - { id: bms.detection_voltage, type: uint16, scale: 0.001 }
    - { id: bms.discharge_voltage, type: uint16, scale: 0.001 }
    - { id: bms.charging_voltage,  type: uint16, scale: 0.001 }
    - { id: bms.comparator_value,  type: uint16 }
    - { id: bms.cells_balance,     type: uint32bits }
    - { id: bms.system_status,     type: uint16bits }
    - { id: crc,  type: uint16, nocrc: true }
    - { id: end1, type: uint8,  nocrc: true }
    - { id: end2, type: uint8,  nocrc: true }
  script: >
    data.bms.series = Math.min(32, data.bms.series);
    data.bms.charging_enabled  = (data.bms.charge_status===1)    ? true : false;
    data.bms.discharge_enabled = (data.bms.discharge_status===1) ? true : false;
    data.bms.balancing_enabled = (data.bms.balance_status>0)     ? true : false;

    data.bms.ntc_values   = data.bms.ntc_values?.map(val => (val>200) ? 0 : val) || [];
    data.bms.mosfet_temp  = data.bms.ntc_values[0] || 0;
    data.bms.battery_temp = data.bms.ntc_values[2] || 0;

    data.bms.status = [
      defs.CHARGE_CODES[data.bms.charge_status],
      defs.DISCHARGE_CODES[data.bms.discharge_status],
      defs.BALANCE_CODES[data.bms.balance_status]
    ];

73 de DO2KSM

@dl4mea
Copy link

dl4mea commented Feb 27, 2023

Yes, I saw this - and it is the think I mean with "there is a gap"
Because the output of my BMS as a response on

7E A1 11 00 00 8E 01 01 02 10 00 00 00 00 00 00
00 00 00 30 80 01 00 00 00 00 00 00 00 00 00 00
00 00 3B 0C 48 0C EE 0B 3D 0C 54 0C 41 0C 37 0C
32 0C 26 0C 4A 0C 4C 0C 2C 0C 21 0C 2B 0C 3F 0C
3F 0C 10 00 10 00 13 00 12 00 89 13 00 00 04 00
64 00 01 01 00 00 00 D8 B8 05 B3 87 5F 00 0F 73
6A 01 00 00 00 00 B3 5A 98 02 00 00 00 00 54 0C
05 00 EE 0B 03 00 66 00 35 0C 00 00 82 00 7E 00
12 02 00 00 0F 48 6B 01 0F 9E 69 01 C3 89 BB 00
DD D3 84 00 56 0B AA 55

Highlighted is 0x8e, message length, and 0x3b 0x0c which is the first cell voltage.
With reference to your quoted text,

  • { id: datalen, type: uint8 }
  • { id: unknown1, type: uint8 }
  • { id: unknown2, type: uint8 }
  • { id: bms.voltage, type: uint16, scale: 0.1 }
  • { id: bms.cells_voltage, type: uint16array, length: 32, scale: 0.001 }

There should only be 4 bytes between message length and the first cell voltage, while I count 28. Or do I bascially misunderstand something?

Regards, Guenter

@syssi
Copy link
Owner Author

syssi commented Feb 27, 2023

I tried to visualize the gap.

     0  7E 7E  start1
     1  A1 A1  address
     2  11 11  command
     3  00 00  parameter
     4  00 00  parameter
     5  8E 8E  datalen (142)
     6  05 01  unknown1
     7  01 01  unknown2
     8  04 02  voltage
     9  0E 10  voltage (35.88V 40.98V)
    10  02 00  ?
    11  00 00  ?
    12  00 00  ?
    13  00 00  ?
    14  00 00  ?
    15  00 00  ?
    16  00 00  ?
    17  00 00  ?
    18  00 00  ?
    19  00 30  ?
    20  00 80  ?
    21  01 01  ?
    22  00 00  cell20
    23  00 00  cell20
    24  00 00  cell19
    25  00 00  cell19
    26  00 00  cell18
    27  00 00  cell18
    28  00 00  cell17
    29  00 00  cell17
    30  00 00  cell16
    31  00 00  cell16
    32  00 00  cell15
    33  00 00  cell15
    34  27 3B  cell14
    35  10 0C  cell14
    36  27 48  cell13
    37  10 0C  cell13
    38  27 EE  cell12
    39  10 0B  cell12
    40  27 3D  cell11
    41  10 0C  cell11
    42  27 54  cell10
    43  10 0C  cell10
    44  27 41  cell9
    45  10 0C  cell9
    46  27 37  cell8
    47  10 0C  cell8
    48  27 32  cell7
    49  10 0C  cell7
    50  27 26  cell6
    51  10 0C  cell6
    52  27 4A  cell5
    53  10 0C  cell5
    54  27 4C  cell4
    55  10 0C  cell4
    56  27 2C  cell3
    57  10 0C  cell3
    58  27 21  cell2
    59  10 0C  cell2
    60  27 2B  cell1
    61  10 0C  cell1
    62  19 3F
    63  00 0C
    64  1A 3F
    65  00 0C
    66  D8 10
    67  FF 00
    68  1A 10
    69  00 00
    70  1A 13
    71  00 00
    72  1A 12
    73  00 00
    74  9D 89
    75  16 13
    76  00 00
    77  00 00
    78  62 04
    79  00 00
    80  64 64
    81  00 00
    82  01 01
    83  02 01
    84  00 00
    85  00 00
    86  80 00
    87  C3 D8
    88  C9 B8
    89  01 05
    90  DF B3
    91  07 87
    92  BC 5F
    93  01 00
    94  70 0F
    95  37 73
    96  00 6A
    97  00 01
    98  00 00
    99  00 00
   100  00 00
   101  00 00
   102  77 B3
   103  F4 5A
   104  0F 98
   105  00 02
   106  00 00
   107  00 00
   108  00 00
   109  00 00
   110  27 54
   111  10 0C
   112  01 05
   113  00 00
   114  27 EE
   115  10 0B
   116  01 03
   117  00 00
   118  00 66
   119  00 00
   120  27 35
   121  10 0C
   122  01 00
   123  00 00
   124  70 82
   125  00 00
   126  03 7E
   127  00 00
   128  AC 12
   129  02 02
   130  F1 00
   131  FA 00
   132  D3 0F
   133  11 48
   134  00 6B
   135  00 01
   136  0D 0F
   137  5D 9E
   138  00 69
   139  00 01
   140  17 C3
   141  03 89
   142  00 BB
   143  00 00
   144  E8 DD
   145  5B D3
   146  00 84
   147  00 00
   148  2E 56
   149  46 0B
   150  AA AA
   151  55 55

@dl4mea
Copy link

dl4mea commented Feb 27, 2023

Thanks, let me see if I can get that into a little piece of Python.

@syssi
Copy link
Owner Author

syssi commented Feb 27, 2023

I've removed some of the cellXX labels because of these bytes:

    19  00 30  ?
    20  00 80  ?
    21  01 01  ?

@dl4mea
Copy link

dl4mea commented Feb 27, 2023

I think the cell voltages start 4 bytes later:
You say:
60 27 2B cell1
61 10 0C cell1
62 19 3F
63 00 0C
64 1A 3F
65 00 0C

But also byte #63/#64 and byte #65/#64 are 0x0c3f, in other words, 3.145V

@syssi
Copy link
Owner Author

syssi commented Feb 27, 2023

You are absolutely right. My guess was wrong. Could you explain why do you prefer the status request of the new protocol instead of using the "well known" status request of the old protocol?

@dl4mea
Copy link

dl4mea commented Feb 27, 2023

Actually I'm not sure if my BMS can talk the old one, too...
Screenshot_20230227-190716

@syssi
Copy link
Owner Author

syssi commented Feb 27, 2023

Just give it a try. This is the status request of the old protocol: 0x5A, 0x5A, 0x00, 0x00, 0x01, 0x01

https://github.com/syssi/esphome-ant-bms/blob/main/components/ant_modbus/ant_modbus.cpp#L148-L159

@syssi
Copy link
Owner Author

syssi commented Feb 27, 2023

This component uses the old protocol (for both BMS versions) for reading (like the Android app). If it comes to writing you have to choose the appropriate protocol version or the BMS doesn't accept the commands.

@dl4mea
Copy link

dl4mea commented Feb 27, 2023

Nope, my BMS does not answer anything when triggered with 0x5A, 0x5A, 0x00, 0x00, 0x01, 0x01

@syssi
Copy link
Owner Author

syssi commented Feb 27, 2023

Good to know. :-) In this case this implementation/project isn't compatible yet. ;-)

@dl4mea
Copy link

dl4mea commented Feb 27, 2023

I have a bad feeling about this definition:
- { id: bms.ntc_values, type: uint16array, length: 6 }
I think it should be int16. I even have an "ANT_communication_protocol_EN.pdf" at hands where it says:
Real temperature(91-102): short Celsius degree

syssi added a commit that referenced this issue Mar 2, 2023
@syssi
Copy link
Owner Author

syssi commented Mar 7, 2023

@dl4mea I've decoded the status frame of the new protocol:

  // Status request
  // -> 0x7e 0xa1 0x01 0x00 0x00 0xbe 0x18 0x55 0xaa 0x55
  //
  // Status response
  //
  // Byte Len Payload     Description                      Unit  Precision
  //   0   2  0x7E 0xA1   Start of frame
  //   2   1  0x11        Function?
  //   3   2  0x00 0x00   Reserved
  //   5   1  0x8E        Data length
  //   6   1  0x05        Permissions
  //   7   1  0x01        Battery status
  //   8   1  0x04        Number of temperature sensors       max 4.
  //   9   1  0x0E        Number of cells (14)                max 32
  //  10   8  0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00   Protection bitmask
  //  18   8  0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00   Warning bitmask
  //  26   8  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00   Balancing? bitmask
  //  34   2  0x11 0x10   Cell voltage 1     uint16_t
  //  36   2  0x11 0x10   Cell voltage 2
  //  38   2  0x11 0x10   Cell voltage 3
  //  40   2  0x11 0x10   Cell voltage 4
  //  42   2  0x11 0x10   Cell voltage 5
  //  44   2  0x11 0x10   Cell voltage 6
  //  46   2  0x11 0x10   Cell voltage 7
  //  48   2  0x11 0x10   Cell voltage 8
  //  50   2  0x11 0x10   Cell voltage 9
  //  52   2  0x11 0x10   Cell voltage 10
  //  54   2  0x11 0x10   Cell voltage 11
  //  56   2  0x11 0x10   Cell voltage 12
  //  58   2  0x11 0x10   Cell voltage 13
  //  60   2  0x11 0x10   Cell voltage 14            uint16_t
  //  62   2  0x1C 0x00   Temperature sensor 1        int16_t
  //  64   2  0x1C 0x00   Temperature sensor 2        int16_t
  //  66   2  0xD8 0xFF   Temperature sensor 3        int16_t
  //  68   2  0x1C 0x00   Temperature sensor 4        int16_t
  //  70   2  0x1C 0x00   Mosfet temperature          int16_t
  //  72   2  0x1C 0x00   Balancer temperature        int16_t
  //  74   2  0x7E 0x16   Total voltage              uint16_t
  //  76   2  0x00 0x00   Current                     int16_t
  //  78   2  0x60 0x00   State of charge            uint16_t
  //  80   2  0x64 0x00   State of health            uint16_t
  //  82   1  0x01        Charge MOS status
  //  83   1  0x02        Discharge MOS status
  //  84   1  0x00        Balancer status
  //  85   1  0x00        Reserved
  //  86   4  0x80 0xC3 0xC9 0x01    Battery capacity            uint32_t
  //  90   4  0x4F 0x55 0xB3 0x01    Battery capacity remaining  uint32_t
  //  94   4  0x08 0x53 0x00 0x00    Battery cycles capacity     uint32_t
  //  98   4  0x00 0x00 0x00 0x00    Power?
  // 102   4  0x6B 0x28 0x12 0x00    Total runtime
  // 106   4  0x00 0x00 0x00 0x00    Balance flag
  // 110   2  0x11 0x10              Maximum cell voltage
  // 112   2  0x01 0x00              Maximum voltage cell
  // 114   2  0x11 0x10              Minimum cell voltage
  // 116   2  0x01 0x00              Minimum voltage cell
  // 118   2  0x00 0x00              Voltage difference
  // 120   2  0x11 0x10              Average cell voltage
  // 122   2  0x02 0x00              volDsv
  // 124   2  0x70 0x00              Voltage Discharging MOS value
  // 126   2  0x03 0x00              Voltage Charging MOS value
  // 128   2  0xAC 0x02              F40com
  // 130   2  0xF1 0xFA              Battery type
  // 132   4  0x7D 0x2E 0x00 0x00    Accumulated discharging energy
  // 136   4  0x94 0x77 0x00 0x00    Accumulated charging energy
  // 140   4  0xDE 0x07 0x00 0x00    Accumulated discharging time
  // 144   4  0x77 0x76 0x00 0x00    Accumulated charging time
  // 148   2  0x35 0xE2              CRC
  // 150   2  0xAA 0x55              End of frame

@dl4mea
Copy link

dl4mea commented Mar 7, 2023

I checked some values around those I already had in my decoder, and they all look pretty fine.

@syssi
Copy link
Owner Author

syssi commented Mar 7, 2023

I started to add some more details about status flags and bitmasks here:

#52

Repository owner deleted a comment from sralus Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants