Skip to content

Battery Statistic Upload

The battery statistic upload can be executed anytime. They are stored for each battery (BMS) individual with a separated timestamp.

As use case, the battery packs can be monitored and the used energy amount can be determined when data is compared before and after a period.

  • charge amount [Ws]
  • discharge amount [Ws]

Further included statistics are:

  • pack information from cyphal registry
  • time at temperature [ms/temp-block with 42 temp limits]
  • time at voltage/current (2 dimensional) [ms/current/volt, 5 current limit, 6 voltage limits]
  • time at operational state [ms/fsm_state]
  • time at detected error [10s/error]
  • turn on / off counter
  • average uptime [s]

Setup Requirements

  • CAN Connection to 1-6 BMSes
  • BMS activated and accessible via Cyphal
  • BMS Firmware >= 0.11
  • A S3 cloud storage
  • Access credentials from environmental variables:

    `bash export AWS_ACCESS_KEY_ID=abc export AWS_SECRET_ACCESS_KEY=abc-abc export AWS_ENDPOINT_URL=https://embedded-device-stats.s3.fr-par.scw.cloud export AWS_BUCKET_NAME=embedded-device-stats export AWS_REGION=fr-par

Procedure

Now comes the automated checkout procedure: run highdra battery statistic_upload, and follow the instructions on the screen.

First, select the CAN interface to use. Normally you should only have a single one, but if you have multiple connected, select the one you connected to the charging hub.

PS C:\Users\x> highdra battery statistic_upload
? CAN3 interface CAN FD
   socketcan:can0
   socketcan:can1
 » usbtingo:1731625A

From there on, the procedure will run more or less automatically.

Example Output for 6 BMSes

 highdra battery  statistic-upload
? CAN3 interface socketcan:can1

▸ Running BMS Statistics Read and Upload.
▸ 6 BMS devices detected.
▸ [1/24] Fetching cell_capacity_monitor.dat, BMS Node 6...
▸ [2/24] Fetching cell_capacity_monitor.dat, BMS Node 4...
▸ [3/24] Fetching cell_capacity_monitor.dat, BMS Node 8...
▸ [4/24] Fetching cell_capacity_monitor.dat, BMS Node 12...
▸ [5/24] Fetching cell_capacity_monitor.dat, BMS Node 2...
▸ [6/24] Fetching cell_capacity_monitor.dat, BMS Node 10...
▸ [7/24] Fetching cell_usage_monitor.dat, BMS Node 6...
▸ [8/24] Fetching cell_usage_monitor.dat, BMS Node 4...
▸ [9/24] Fetching cell_usage_monitor.dat, BMS Node 8...
▸ [10/24] Fetching cell_usage_monitor.dat, BMS Node 12...
▸ [11/24] Fetching cell_usage_monitor.dat, BMS Node 2...
▸ [12/24] Fetching cell_usage_monitor.dat, BMS Node 10...
▸ [13/24] Fetching pack_operation_range.dat, BMS Node 6...
▸ [14/24] Fetching pack_operation_range.dat, BMS Node 4...
▸ [15/24] Fetching pack_operation_range.dat, BMS Node 8...
▸ [16/24] Fetching pack_operation_range.dat, BMS Node 12...
▸ [17/24] Fetching pack_operation_range.dat, BMS Node 2...
▸ [18/24] Fetching pack_operation_range.dat, BMS Node 10...
▸ [19/24] Fetching Cyphal Registry, BMS Node 6...
▸ [20/24] Fetching Cyphal Registry, BMS Node 4...
▸ [21/24] Fetching Cyphal Registry, BMS Node 8...
▸ [22/24] Fetching Cyphal Registry, BMS Node 12...
▸ [23/24] Fetching Cyphal Registry, BMS Node 2...
▸ [24/24] Fetching Cyphal Registry, BMS Node 10...
✓ BMS Statistics Read and Upload succeeded in 0:00:14.434372.

1. Detection of BMSes

The script will wait up to 10s until 1-6 BMSes have been discovered via CAN.

2. Download of statistic files

The Cyphal File Transfer Protocol is used to download statistic files from the BMSes. The files are stored on the local machine temporarily.

3. Parsing of statistic data

As the data from the BMSes is stored in a binary format, the script parses the data and creates json files.

4. Upload to S3

The final step is the upload of every json data file to the cloud storage, using credentials from environmental variables.