Skip to content
Back to Knowledge Base

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.

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.

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.

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 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.

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.

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?).

ProtocolDirectionReaches the other sideTypical use
HTTPoutbounddirectly, or via a Controllerweb services, machine APIs
SQLoutboundalways via a ControllerMIS/ERP databases
JMFoutboundthe machine’s JMF addressCIP4/JDF print equipment
MQTTinboundDevice publishes to the CoCoCo brokermetrics from machines