Skip to content

More robust ocpp connection#122

Open
PRosenb wants to merge 2 commits intoConnectorIO:5.0.xfrom
PRosenb:more-robust-ocpp-connection
Open

More robust ocpp connection#122
PRosenb wants to merge 2 commits intoConnectorIO:5.0.xfrom
PRosenb:more-robust-ocpp-connection

Conversation

@PRosenb
Copy link

@PRosenb PRosenb commented Mar 1, 2026

  • Change from chargerPointSerialNumber to serial which is OCPP Identity
    • The spec describes the connection URL in file ocpp-j-1.6-specification.pdf in 3.1.1. The spec file ocpp-1.6 edition 2.pdf describes the BootNotification request parameter chargePointSerialNumber as Optional. For these reasons, I feel we should use serial (OCPP Identify).
  • Register charger in newSession() as some chargers like the Ocular IQ Home Solar only sends the BootNotification message when the charger restarts.

PRosenb added 2 commits March 1, 2026 21:22
… (WebSocket URL path), register in newSession() as BootNotification isn't always sent.

Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Copy link
Contributor

@splatch splatch left a comment

Choose a reason for hiding this comment

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

I'm mostly fine with changes, but I am not sure if it will not impact other brands. Seem that spec is not strictly followed by many manufacturers, so maybe we should switch everything to rely on serial number. Thing is - then we can't distinguish multiple connections made by one charger. In such situation I think we should detect duplicate and close previous session. WDYT?

// Register session immediately on connect, don't wait for BootNotification
// as some chargers sends the BootNotification only if the charger is rebooted.
String identifier = information.getIdentifier();
if (identifier != null && identifier.startsWith("/")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not certain of this logic, should we be at all concerned about what comes in the identifier? Does your charger send inconsistent identifier?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, when my charger connects, the identifier is preceded with /. If we don't remove it here, we force the user to also specify the identifier with a preceded / in case of my charger..

@PRosenb
Copy link
Author

PRosenb commented Mar 1, 2026

I'm mostly fine with changes, but I am not sure if it will not impact other brands. Seem that spec is not strictly followed by many manufacturers, so maybe we should switch everything to rely on serial number. Thing is - then we can't distinguish multiple connections made by one charger. In such situation I think we should detect duplicate and close previous session. WDYT?

Do you have in mind to de-duplicate on the serial or the chargerPointSerialNumber or both?

@splatch
Copy link
Contributor

splatch commented Mar 1, 2026

I'm mostly fine with changes, but I am not sure if it will not impact other brands. Seem that spec is not strictly followed by many manufacturers, so maybe we should switch everything to rely on serial number. Thing is - then we can't distinguish multiple connections made by one charger. In such situation I think we should detect duplicate and close previous session. WDYT?

Do you have in mind to de-duplicate on the serial or the chargerPointSerialNumber or both?

I have only a faulty simulator to test things, I'll try to move forward on top of your commit. So you will be able to to test one more change from me later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants