Local TCP Ingestion
Push station data directly to the local Autumn Labs client over TCP.
The Autumn Labs SDK normally formats and sends station data for you. For advanced integrations, you can send the same event format directly to the local Autumn Labs client over TCP.
Use this path when an application runs on the station PC but cannot use an Autumn Labs SDK. The local client listens on loopback only:
127.0.0.1:5700Local TCP ingestion is preferred for station-side integrations because the Autumn Labs client can use its normal buffering and retry behavior when the network is unavailable.
Get the station ID
The event payload requires the registered station ID in the sid field. Run al info --verbose; the station ID is printed as stationID=<value>.
al info --verboseExample output:
stationID=stn_abc123You can capture it in a shell variable:
STATION_ID="$(al info --verbose | sed -n 's/^stationID=//p' | head -n 1)"$StationId = (al info --verbose | Select-String '^stationID=' | Select-Object -First 1).Line -replace '^stationID=', ''If STATION_ID is empty, confirm the station has been registered and the Autumn Labs client is installed on the machine sending data.
TCP message envelope
Write one JSON object per TCP message. End each message with a newline character (\n) so the local client can frame the JSON event.
{
"source_type": "sdk",
"file": "metrics",
"station_id": "stn_abc123",
"message": "{\"sid\":\"stn_abc123\",\"slt\":\"\",\"ser\":\"UNIT-123\",\"utc\":1778702400000000,\"mod\":\"production\",\"tag\":[\"manual\"],\"nam\":\"temperature\",\"met\":{\"value\":25.5,\"unit\":\"C\",\"type\":\"float\"},\"lim\":{\"upper\":30,\"lower\":20},\"rea\":\"\",\"res\":\"pass\"}"
}| Field | Type | Description |
|---|---|---|
source_type | string | Use sdk for local TCP ingestion. |
file | string | Event family. Use logs, metrics, states, or units. |
station_id | string | Registered station ID. This should match the payload sid. |
message | string | A JSON-encoded string containing the event payload. |
message must be a string, not a nested JSON object. Build the event payload first, serialize it to JSON, then place that string in the message field.
Common fields
Every event payload uses the same compact field names as the SDK.
| Field | Type | Description |
|---|---|---|
sid | string | Station ID. Run al info --verbose and use the value printed as stationID=<value>. |
slt | string | Optional station slot. Use an empty string when not applicable. |
ser | string | Optional unit serial number. Use an empty string for station-level events. |
utc | integer | Event timestamp as Unix microseconds. |
loc | string | Optional local UTC offset, for example -07:00. Omit it unless your integration needs to preserve the station's local offset. |
mod | string | Optional station mode. |
tag | string array | Optional tags. Use an empty array when not applicable. |
Send a metric
STATION_ID="$(al info --verbose | sed -n 's/^stationID=//p' | head -n 1)"
UTC_MICROS="$(($(date +%s) * 1000000))"
EVENT=$(
jq -nc \
--arg sid "$STATION_ID" \
--argjson utc "$UTC_MICROS" \
'{
sid: $sid,
slt: "",
ser: "UNIT-123",
utc: $utc,
mod: "production",
tag: ["manual", "tcp"],
nam: "temperature",
met: {value: 25.5, unit: "C", type: "float"},
lim: {upper: 30, lower: 20},
rea: "",
res: "pass"
}'
)
MESSAGE=$(
jq -nc \
--arg station_id "$STATION_ID" \
--arg message "$EVENT" \
'{source_type:"sdk", file:"metrics", station_id:$station_id, message:$message}'
)
printf '%s\n' "$MESSAGE" | nc 127.0.0.1 5700$StationId = (al info --verbose | Select-String '^stationID=' | Select-Object -First 1).Line -replace '^stationID=', ''
$UtcMicros = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() * 1000
$Event = @{
sid = $StationId
slt = ""
ser = "UNIT-123"
utc = $UtcMicros
mod = "production"
tag = @("manual", "tcp")
nam = "temperature"
met = @{
value = 25.5
unit = "C"
type = "float"
}
lim = @{
upper = 30
lower = 20
}
rea = ""
res = "pass"
} | ConvertTo-Json -Depth 10 -Compress
$Envelope = @{
source_type = "sdk"
file = "metrics"
station_id = $StationId
message = $Event
} | ConvertTo-Json -Depth 10 -Compress
$Client = [System.Net.Sockets.TcpClient]::new("127.0.0.1", 5700)
$Writer = [System.IO.StreamWriter]::new($Client.GetStream())
$Writer.WriteLine($Envelope)
$Writer.Flush()
$Writer.Dispose()
$Client.Dispose()Metric payload fields:
| Field | Type | Description |
|---|---|---|
nam | string | Metric name. |
met.value | any | Metric value. |
met.unit | string | Optional unit, for example C, mm, or ms. |
met.type | string | Value type: string, integer, float, boolean, or array. |
lim.upper | any | Optional upper limit. Use null when not applicable. |
lim.lower | any | Optional lower limit. Use null when not applicable. |
rea | string | Optional result reason. |
res | string | Optional result, for example pass or fail. |
Send a log
Create the event payload with log-specific fields, then wrap it in the same TCP envelope with file: "logs".
{
"sid": "stn_abc123",
"slt": "",
"ser": "UNIT-123",
"utc": 1778702400000000,
"mod": "production",
"tag": ["manual"],
"nam": "operator.note",
"log": "Started inspection",
"lvl": "info"
}Log payload fields:
| Field | Type | Description |
|---|---|---|
nam | string | Optional log name or category. |
log | string | Log message. |
lvl | string | Log level: trace, debug, info, warn, error, fatal, or panic. |
Send a station state
Create the event payload with state-specific fields, then wrap it in the same TCP envelope with file: "states".
{
"sid": "stn_abc123",
"slt": "",
"ser": "",
"utc": 1778702400000000,
"mod": "production",
"tag": ["manual"],
"nam": "active",
"dsc": "Station is processing units"
}State payload fields:
| Field | Type | Description |
|---|---|---|
nam | string | State name, for example active, idle, or maintenance. |
dsc | string | Optional state description. |
Send a unit event
Create the event payload with unit-specific fields, then wrap it in the same TCP envelope with file: "units".
{
"sid": "stn_abc123",
"slt": "slot-1",
"ser": "UNIT-123",
"utc": 1778702400000000,
"mod": "production",
"tag": ["manual"],
"typ": "",
"dir": "input",
"res": "",
"met": null
}Unit payload fields:
| Field | Type | Description |
|---|---|---|
typ | string | Optional unit type. |
dir | string | Use input when a unit enters the station and output when it leaves. |
res | string | Optional unit result, usually used on output events. |
met | object or null | Optional unit metadata. |
Cloud HTTP fallback
For integrations that cannot run on the station PC, send the same envelope over HTTPS to the Autumn Labs cloud ingestion endpoint:
POST https://client.autumnlabs.io/api/v0/ingestCloud HTTP ingestion requires the ingest credentials configured for the station. Prefer the local TCP path when the integration is running on the station PC.