TofuPilotTofuPilot

Stations

Deploy test stations with controlled access and monitoring. Assign procedures, manage station uptime, and track test execution across your fleet.

Station header

Overview

A Station represents a physical test bench that executes procedures. Each station has its own API key and links to specific procedures for controlled access across production sites.

Create Stations

You can create stations from the Dashboard or with the API client.

from tofupilot.v2 import TofuPilot

client = TofuPilot()

# Create a station
station = client.stations.create(name="Test Bench #1")

# Create a station linked to a procedure
station = client.stations.create(name="Test Bench #2", procedure_id="FVT1")
using TofuPilot;
using TofuPilot.Models.Requests;

var client = new TofuPilot();

// Create a station
var station = await client.Stations.CreateAsync(new StationCreateRequest { Name = "Test Bench #1" });

// Create a station linked to a procedure
var station2 = await client.Stations.CreateAsync(new StationCreateRequest { Name = "Test Bench #2", ProcedureId = "FVT1" });

Create a station in the Stations tab. Enter a name and generate an API key.

Link procedures to the station using Link Procedure.

Use the generated station API key in your TofuPilot client by passing it as the api_key argument in your script or by storing it in your environment variables.

with TofuPilot(test, api_key="YOUR_STATION_API_KEY"):
  test.execute(lambda: "SN001")
from tofupilot.v2 import TofuPilot

client = TofuPilot(api_key="YOUR_STATION_API_KEY")
using TofuPilot;

var client = new TofuPilot(apiKey: "YOUR_STATION_API_KEY");

Link relevant procedures to the station.

In your script, ensure you use the procedure_id linked to your station when pushing test runs to TofuPilot.

test = htf.Test(procedure_id="FVT1")
client.runs.create(procedure_id="FVT1", ...)
await client.Runs.CreateAsync(new RunCreateRequest { ProcedureId = "FVT1", /* ... */ });

Required Parameters

All stations require these fields:

PropTypeDefault
procedure_id?
str
api_key?
str
# Before running the script, ensure you have created a station in the TofuPilot interface
# and linked it to the specified procedure ID ("FVT1" in this example).
# You also need to save your API key in an environment variable named "STATION_API_KEY"
# or pass it directly as an argument like this:
# TofuPilot(test, api_key="STATION_API_KEY")


import openhtf as htf
from tofupilot.openhtf import TofuPilot


def phase_one(test):
  return htf.PhaseResult.CONTINUE


def main():
  test = htf.Test(
      phase_one,
      procedure_id="FVT1",  # Create a station in TofuPilot linked to this procedure ID
      part_number="PCBA01",
  )

  # The API key can be set in environment variables or passed directly.
  with TofuPilot(test):
      test.execute(lambda: "SN-0001")


if __name__ == "__main__":
  main()
from datetime import datetime, timezone, timedelta
from tofupilot.v2 import TofuPilot

# Set station API key in TOFUPILOT_API_KEY env var, or pass directly:
client = TofuPilot(api_key="YOUR_STATION_API_KEY")

started_at = datetime.now(timezone.utc)
ended_at = started_at + timedelta(minutes=1, seconds=45)

run = client.runs.create(
  procedure_id="FVT1",  # Must be linked to this station
  serial_number="SN-0001",
  part_number="PCBA01",
  outcome="PASS",
  started_at=started_at,
  ended_at=ended_at,
  phases=[
      {
          "name": "phase_one",
          "outcome": "PASS",
          "started_at": started_at,
          "ended_at": ended_at,
      }
  ],
)
using TofuPilot;
using TofuPilot.Models.Requests;

// Set station API key in TOFUPILOT_API_KEY env var, or pass directly:
var client = new TofuPilot(apiKey: "YOUR_STATION_API_KEY");

var startedAt = DateTime.UtcNow;
var endedAt = startedAt.AddMinutes(1).AddSeconds(45);

var run = await client.Runs.CreateAsync(new RunCreateRequest
{
  ProcedureId = "FVT1",
  SerialNumber = "SN-0001",
  PartNumber = "PCBA01",
  Outcome = RunCreateOutcome.Pass,
  StartedAt = startedAt,
  EndedAt = endedAt,
  Phases = new List<RunCreatePhases>
  {
      new RunCreatePhases
      {
          Name = "phase_one",
          Outcome = RunCreatePhasesOutcome.Pass,
          StartedAt = startedAt,
          EndedAt = endedAt,
      }
  },
});

API Key

Each station gets a unique API key with limited permissions compared to user API keys. Regenerate or delete keys if compromised or when stations are decommissioned.

Station API key management

Stations can link to one or multiple procedures. Use Link Procedure to modify these connections.

Station procedure linking

You can deploy specific procedures scripts using Framework with precision using TofuPilot Station.

Browse & Filter Stations

You can browse and filter stations from the Dashboard or with the API client.

from tofupilot.v2 import TofuPilot

client = TofuPilot()

# List all stations
stations = client.stations.list()
for s in stations.data:
  print(f"{s.id}: {s.name}")

# Get a specific station
station = client.stations.get(id="your-station-id")
using TofuPilot;

var client = new TofuPilot();

// List all stations
var stations = await client.Stations.ListAsync();
foreach (var s in stations.Data)
  Console.WriteLine($"{s.Id}: {s.Name}");

// Get a specific station
var station = await client.Stations.GetAsync("your-station-id");

Update Stations

You can update station names from the Dashboard or with the API client.

from tofupilot.v2 import TofuPilot

client = TofuPilot()

client.stations.update(id="your-station-id", name="New Station Name")
using TofuPilot;
using TofuPilot.Models.Requests;

var client = new TofuPilot();

await client.Stations.UpdateAsync("your-station-id", new StationUpdateRequestBody { Name = "New Station Name" });

Delete Stations

You can remove stations from the Dashboard or with the API client.

from tofupilot.v2 import TofuPilot

client = TofuPilot()

client.stations.remove(id="your-station-id")
using TofuPilot;

var client = new TofuPilot();

await client.Stations.RemoveAsync("your-station-id");

Access Operator UI

Access each station's Operator UI from the Stations tab. Available for OpenHTF stations only.

Station list

Monitor Uptime

Track station connectivity and uptime. Real-time status and 90-day uptime history available for OpenHTF stations.

Station header

How is this guide?