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

network connection profiles #410

Closed
wants to merge 36 commits into from
Closed

Conversation

SNSubramanya
Copy link
Contributor

No description provided.

@SNSubramanya SNSubramanya linked an issue Jan 22, 2024 that may be closed by this pull request
@SNSubramanya SNSubramanya force-pushed the 408-network-connection-profiles branch from 95a6a1a to a5d1c79 Compare January 29, 2024 09:52
@maaikez maaikez force-pushed the 408-network-connection-profiles branch from 1f7d92e to 944e2aa Compare February 19, 2024 16:23
@@ -47,7 +48,7 @@ class WebsocketBase {
WebsocketConnectionOptions connection_options;
std::function<void(const int security_profile)> connected_callback;
std::function<void()> disconnected_callback;
std::function<void(const websocketpp::close::status::value reason)> closed_callback;
std::function<void(const WebsocketCloseReason reason)> closed_callback;
std::function<void(const std::string& message)> message_callback;
websocketpp::lib::shared_ptr<boost::asio::steady_timer> reconnect_timer;
Copy link
Contributor

Choose a reason for hiding this comment

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

@hikinggrass maybe we should also abstract usage to the timer and use the evse timer instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes and there is more to be abstracted I think. I did not go through all the websocketpp things there, only the things I needed to be changed. I did not look into detail how websocketpp and the websocket in general works.

@@ -50,7 +54,7 @@ class Websocket {

/// \brief register a \p callback that is called when the websocket connection has been closed and will not attempt
/// to reconnect
void register_closed_callback(const std::function<void(const websocketpp::close::status::value reason)>& callback);
void register_closed_callback(const std::function<void(const WebsocketCloseReason reason)>& callback);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can keep the closed_callback and disconnected_callback for now because they are implicitly used to manage the reconnect behavior, but to reduce complexity of the interface I would prefer to not have the seperated after this refactor is done

@maaikez maaikez force-pushed the 408-network-connection-profiles branch from 48f7846 to 86b7632 Compare March 19, 2024 15:59
@EVerest EVerest deleted a comment from SNSubramanya Mar 19, 2024
@maaikez maaikez force-pushed the 408-network-connection-profiles branch from 3eb08ca to 63ead24 Compare March 19, 2024 16:26
@maaikez
Copy link
Contributor

maaikez commented Mar 19, 2024

There are a lot of changes now. Tested this with websocket plain (not tls) and only ocpp 2.0.1. Is it possible to take a look again if this is the direction we want to go?

Maybe we want to move 'ping' to the connectivity manager as well.

@maaikez maaikez force-pushed the 408-network-connection-profiles branch 4 times, most recently from 84d3a3b to 2657cad Compare March 19, 2024 17:22
SNSubramanya and others added 10 commits March 27, 2024 14:52
Signed-off-by: Soumya Subramanya <[email protected]>

[wip] fixed bug in print statement

Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Maaike <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Maaike <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Maaike <[email protected]>
… connection profile

Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Maaike <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Maaike <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Maaike <[email protected]>
…ionProfile should not be an optional. Add configuration slot as parameter. Disconnected callback: also add configuration slot and NetworkConnectionProfile.

Signed-off-by: Maaike Zijderveld <[email protected]>
Signed-off-by: Maaike <[email protected]>
AssemblyJohn and others added 22 commits March 27, 2024 14:52
Signed-off-by: AssemblyJohn <[email protected]>
Signed-off-by: Maaike <[email protected]>
…umentation for network connectivity.

Signed-off-by: Maaike Zijderveld <[email protected]>
Signed-off-by: Maaike <[email protected]>
…r we will remove it completely.

Signed-off-by: Maaike <[email protected]>
…disconnected is indeed connected. Init function: try next configuration priority if the current is not found. Remove some TODO's that are already implemented.

Signed-off-by: Maaike <[email protected]>
…ger to reconnect with backoff wait time.

Signed-off-by: Maaike <[email protected]>
… network slots in connectivity manager.

Signed-off-by: Maaike <[email protected]>
Signed-off-by: Maaike <[email protected]>
Signed-off-by: Maaike <[email protected]>
… is not set to wss). Extra check if websocket is already stopped. Extra check if a reconnection is already taking place (in connectivity manager).

Signed-off-by: Maaike <[email protected]>
@maaikez maaikez force-pushed the 408-network-connection-profiles branch from b3a2043 to 9d2e723 Compare March 27, 2024 13:53

/// \brief Default timeout for the return value (future) of the `configure_network_connection_profile_callback`
/// function.
constexpr int32_t default_network_config_timeout_seconds = 60;
Copy link
Contributor

Choose a reason for hiding this comment

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

These can (should) be chrono types

EVLOG_debug << "Init websocket without config slot, use first available: " << config_slot_int;
} else {
// No network connection profile. Retry connecting after some time, maybe it is set manually.
EVLOG_info << "No network connection profile set. Try again later.";
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can try this more often then every 300 seconds but not print this message every time?

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.

Extend Network Connection Profiles
5 participants