MicroOcpp icon indicating copy to clipboard operation
MicroOcpp copied to clipboard

TxMessageAttempts optionally ignores offline attempts

Open matth-x opened this issue 11 months ago • 0 comments

Add build switch MO_TX_ATTEMPT_TIMEOUT to control if a message timeout should increment the TxMessageAttempts counter.

MO only attempts to send messages when the WebSocket is in the connected state. This is, however, no guarantee that the signal strength is sufficient so that the messages actually arrive at the server and in consequence, the attempt fails. During long periods with bad signal strength, the connection could frequently switch between the connected and unconnected states without ever allowing OCPP operations to pass through. MO would effectively drop the offline tx queue then, even though there is nothing wrong with these messages themselves.

The new option MO_TX_ATTEMPT_TIMEOUT allows to control what happens if tx-related messages time out. In the default setting, MO_TX_ATTEMPT_TIMEOUT=1, a timed-out message increments the attempt counter (current behavior). MO_TX_ATTEMPT_TIMEOUT=0 defines that time-outs should leave the attempt counter like before (optional, new behavior).

Update (2025-07-26): This also fixes the issue that a gap in the local transaction files stalls the transaction send queue.

matth-x avatar Jan 26 '25 15:01 matth-x