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

FirmwareStatusNotification::Installed from system interface gets dropped if sent before registered #758

Open
barsnick opened this issue Aug 26, 2024 · 1 comment
Labels
bug Something isn't working OCPP2.0.1

Comments

@barsnick
Copy link
Contributor

barsnick commented Aug 26, 2024

OCPP Version

OCPP2.0.1

Describe the bug

If the System module (or whatever implementation of the system interface) publishes its firmware_update_status right after reboot (in ready() of course), but the OCPP201 module has not yet registered with the CSMS, the FirmwareStatusNotification::Installed apparently gets dropped and never sent to the CSMS.

If the System module delays publishing this value, it properly propagates to the CSMS.

To Reproduce

Trigger a firmware update from the CSMS. Handle sending of FirmwareStatusNotification::Installed after reboot.

Anything else?

This is possibly an issue with the FirmwareStatusNotification being sent "async":

ocpp::Call<FirmwareStatusNotificationRequest> call(req, this->message_queue->createMessageId());
this->send_async<FirmwareStatusNotificationRequest>(call);

and the applied filtering in send_async():
case MessageTransmissionPriority::SendImmediately:
return this->message_queue->push_async(call);
case MessageTransmissionPriority::SendAfterRegistrationStatusAccepted:
case MessageTransmissionPriority::Discard:
auto promise = std::promise<EnhancedMessage<MessageType>>();
auto enhanced_message = EnhancedMessage<MessageType>();
enhanced_message.offline = true;
promise.set_value(enhanced_message);
return promise.get_future();

affected by get_message_transmission_priority():
if (is_transaction_related || queue_all_message) {
return MessageTransmissionPriority::SendAfterRegistrationStatusAccepted;
}
return MessageTransmissionPriority::Discard;

Possibly, a FirmwareStatusNotification should be handled with a similar priority to a transaction related message.

FaHaGit added a commit to chargebyte/everest-chargebyte that referenced this issue Aug 27, 2024
…ST-1175)

This is only a temporary fix. The root cause of the issue is in
the libocpp (ref: EVerest/libocpp#758).

The workaround should be removed once the issue is fixed in libocpp.

Signed-off-by: Fabian Hartung <[email protected]>
FaHaGit added a commit to chargebyte/everest-chargebyte that referenced this issue Aug 27, 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 issue (EVerest/libocpp#758) is not fixed.

Signed-off-by: Fabian Hartung <[email protected]>
@hikinggrass hikinggrass added the bug Something isn't working label Aug 27, 2024
@barsnick
Copy link
Contributor Author

It turns out that our System module sends FirmwareStatusNotification::Installed in ready(), but before OCPP201's ready() has managed to subscribe to the topic. This is very ugly. The OCPP (1.6) module has solved this by subscribing in init().

That said, I still don't know whether the said filter is doing the right thing.

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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OCPP2.0.1
Projects
None yet
Development

No branches or pull requests

3 participants
@hikinggrass @barsnick and others