Confirm the machine interface
Send the controller label, wiring photos, and the action the machine must perform.
Transport choice
Both can exist in one project. The choice depends on whether you need a response now or a stream of events.
| Use case | HTTPS API | MQTT |
|---|---|---|
| Backend sends a command | Request / response | Publish to command topic |
| Backend receives events | Webhook or polling | Subscribe to event topic |
| Best fit | Server-triggered actions | Real-time status and telemetry |
| Failure handling | HTTP status + retry | QoS + reconnect + idempotency |
The exact transport available on a machine depends on the controller, firmware, and network path.
项目适配
集成方式
HTTPS 用于命令和请求/响应,MQTT 用于实时事件。设备身份、主题前缀、认证和 QoS 按项目确认。
控制流程
Send the controller label, wiring photos, and the action the machine must perform.
Confirm command names, slot or channel mapping, timeout, and result fields.
Issue device identity, token, topic prefix, TLS mode, and QoS for the project.
Validate command, machine action, event identity, retry, and reconnect on a sample.
API 示例
命令字段取决于机器接口、固件配置,以及由支付还是你的应用触发。
POST /v1/devices/{device_id}/commands
Authorization: Bearer
Content-Type: application/json
{
"command": "vend",
"slot": "B04",
"reference_id": "ORDER-1001",
"timeout_ms": 15000
}
# MQTT topic map
devices/{device_id}/commands
devices/{device_id}/events
项目询盘
发送机器型号、控制器接口、目标动作和数据字段,我们确认 API/MQTT 方案和样品测试。
如果不确定机器接口,先发你手上的资料即可。照片往往比长文档更快判断方向。
常见问题
MQTT 3.1.1 over TLS 1.2 with QoS 1 is the baseline. Broker, topic prefix, and authentication are confirmed per firmware profile.
Yes. The controller can deliver commands and events to your own API, webhook, or broker. The exact flow is confirmed on a sample.
The contract uses reference_id and event_id. Retry and deduplication behavior is confirmed in the firmware profile and tested on one machine.
Event buffering and retry are part of the integration plan. Capacity, power-cycle retention, and backfill behavior must be tested before making a persistent-cache claim.
相关页面