Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dalathegreat committed Nov 27, 2023
1 parent 470ddc7 commit 1b297af
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
1 change: 0 additions & 1 deletion Software/Software.ino
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ void send_can() {
//---- Receives serial data and transfers to the Inverter
void receive_serial() {
unsigned long currentMillis = millis();
Serial.println(currentMillis);
if (currentMillis - previousMillis1ms >= interval1) { //--- try 2 second
previousMillis1ms = currentMillis;
manageSerialLinkReceiver();
Expand Down
51 changes: 34 additions & 17 deletions Software/src/battery/SERIAL-LINK-RECEIVER-FROM-BATTERY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,39 @@ void manageSerialLinkReceiver() {
}

void update_values_serial_link() {
Serial.println("Values from battery: ");
Serial.print("SOC: ");
Serial.println(SOC);
Serial.println(StateOfHealth);
Serial.println(battery_voltage);
Serial.println(battery_current);
Serial.println(capacity_Wh);
Serial.println(remaining_capacity_Wh);
Serial.println(max_target_discharge_power);
Serial.println(max_target_charge_power);
Serial.println(bms_status);
Serial.println(bms_char_dis_status);
Serial.println(stat_batt_power);
Serial.println(temperature_min);
Serial.println(temperature_max);
Serial.println(cell_max_voltage);
Serial.println(cell_min_voltage);
Serial.println(batteryAllowsContactorClosing);
Serial.println(inverterAllowsContactorClosing);
Serial.print(SOC);
Serial.print(" SOH: ");
Serial.print(StateOfHealth);
Serial.print(" Voltage: ");
Serial.print(battery_voltage);
Serial.print(" Current: ");
Serial.print(battery_current);
Serial.print(" Capacity: ");
Serial.print(capacity_Wh);
Serial.print(" Remain cap: ");
Serial.print(remaining_capacity_Wh);
Serial.print(" Max discharge W: ");
Serial.print(max_target_discharge_power);
Serial.print(" Max charge W: ");
Serial.print(max_target_charge_power);
Serial.print(" BMS status: ");
Serial.print(bms_status);
Serial.print(" BMS status dis/cha: ");
Serial.print(bms_char_dis_status);
Serial.print(" Power: ");
Serial.print(stat_batt_power);
Serial.print(" Temp min: ");
Serial.print(temperature_min);
Serial.print(" Temp max: ");
Serial.print(temperature_max);
Serial.print(" Cell max: ");
Serial.print(cell_max_voltage);
Serial.print(" Cell min: ");
Serial.print(cell_min_voltage);
Serial.print(" batteryAllowsContactorClosing: ");
Serial.print(batteryAllowsContactorClosing);
Serial.print(" inverterAllowsContactorClosing: ");
Serial.print(inverterAllowsContactorClosing);
}

0 comments on commit 1b297af

Please sign in to comment.