How to send simple data using MQTT

Recall our structure of sending data from an asset, via the MQTT broker, to Assetwolf:

MQTT diagram 1

Publish to send data

Assuming your device is connected using MQTT, it should publish its data to:

$sensorTopic = "up/client/clientId/asset/deviceId/fieldname";

The topic is structured in this way:

  • up means device-to-cloud
  • clientID is your client identifier (replace with your client ID)
  • deviceId the communication device identifier (replace with your device's unique ID)
  • fieldname is the code name of the field in the asset's schema (replace with your field name).

The payload should be just the value of the field at that time e.g.




...for example.