First Equipment Connection
Connecting a tool over HSMS through the API.
Connection modes
- Active: FabConnect opens the TCP connection to the tool
- Passive: FabConnect listens and the tool connects to it
Sign in
bash
curl -s -X POST http://localhost:8080/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "<password>"}'Use tokens.accessToken from the response as the bearer token below.
Add the tool
bash
curl -X POST http://localhost:8080/api/v1/equipment \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "CVD-01",
"host": "192.168.1.100",
"port": 5000,
"mode": "active",
"session_id": 0
}'| Field | Meaning |
|---|---|
name | Your identifier, 1–64 characters (required) |
host, port | The tool’s address and HSMS port (required) |
mode | active or passive; defaults to passive |
session_id | The tool’s HSMS device ID, 0–32767; read it from the tool’s GEM configuration |
description | Optional, up to 500 characters |
The response is the equipment object, with its id. A second tool on the same host and port is refused with 409.
Connect
bash
curl -X POST http://localhost:8080/api/v1/equipment/$ID/connect \
-H "Authorization: Bearer $TOKEN"GET /api/v1/equipment/$ID/status then shows the live connection, communication and control state.
Troubleshooting
- Connection timeout: check the route and firewall to the tool, and that it is listening (active mode) or pointed at FabConnect (passive mode)
- T7 timeout: the TCP connection opened but the session was never selected; check the device ID and that no other host holds the tool
- Select rejected: the tool refused the session; "already active" or "connection exhausted" usually means another host holds it, "not ready" that the tool is not ready for a host or the device ID is wrong
- T3 timeout: the tool did not answer a message within 45 seconds