I did not find anything like a step-by-step guide for extracting the log data from the SBMS0 but did find the clipped text below from the manual. That mostly explains the data but not really a prototype of process for extracting the data. There is mention of uncompressed data and formatted in .csv but short on details how to make that file available on a connected device like a laptop.
Clipped
The SBMS has an internal 128Mbit (16Mbyte) SPI Flash memory that can log data at a fixed 2 minute interval. The memory is capable of storing a full year (12months) of data in a circular type buffer so you always have the last 12 months worth of data in that internal Flash memory.
In order for the data logging to start you will need to set the Date and Time and you will notice the small “mem” symbol in the lower right side of the SBMS LCD being highlighted.
The data is also stored compressed in the memory same base 91 compression mentioned in the WiFi chapter and contains the data sent also over WiFi in the sbms variable.
Here is an explanation of what is contained there and what it is logged in the internal memory.
var sbms="YMDHMS%%C1C2C3C4C5C6C7C8ITET+BATPV1PV2EXTAD2AD3AD4ht1ht2ERR"
Y-year last two digit (limited to 2090); ( sorry if you read this in 2091 I will not expect a software update :) ).
M-month
D-day
H-hour
M-minute
S-seconds
%% - SOC 0 to 100%
C1 to C8 - cell voltage in mV
IT and ET - internal and external temperature in hundreds of a degree 0 is -45C and 1449 is 99.9C so you need to subtract 450 from the result and divide by 10 (example 689 as result of the decompression will be (689-450)/10=23.9C) + - sign for battery charging (+) and discharging (-) used as it is no compression.
BAT - Battery current in mA from -750000mA to +150000mA
PV1 - PV1 input current in mA
PV2 - PV2 input current in mA
EXT - Ext Load current (the use of 10A up to 500A 75mV external current shunt is possible on both SBMS40 and SBMS120 see page 13)
AD2 and AD3 - user available ADC inputs the value is the digital output of the ADC.
ht1, ht2 - reserved for power output of the DMPPT450
ERR - this is error code it will contain the information referring to the error flags on the SBMS.
There are 15 Flags (see monitoring page3 on SBMS) not all flags represent an error some are representing normal operation and if you consider this a 15bit binary number each bit representing one flag with “1” highlighted and “0” not highlighted and you start from the top left with OV flag and continue to right and then down to the last flag DFET and consider the OV as the least significant bit and DFET most significant bit then you get this binary number and convert to decimal that will be the value contained in this ERR Status and you can also see this number on the SBMS LCD just under the battery SOC value and also displayed as Status: in the html page.
Uncompressed data and formatted in .csv as it was on SBMS4080 will look like this
Y ,M ,D ,H ,M ,S ,SOC,cel1 ,cel2 ,cel3 ,cel4 ,cel5 ,cel6 ,cel7 ,cel8 ,IT ,ET ,-Batt , PV1 , PV2 ,ExtLoad, ADC2, ADC3, ADC4, heat1 , heat2 , ERR
00,01,31,22,53,47,100,3414,3416,3444,3433,3426,3419,3420,3380,000,000,-002000,000000,000000,000000,000000,000000,000000,000000,000000,000000
This is the javascript function for decompression (you will find this inside the SBMS webpage) function dcmp(p,s,d){xx=0; for (z=0;z<s;z++){xx =
xx + ((d.charCodeAt((p+s-1)-z)-35)*Math.pow(91,z));}return xx;}
where
p - location of the data in the string.
s - size of the data (example year is 1 cell voltage is 2 and PV1 current is 3)
d - the name of the variable in this case sbms.
You can download the compress raw data available in the internal memory over UART by going to Device Settings menu and Internal data log sub-menu were you can select the month you want to download.
Before that set the UART to ON and the baud rate you prefer in the Device settings and connect the USB port to your computer if you have the WiFi/USB extension board or if not you can use the UART TX line from SBMS0 16pin connector but make sure to add some sort of optical or galvanic isolation if your computing device is supplied from same main Lithium battery that SBMS0 protects.
On your computing device have some sort of serial data logger that should collect all the data that will be transmitted when you push the Start Download data button.
Below you see an example of one hour of compressed data made of 30 sets of data since it will log each 2 minutes and there are 744 hours in a full month and you can get why I can not list all in the manual. When saved as a text file it will be about 1.4MB of compressed data.