MicroOcpp icon indicating copy to clipboard operation
MicroOcpp copied to clipboard

FreeVendActive

Open NuriaParra8997 opened this issue 1 year ago • 0 comments

Hello Matth,

I have some questions regarding the freeVendActive mode when the device starts with a car already connected (B1 state). I took the liberty of adding some debug statements in this part:

  if (freeVendActiveBool && freeVendActiveBool->getBool() && connectorPluggedInput) {
      MO_DBG_ERR("!freeVendTrackPlugged %d", !freeVendTrackPlugged);
      MO_DBG_ERR("connectorPluggedInput() %d", connectorPluggedInput());
      MO_DBG_ERR("!transaction %d", !transaction);
  
      if (!freeVendTrackPlugged && connectorPluggedInput() && !transaction) {
          const char *idTag = freeVendIdTagString ? freeVendIdTagString->getString() : "";
          if (!idTag || *idTag == '\0') {
              idTag = "A0000000";
          }
          MO_DBG_INFO("begin FreeVend Tx using idTag %s", idTag);
          beginTransaction_authorized(idTag);
          
          if (!transaction) {
              MO_DBG_ERR("could not begin FreeVend Tx");
          }
      }
  
      freeVendTrackPlugged = connectorPluggedInput();
  }

On startup, after ocpp_initialize_full, I call ocpp_setConnectorPluggedInput_m(2, Callback_true), so I see the log [MO] info (StatusNotification.cpp:52): New status: Preparing (connectorId 2). However, each time it enters Connector::loop:

[MO] ERROR (Connector.cpp:428): !freeVendTrackPlugged 1 [MO] ERROR (Connector.cpp:429): connectorPluggedInput() 0 [MO] ERROR (Connector.cpp:430): !transaction 1 .... [MO] ERROR (Connector.cpp:428): !freeVendTrackPlugged 0 [MO] ERROR (Connector.cpp:429): connectorPluggedInput() 1 [MO] ERROR (Connector.cpp:430): !transaction 1

And so on. The situation where !freeVendTrackPlugged = 1 and connectorPluggedInput() = 1 never occurs, so the transaction doesn’t start.

Any ideas? Thank you very much.

NuriaParra8997 avatar Nov 04 '24 11:11 NuriaParra8997