MQTT Auto Publish Data or MQTTPublishTable()

CR1000X/Xe/CR6 data loggers

These data loggers have a feature that enables automatic publishing to CampbellCloud. To enable this feature:

In Device Configuration Utility, on the Settings Editor > MQTT tab, set MQTT Auto-Publish Data to Enabled. Data tables intended for publishing must include a DataInterval() instruction. By default, the fastest auto-publish interval is 10 minutes. Data is published as follows:

  • If the DataInterval() is less than 1 minute, the table is excluded from publishing.

  • If the DataInterval() is between 1 and 10 minutes, data stored in the data table is published every 10 minutes.

  • If DataInterval() is greater than 10 minutes, data is published at the specified interval.

  • To publish data more frequently than the 10-minute auto-publish interval, use the MQTTPublishTable() instruction in the data table and set the desired publish rate. The OutputFormat parameter in the MQTTPublishTable() instruction must be set to 2, GeoJSON.

NOTE:

Auto Publish can be a convenient way to get started quickly. For the most consistent and transparent results—especially when programs are updated or expanded—we recommend explicitly defining your MQTT publish settings in the program (for example, by specifying the publish table/settings directly). This approach makes the publishing behavior easier to verify and troubleshoot, and it keeps the setup process consistent across platforms (including 300 Series and CR6/CR1000X/Xe).

NOTE:

Once MQTTPublishTable() is included in a data table in a CRBasic program, Auto-Publish is no longer applicable.

CR300/CR310/CR350 data loggers

The auto-publish feature is not available for these data loggers. To publish data, use the MQTTPublishTable() instruction in the data table and set the desired publish rate. The OutputFormat parameter in the MQTTPublishTable() instruction must be set to 2, GeoJSON.