MQTT
MQTT is a lightweight, publish-subscribe, machine to machine network protocol. Machine data can be sent via MQTT to Senseye's broker. Senseye will consume messages and store the time series within Senseye's time series database.
MQTT Message¶
A message comprises of a topic and a payload. The topic is used to describe the client and data format of the payload, the payload contains the machine data.
Senseye has designed topics that are composed of the following terms, each term is delimited by /
.
- Version, currently
v1
- Organization ID. This will be provided by Senseye during onboarding and will typically be prefixed
group|...
- Data format, e.g.
csv
- Payload ID. An identifier for the source of the payload.
- For formats where Senseye sensor IDs or mappings IDs aren't specified in the format, for example CSV, the payload ID will be used as a mapping ID.
- For format where Senseye sensor IDs or mapping IDs are specified in the format, for example JSON, the payload ID is not used for data routing but should still be provided.
- (Optional) The measure name that the time series belongs to. This is only needed if the payload containing the time series data does not include the measure name.
An example of a topic
where the measure name is included in the payload and so is not needed in the topic is v1/group|abc/json/payload-id
.
An example of a topic
where the measure name is not included in the payload and is therefore needed explicitly in the topic is v1/group|abc/csv/payload-id/a-measure-name
.
Data should be sent in our one of our standard formats. For time series data, these are CSV, JSON, or Parquet. For vibration data, these are Waveform CSV/JSON or Spectrum CSV/JSON. See their respective pages for more information on the structure we expect.
We can also support custom data formats - please contact support for more information.
Connecting to Senseye's MQTT Broker¶
Senseye's MQTT broker is hosted at mqtt.senseye.io
on port 8883
. Connections to the broker are over TLS.
To use the broker, clients will need Senseye to generate a username
and password
. These can be obtained from support. These can be used by all devices publishing MQTT data.
Under the MQTT protocol, when messages are published to the broker, a ClientID
is required. This is a unique identifier between every sending device or computer that publishes MQTT data and the broker.
An example. Suppose a client has two physical devices, each has MQTT publish capability, and there is a desire for the data from the two devices to be aggregated together at Senseye under a single external-id. Each device will need to use their own unique ClientID
s to allow both devices to connect to the broker in parallel. But, both devices could use the same topic (i.e. provide the same external ID) so that Senseye treats the two physical devices as one logical device.
The MQTT protocol allows for a Quality of Service (QoS) measure to be provided. Currently Senseye's broker supports At most once
– the message is sent only once and the client and broker take no additional steps to acknowledge delivery (fire and forget).
For MQTT v3.1 and v3.1.1 clients there is no mechanism for the Senseye broker to provide a keep-alive
value. For these clients please ensure a keep-alive
parameter is provided and that it is non-zero, our recommendation is 60s (our broker's default). If an invalid keep-alive
is provided by the client a CONNACK message with the "identifier rejection" reason code will be sent, and the client disconnected.