Skip to content

Machines and files ​

Status ​

MethodEndpointDescription
GET/api/statusGet status of all machines
GET/api/healthServer health check: { status, uptime, version }. Needs no login

CNC machines ​

MethodEndpointDescription
GET/api/machinesList all machines
POST/api/machinesAdd a new machine (Admin). The reply is 201 with the new machine
GET/api/machine/:idGet a specific machine
PUT/api/machine/:idUpdate machine settings (Admin). Send only the fields to change
DELETE/api/machine/:idRemove a machine (Admin)

Add machine request ​

json
{
  "type": "brother",
  "name": "Speedio S300",
  "host": "192.168.1.50",
  "dataPort": 10000,
  "ftpPort": 21
}

Validation:

  • type, name, and host are required
  • type is brother, haas, mtconnect, fanuc, or siemens
  • host must be a valid IPv4 address
  • Each port must be 1 to 65535
  • Two machines cannot have the same IP address and the same data port (409)

The data port of each type, and its default:

TypeFieldDefault
BrotherdataPort10000
HaasdataPort (and queryPort for the query port)9998 (queryPort: 5051)
MTConnectmtConnectPort (and mtConnectDeviceId)5000
FANUCfocasPort8193
SiemensopcuaPort4840

FTP login ​

Set the FTP login with ftpUser and ftpPassword, when you add or update a machine. Use the same username and password that are set on the machine control.

  • The server never sends the password back. Machine replies and live events give only hasFtpPassword (true or false).
  • An update with no ftpPassword keeps the saved password. An empty ftpPassword ("") removes it.
  • An empty ftpUser means anonymous.

OPC UA login (Siemens) ​

A Siemens machine also takes opcuaUser, opcuaPassword, and opcuaSecurity (none or signAndEncrypt, default none).

  • An empty opcuaUser means an anonymous login.
  • The password works like the FTP password: the server never sends it back (replies give only hasOpcuaPassword), an update with no opcuaPassword keeps it, and "" removes it.
  • macros are R parameters: { "location": 5 } reads R5.

See Siemens machines.

Find machines (Admin) ​

MethodEndpointDescription
GET/api/discovery/rangesThe address ranges where the machines probably are, best guess first: { ranges: ["192.168.1"] }
POST/api/discovery/scanScan the 254 addresses of one local range: { "range": "192.168.1" }. The reply is { range, found: [{ machine, isConfirmed, detail }] }. 409 while another scan runs
POST/api/mtconnect/scan-portFind the port of the MTConnect agent on a computer: { "host": "192.168.1.60" }. The reply is { host, ports, recommendedPort }

The scan finds only machines that are not added yet. To add a found machine, send its machine to POST /api/machines. isConfirmed is false when Chatter saw only an open port, and could not ask the machine what it is.

Machine file management ​

MethodEndpointDescription
GET/api/machine/:id/filesList files. Query: path (default .) and depth (default 2)
GET/api/machine/:id/files/downloadDownload a file. Query: path
POST/api/machine/:id/files/uploadUpload a single file (Operator or Admin). Form fields: file, path, overwrite, targetName. 409 when the file exists and overwrite is not true
POST/api/machine/:id/files/upload-batchUpload multiple files (Operator or Admin). Form fields: files, basePath, overwrite, targetNames. The reply is { success, failed }
DELETE/api/machine/:id/filesDelete a file (Operator or Admin). Query: path

The upload form fields:

  • path: the full path of the file on the machine. basePath: the folder on the machine.
  • overwrite: true or false (default false).
  • targetName: the name of the file on the machine. targetNames: JSON text that gives the name on the machine for each file name.

Upload history ​

MethodEndpointDescription
GET/api/machine/:id/uploadsGet upload history for a machine. Query: limit (default 50)
GET/api/machine/:id/uploads/:fileId/eventsGet upload events for a file
GET/api/machine/:id/uploads/events/:eventIdGet specific upload event with content

Released under the MIT License.