Add OCPP WebSocket session ID to connection status tracking

XMLWordPrintable

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major
    • Component/s: DB, OCPP
    • None

      Currently OCPP WebSocket connections are tracked via "connected" and "disconnected" user events, and their associated status maintained in the solarev.ocpp_charge_point_status table. It is possible for a charger to connect to a 2nd session without first closing the 1st session, such as from network failures. When that happens, the user events are misleading:

      1. connected (session A)
      2. connected (session B) ← here we can infer that session A is invalid
      3. disconnected (session A) ← here we can infer that session B is still valid

      Because the disconnected comes last in that sequence of events, it might be inferred that the charger is not connected, when in fact it is connected to session B. The solarev.ocpp_charge_point_status table will also end up with a NULL connected_to column, when really it should preserve the connected state of session B.

      This ticket is to address both issues, by

      1. Add the WebSocket session ID to all connected and disconnected events. Thus client applications can infer correctly if the charger is still connected by the events alone.
      2. Add the WebSocket session ID to the solarev.ocpp_charge_point_status table and update the functions that maintain it so that disconnected events do not clear the connected_to unless the event is for the same session ID stored from the last connected event.

            Assignee:
            Matt Magoffin
            Reporter:
            Matt Magoffin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: