Connect machines

Send pings from a machine

A ping is one small HTTPS request. The machine sends it about once a minute, and every time it does, What Started knows the machine is alive. A ping can also carry the machine's status, its part counter and the part it is running.

If pings stop, What Started marks the machine as No signal after two missed pings (never sooner than two minutes) and emails your admins.

1. Make a ping token

Open the machine, and under Machine pings click New ping token. Copy the token straight away: it is shown once. Each token only works for its own machine.

2. Send a ping

The simplest ping is a POST with the token and nothing else:

curl -X POST https://heartbeat.example.com/api/v1/ping \
  -H "Authorization: Bearer hbp_…"

Most machines also send a status and counter:

curl -X POST https://heartbeat.example.com/api/v1/ping \
  -H "Authorization: Bearer hbp_…" \
  -H "Content-Type: application/json" \
  -d '{"status":"run","cycleCount":1200,"badCount":7,"partNumber":"A-100"}'

Clients that can only make GET requests, which includes many PLCs and Niagara stations, can put everything in the URL:

https://heartbeat.example.com/api/v1/ping?token=hbp_…&status=run&cycleCount=1200

For complete scripts in curl, Python and Node-RED, see Ping from curl, Python or Node-RED.

What to send

Field What it is
status run, down, idle, wait or off
cycleCount The machine's part counter, as it is. Resets are fine.
badCount A reject counter, if the machine has one
partNumber The part running now
custom Up to 20 numbers of your own, like {"spindle_load": 41.5}

Every field is optional. Send the counters as running totals straight from the PLC: What Started works out the parts made between pings, and carries on when a counter resets.

Counts, part numbers and custom numbers need a plan with machine counts.

How often

Once a minute is right for most machines. Sending faster is fine: the heartbeat always counts, and metrics are stored at the plan's rate.

When something is wrong

Every reply has a requestId. Errors say what is wrong, for example a mistyped field name or a revoked token. Quote the request id if you contact us.