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

OCPP, OCPP201: interface subscriptions happen too late #841

Open
barsnick opened this issue Aug 30, 2024 · 0 comments
Open

OCPP, OCPP201: interface subscriptions happen too late #841

barsnick opened this issue Aug 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@barsnick
Copy link
Contributor

Describe the bug

The OCPP201 module subscribes many (most) of the interface variables in its ready() function, probably due to dependencies on the Charger state machine.

This leads to the module potentially missing published variables from other modules, especially "early" infos such as EvseManager state changes and FirmwareUpdateNotifications.

This has been observed in real-life scenarios.

This also affects the OCPP module's system interface, while evse_manager and error seem to be handled properly there.

EVerest Domain

OCPP1.6, OCPP2.0.1

Affected EVerest Module

OCPP201 OCPP

To Reproduce

From a module providing the system interface, publish a firmware_update_status = Installed variable immediately in its ready().

Note how the OCPP201 (and probably OCPP) module never handles this variable, as it isn't subscribing yet, and therefore does not send the corresponding message to the CSMS.

Anything else?

This affects OCPP 2.0.1 requirement L01.FR.28.

This is a follow-up to EVerest/libocpp#758

The OCPP module (implementing OCPP 1.6) correctly (mostly) subscribes in init(), but queues all requests while the Charger is not yet running:

if (!this->started) {
EVLOG_info << "OCPP not fully initialized, but received a session event on evse_id: " << evse_id
<< " that will be queued up: " << session_event.event;
std::scoped_lock lock(this->session_event_mutex);
this->event_queue[evse_id].push(session_event);
return;
}
this->process_session_event(evse_id, session_event);

Note that the OCPP module does not yet do this for the system interface:

// FIXME(kai): subscriptions should be as early as possible
this->r_system->subscribe_log_status([this](types::system::LogStatus log_status) {
this->charge_point->on_log_status_notification(log_status.request_id,
types::system::log_status_enum_to_string(log_status.log_status));
});
this->r_system->subscribe_firmware_update_status(
[this](types::system::FirmwareUpdateStatus firmware_update_status) {
this->charge_point->on_firmware_update_status_notification(
firmware_update_status.request_id,
conversions::to_ocpp_firmware_status_notification(firmware_update_status.firmware_update_status));
});

@barsnick barsnick added the bug Something isn't working label Aug 30, 2024
FaHaGit added a commit to chargebyte/everest-chargebyte that referenced this issue Sep 4, 2024
…ST-1175)

The variable to publish FirmwareStatusNotification::Installed message is
now delayed, because the message is dropped in case the OCPP client is
not connected. This is only a temporary solution as long as the
reported issues (EVerest/libocpp#758,
EVerest/everest-core#841) are not fixed.

Signed-off-by: Fabian Hartung <fabian.hartung@chargebyte.com>
FaHaGit added a commit to chargebyte/everest-chargebyte that referenced this issue Sep 4, 2024
…ST-1175)

The variable to publish FirmwareStatusNotification::Installed message is
now delayed, because the message is dropped in case the OCPP client is
not connected or the OCPP module is not yet subscribed to the variable.
This is only a temporary solution as long as the
reported issues (EVerest/libocpp#758,
EVerest/everest-core#841) are not fixed.

Signed-off-by: Fabian Hartung <fabian.hartung@chargebyte.com>
FaHaGit added a commit to chargebyte/everest-chargebyte that referenced this issue Sep 4, 2024
…ST-1175)

The variable to publish FirmwareStatusNotification::Installed message is
now delayed, because the message is dropped in case the OCPP client is
not connected or the OCPP module is not yet subscribed to the variable.
This is only a temporary solution as long as the
reported issues (EVerest/libocpp#758,
EVerest/everest-core#841) are not fixed.

Signed-off-by: Fabian Hartung <fabian.hartung@chargebyte.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant