ich dachte, ich nutze die Weihnachtstage und probiere mich noch mal an dem Protokoll - bisher nicht erfolgreich. Vermutlich fehlt mir einfach etwas Basiswissen über BLE.. Hats schon jemand? :)
Bluebattery Bluetooth Interface(Stand 09.06.2020)V400
Advertising UUID BlueSolar Service "AA021474-780D-439F-AF20-6B46446A610E"
Bluetooth Scan Name "BlueBattery_Vxxx"
Vxxx: Version information, e.g.V112GATTCHARACTERISTIC"4B616901-40bd-428b-bf06-698e5e422cd9""sec"
read, write,4 bytes signed integer, big endian
time of day in seconds, after power-up it starts with0, needs to be set after initial connection to correct time. Log entry is generated when seconds reach 86400(24 Hours) and seconds are reset to 0.GATTCHARACTERISTIC"4B616907-40bd-428b-bf06-698e5e422cd9""log"36 bytes read,write(Version V1xx)37 bytes read,write(Version V2xx)39 bytes read,write(Version V304)
byte 36:8-bit frame type(only Version V2xx)
frame type 0x00:(log entry days)
bytes 0-1: big endian 16 bit mWh per day**
bytes 2-3: big endian 16-bit max mW per Day**
bytes 4-5: big endian 16-bit min mV per Day
bytes 6-7: big endian 16-bit max mV per Day
bytes 8-9: big endian 16-bit charge time in minutes per Day**
bytes 10-11: big endian 16-bit day counter forthis log entry, counting up from0
bytes 12-13: big endian 16-bit current day(max day count)
bytes 14-15: big endian 16-bit Solar charge in100 mAh**
bytes 16-17: big endian 16-bit SOCin100 mAh
bytes 18-19: big endian 16-bit max current 100 mA
bytes 20-21: big endian 16-bit min current -100 mA
bytes 22-23: big endian 16-bit max SOC100 mAh
bytes 24-25: big endian 16-bit min SOC100 mAh
bytes 26-27: big endian 16-bit binary offset max Temperature(x -0x8000)/100 °C
bytes 28-29: big endian 16-bit binary offset min Temperature(x -0x8000)/100 °C
bytes 30-31: big endian 16-bit total external charge per day 100 mAh**
bytes 32-33: big endian 16-bit total discharge per day 100 mAh
bytes 34-35: big endian 16-bit total charge per day 100 mAh
byte 36:8-bit frame type 0x00
bytes 37-38: big endian 16-bit total booster charge per day 100mAh(V304)**** not relevant for BlueBattery-Basic
available starting with Version V2xx, not anymore supported starting V306
frame type 0x01:(log entries)
bytes 0-1:16-bit day counter(relative to current day in frame type 0x00)
bytes 2-3:16-bit wall time in seconds/2
bytes 4-5:16-bit average battery voltage mV
bytes 6-7:16-bit average solar current mA
bytes 8: solar charger status: aktiv, standby, reduced
bytes 9-10:16-bit average battery current 100 mA
bytes 11-12:16-bit battery SOC100 mAh
bytes 13-25:as0-12 next entry
bytes 26-35: reserved
byte 36:8-bit frame type 0x01
or available starting with Version V302
frame type 0x02:(log entries)
bytes 0-1:16-bit day counter(relative to current day in frame type 0x00)
bytes 2-3:16-bit wall time in seconds/2
bytes 4-5:16-bit average battery voltage mV
bytes 6-7:16-bit average solar current mA**
bytes 8: solar charger status: aktiv, standby, reduced
bytes 9-10:16-bit average battery current 100 mA
bytes 11-12:16-bit battery SOC100 mA
bytes 13-14:16-bit booster average input voltage 10mV(starter)**
bytes 15-16: signed 16-bit booster average current 100 mA**
bytes 17-33:as0-16 next entry
bytes 34-35: reserved
byte 36:8-bit frame type 0x02** not relevant for BlueBattery-Basic
Each read access auto increments the day counter until current day is reach, then it wraps around.
Reading starts at day first available day.
First all type 0x00 entries are send, then all type 0x01 frames etc.
Note: Reading "sec" characteristics resets read pointer to earliest available log entry.// Write to the log characteristics the first byte is interpreted as a command// command 0: clear log// command 1: set SOC to 100%// command 2: set log type in byte 2// command 2-15: reserved// command 16: only BBX >= V408 set True RMS mode, 0: off (default), 1: on. Read status back via settings, state saved, so via settings bit// command 17-98: reserved// command 99: reboot system// command 100: reboot in firmware upgrade mode// command 101: erase program// command 102: >= V306 save settings as factory defaults// command 103: >= V306 restore factory defaults// command 104-255: reservedGATTCHARACTERISTIC"4B616910-40bd-428b-bf06-698e5e422cd9""mV.mA"4 bytes, read notify(updates each 2 seconds)
bytes 0-1: big endian 16-bit mV momentary battery voltage
bytes 2-3: big endian 16-bit mA momentary charge current
Note: only available in V1xx Versions, replaced within "BC" commands 17,18GATTCHARACTERISTIC"4B616911-40bd-428b-bf06-698e5e422cd9""dAh.Wh"4 bytes, read notify(updates each 2 seconds)
bytes 0-1: big endian 16-bit dAh(Ah*10) daily accumulated
bytes 2-3: big endian 16-bit Wh daily accumulated
Note: only available in V1xx Versions, replaced within "BC" commands 19,20GATTCHARACTERISTIC"4B616912-40bd-428b-bf06-698e5e422cd9""BC"
until V206
notify read:
bytes 0-2:24-bit big endian value
byte 3: command
command:// comes in 2 seconds interval00: value Battery Current in mA
01: value Battery Charge in mAh
02: value SOCin0.1% steps
03: value Battery max Current per day in mA
04: value Battery min Current per day in mA
05: value Battery max Charge per day in10 mAh
06: value Battery min Charge per day in10 mAh
07: value Battery max Voltage per day in10 mV
08: value Battery min Volatge per day in10 mV
09: value Solar max Current per day in10 mW
10: value Solar max Watt per day in10 mA
11: value Temperature in °C binary offset
12: value min Temperature per day in °C binary offset
13: value max Temperature per day in °C binary offset
14: value summed total charge per day in mAh
15: value summed total discharge per day in mAh
16: value summed total external charge per in mAh
// available starting with V2xx Versions17: value battery voltage(from solar charger)in mV
18: value solar charge current in mA
19: value solar charge in mAh
20: value solar energy in mWh
21: status solar charger(might come more frequently)22: value solar PV module voltage in10mV(only D1 Version, might come more frequently)23-127: reserved
// notifications128: notification ofnewintraday log entry with record #
129-255: reserved
newFormat starting withV300
extended length of notification >4 bytes
the actual size of the notification is always fixed length covering at the least longest frame
the longest frame is 18bytes(max 20 bytes by hardware)
byte 0: frame type
byte 1: length of data
byte 2...: data bytes
frame: Live Measurements
byte 0: type 0
byte 1: length 72bytes(17) value battery voltage in mV
2bytes(18) value solar charge current in10mA**3bytes(00) value Battery Current in mA
** not relevant for BlueBattery-Basic
frame: BlueBattery Solar Charger**
byte 0: type 1
byte 1: length 9(EBL),11(D1,D2,BB-X),12(BB-X>=V407)2bytes(09) value Solar max Current per day in mA
2bytes(10) value Solar max Watt per day in1W
2bytes(19) value solar charge in10mAh(*)2bytes(20) value solar energy in Wh
1byte(21) status solar charger(*) bit 7 indicates sleep
2bytes(22) value solar PV module voltage in10mV(*)1 byte Relais Status(BB-X>=V407)
bit 0:0:off /1:on
bit 1:1:SOC
bit 2:1:Board Voltage
bit 3:1:Starter Voltage
bit 4:1:Temperature
bit 5:1:Solar Current
bit 6:1:Time
bit 7: reserved
**entire frame not relevant for BlueBattery-Basic
frame: BlueBattery Battery Computer 1
byte 0: type 2
byte 1: lenghth 162bytes(01) value Battery Charge in10mAh(*)2bytes(02) value SOCin0.1% steps
2bytes(03) value Battery max Current per day in10mA(*)2bytes(04) value Battery min Current per day in10mA(*)2bytes(05) value Battery max Charge per day in10mAh
2bytes(06) value Battery min Charge per day in10mAh
2bytes(07) value Battery max Voltage per day in10mV
2bytes(08) value Battery min Volatge per day in10mV
frame: BlueBattery Battery Computer 2
byte 0: type 3
byte 1: lenghth 152bytes(11) value Temperature in °C binary offset
2bytes(12) value min Temperature per day in °C binary offset
2bytes(13) value max Temperature per day in °C binary offset
3bytes(14) value summed total charge per day in32/225mAh(*)3bytes(15) value summed total discharge per day in32/225mAh(*)3bytes(16) value summed total external charge per in32/225mAh(*)**** not relevant for BlueBattery-Basic
frame: notification ofnewintraday log entry
byte 0: type 4
byte 1: length 1
byte 2: record #
(*) scale factor changed compared to previouse versions
frame: Booster data
byte 0: type 5
byte 1: length 10,4 when no booster present
2 bytes value output voltage in10mV(Board Battery)**2 bytes value input voltage in10mV(Starter Battery)**2 bytes signed value charge current in100mA(Booster current)1 byte status booster
3 bytes value summed total booster charge per day in32/225 mAh
**for BlueBattery-Basic PID_0001, all other values are 0,undefinedGATTCHARACTERISTIC"4B616913-40bd-428b-bf06-698e5e422cd9""Set"// 0..1 : 16 bit 0..14 C20 design capacity in Ah, bit 15 invert current polarity// 2 : 8 bit tail current in 0.1% steps 0 - 10%// 3..4 : 16 bit 0..14 charged voltage in mV, bit 15 lithium type of battery// 5 : 8 bit charged time in minutes// 6 : 8 bit fractional part peukert coef 1.00 to 1.50 in 0.1 steps// 7 : 8 bit charge efficency in %// 8..9 : 16 bit current threshold in mA// 10 : 8 bit current offset trim, mid is 127// 11 : 8 bit current gain factor trim, mid is 127// 12 : 8 bit voltage gain factor trim, mid is 127// 13 : configuration information (should not be changed for writing)// bit 0: ID0 board configuration Sensor type 0: 50A, 1: 150A// bit 1: ID1 board configuration Sensors 0: 2 Sensors, 1: 1 Sensor// 14 : 8 bit temperature offset trim, mid is 127, range -12.7 .. +12.8 C// 15 : 8 bit software configuration// : bit 0: add solar current**// : bit 1: enable Bluetooth Advertizing switch// : bit 2: prefer analog over booster Out Voltage (starting with V401)// : bit 3: True RMS 0: off (default), 1: on (V408)// : bit 4-7: reserved// 16 : 8 bit starter voltage gain trim, mid is 127*****for BlueBattery-Basic not relevant
***for BlueBattery-Basic
starting withBB-Xwith Relais Control:// 17 : Relais config// : bit 0: invert// : bit 1: SOC based// : bit 2: Board voltage// : bit 3: Starter voltage// : bit 4: Temperature// : bit 5: Solar current// : bit 6: Time// : bit 7: reserved// 18 : 8 bit 0-255 minutes Relais min on time// 19 : 8 bit 0-255 minutes Relais off delay// 20 : bit 0-6: 0-100% SOC floor// 21 : bit 0-6: 0-100% SOC clear// 22-23 : 16 bit Board Low Voltage on in mV// 24-25 : 16 bit Board Low Voltage clear in mV// 26-27 : 16 bit Board High Voltage on in mV// 28-29 : 16 bit Board High Voltage clear in mV// 30-31 : 16 bit Starter Low Voltage on in mV// 32-33 : 16 bit Starter Low Volatge clear in mV// 34-35 : 16 bit Starter High Voltage on in mV// 36-37 : 16 bit Starter High Volatge clear in mV// 38 : 8 bit Temperature Low on -40.0 C / +87.5 C in 0.5 C steps// 39 : 8 bit Temperature Low clear -40.0 C / +87.5 C in 0.5 C steps// 40 : 8 bit Temperature High on -40.0 C / +87.5 C in 0.5 C steps// 41 : 8 bit Temperature High clear -40.0 C / +87.5 C in 0.5 C steps// 42-43 : 16 bit Solar Current High on in 100 mA// 44-45 : 16 bit Solar Current High clear in 100 mA// 46-47 : 16 bit time1 on seconds/2 since midnight// 48-49 : 16 bit time1 off seconds/2 since midnight// 50-51 : 16 bit time2 on seconds/2 since midnight// 52-53 : 16 bit time2 off seconds/2 since midnight
Manufacturer Specific Broadcast in Scan Response packet:0xfftype(manufacturer specific)14 or 15 bytes
bytes 0-1:16-bit big endian mV battery Voltage
bytes 2-3:16-bit big endian mA solar charge current
bytes 4-7:32-bit big endian mAh solar accumulated daily charge
bytes 8-11:32-bit big endian mWh solar accumulated daily energy
Watts needs to be computed from mW = mV * mA /1000
bytes 12-13:16-bit big endian 8mA battery current
byte 14:8-bit SoC in0..100%(optional firmware >V134)
BlueBattery-Basic:0xfftype(manufacturer specific)7 bytes
bytes 0-1:16-bit big endian 10mV battery voltage
bytes 2-3:16-bit big endian 10mV car battery voltage
bytes 4-5:16-bit big endian 8mA battery current
byte 6:8-bit SoC in0..100%
After power cycle the device restarts with seconds of0, historic log entries are *not* preserved.
Mega, Danke!!!