Skip to content

Commit

Permalink
Fix of 2 issues for Victron CANBUS (#57)
Browse files Browse the repository at this point in the history
* Fix for issue #55

* Fix for issue #56
  • Loading branch information
stuartpittaway authored Oct 5, 2021
1 parent 46d43c1 commit a2bab3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions ESPController/src/DIYBMSServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,8 @@ void DIYBMSServer::saveVictron(AsyncWebServerRequest *request)
}
}

saveConfiguration();

SendSuccess(request);
}

Expand Down
18 changes: 10 additions & 8 deletions ESPController/src/victron_canbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,26 @@ void victron_message_351()
send_canbus_message(0x351, (uint8_t *)&data, sizeof(data351));
}

//SOC value
//S.o.C value
void victron_message_355()
{

struct data355
{
uint16_t stateofchargevalue;
//uint16_t stateofhealthvalue;
//uint16_t highresolutionsoc;
};

data355 data;
//0 SOC value un16 1 %
data.stateofchargevalue = 100;
//2 SOH value un16 1 %
//data.stateofhealthvalue = 100;
if (_controller_state == ControllerState::Running && mysettings.currentMonitoringEnabled && currentMonitor.validReadings)
{
data355 data;
//0 SOC value un16 1 %
data.stateofchargevalue = currentMonitor.stateofcharge;
//2 SOH value un16 1 %
//data.stateofhealthvalue = 100;

send_canbus_message(0x355, (uint8_t *)&data, sizeof(data355));
send_canbus_message(0x355, (uint8_t *)&data, sizeof(data355));
}
}

//Battery voltage
Expand Down

0 comments on commit a2bab3d

Please sign in to comment.