Protocols Explained: MQTT, HTTP, JMF, SQL
Applies to CoCoCo platform v1.0.0-rc.31. The protocol choices below were checked in the device form of that version.
Outbound and inbound
Section titled “Outbound and inbound”A Device can have two kinds of protocols. You set them on the Device page under Outbound Protocols and Inbound Protocols (see How to Add a Device).
- Outbound — CoCoCo contacts the Device: HTTP, JMF, SQL or MQTT.
- Inbound — the Device sends to CoCoCo: MQTT or HTTP Webhook.
HTTP (outbound)
Section titled “HTTP (outbound)”CoCoCo sends HTTP requests to the address you enter as URL, optionally with Basic authentication. Scripts use this connection through ctx.device.http. CoCoCo can reach an HTTP Device directly; if the Device’s Network contains a Controller, the request can also go through that Controller.
SQL (outbound)
Section titled “SQL (outbound)”CoCoCo runs queries against a database: PostgreSQL, MySQL, MSSQL or SQLite. Scripts use this connection through ctx.device.sql.
SQL always runs through a Controller. CoCoCo sends the query to a Controller in the Device’s Network, which executes it against the database and returns the rows. The database therefore never has to be reachable from the internet — but a connected Controller in the Device’s Network is required. Without one, the query fails with No controller available on the device’s network.
JMF (outbound)
Section titled “JMF (outbound)”JMF is the messaging format of CIP4/JDF print equipment. CoCoCo sends JMF messages to the machine’s JMF address. This is how CoCoCo discovers the machines behind a JMF endpoint and connects them to Work Centers. Scripts use this connection through ctx.device.jmf.
MQTT (inbound)
Section titled “MQTT (inbound)”The Device publishes to the CoCoCo MQTT broker, for example metrics to the topic s/metrics. It authenticates with a client certificate from a Device Token. See Understanding Metrics and How to Create and Manage Device Tokens.
Other protocols
Section titled “Other protocols”MQTT (outbound) and HTTP Webhook (inbound) can be selected in the form; this article does not describe them further. To let another system push data to CoCoCo over HTTP, use an Incoming Webhook.
Machines that speak other protocols — OPC UA, Modbus, SNMP — are connected through an Edge App running on a Controller (see What are Edge Apps?).
Overview
Section titled “Overview”| Protocol | Direction | Reaches the other side | Typical use |
|---|---|---|---|
| HTTP | outbound | directly, or via a Controller | web services, machine APIs |
| SQL | outbound | always via a Controller | MIS/ERP databases |
| JMF | outbound | the machine’s JMF address | CIP4/JDF print equipment |
| MQTT | inbound | Device publishes to the CoCoCo broker | metrics from machines |