Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solax: Add inverter missing from CAN event, Solax #480

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

dalathegreat
Copy link
Owner

What

This PR implements a new event, incase the Solax inverter does not send any CAN data, we raise an event.

Why

To guide the user towards troubleshooting CAN wiring

How

This new event is raised if Solax CAN communication is gone for too long:
image

@@ -88,6 +89,12 @@ void update_values_can_inverter() { //This function maps all the values fetched
if (millis() - LastFrameTime >= SolaxTimeout) {
datalayer.system.status.inverter_allows_contactor_closing = false;
STATE = BATTERY_ANNOUNCE;
inverter_missing_on_can++;
if (inverter_missing_on_can > CAN_STILL_ALIVE) {
set_event(EVENT_CAN_INVERTER_MISSING, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this event clear datalayer.system.status.inverter_allows_contactor_closing ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is cleared 4 rows before the event is fired. No need to clear it really, if we go into a ERROR situation we open contactors. This event is setup as a WARNING, but if it is stable and not triggered accidentally, we could bump up the severity to ERROR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, was just a thought without any real checking of the code ;-)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always appreciate extra pairs of eyes 😀 👀

@@ -258,6 +259,8 @@ const char* get_event_message_string(EVENTS_ENUM_TYPE event) {
return "ERROR: High amount of corrupted CAN messages detected. Check CAN wire shielding!";
case EVENT_CAN_TX_FAILURE:
return "ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!";
case EVENT_CAN_INVERTER_MISSING:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a question for this PR (perhaps we could open an issue) ; but how are events handled when serial transmitter/receiver is used ? Will this event just fire on the inverter side ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@obbardc Best to open issue. Would be good to sync all events between the two lilygos. I did not write the implementation for the double lilyGo support!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

@dalathegreat dalathegreat merged commit d3ef811 into main Oct 6, 2024
58 checks passed
@dalathegreat dalathegreat deleted the improvement/inverter-CAN-missing-event branch October 6, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants