What happens
The charger shows as connected, after a while it disconnects and reconnects, over and over. If the drops come at a fixed rhythm (every 60 s, every 5 minutes), it's almost never the server: something in between closes connections that look idle.
Check it in two minutes
Leave the charger connected to the test server for a while and check in the log how often it disconnects, whether it sends heartbeats, and whether after each drop it introduces itself again with BootNotification (it restarted) or just reconnects (it's the network). Open the OCPP test server →
The causes, most likely first
1. The network closes connections that stay quiet
Routers, mobile operators (4G) and some firewalls drop a TCP connection after a while without traffic. An OCPP WebSocket can stay silent for minutes between heartbeats.
How to fix it: Lower the heartbeat interval (HeartbeatInterval, which the server proposes in the BootNotification response) or enable the WebSocket ping (WebSocketPingInterval in 1.6) at 30-60 s.
2. WebSocket ping is off or too long
With WebSocketPingInterval=0 the charger sends no pings, and if the server doesn't either, nothing keeps the connection alive.
How to fix it: Set it between 30 and 60 seconds.
3. Weak mobile coverage
With a SIM at the edge of coverage, every dip drops the connection. You can tell because the drops have no fixed rhythm.
How to fix it: External antenna, another operator, or a cable.
4. The charger restarts
A watchdog firing, a power cut or unstable firmware. You can tell because a new BootNotification arrives after each drop.
How to fix it: If a BootNotification comes with every reconnection, look at the firmware and power supply, not the network.
What askacharge.com does
A disconnecting charger fires the charger.offline webhook at once, but the email alert waits two minutes and only goes out if it hasn't come back: a restart or a few seconds' drop won't flood your inbox.
Frequently asked questions
How often should an OCPP charger send heartbeats?
The server decides in the BootNotification response (interval). 60 to 300 seconds is usual; if the network drops idle connections, stay close to 60.
What is WebSocketPingInterval?
An OCPP 1.6 configuration key that sets how many seconds between the charger's WebSocket pings to keep the connection alive. 0 turns it off.