ThingSpeak

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Publish to a Channel Field Feed

Publish message to update single channel field

Topic

channels/<channelID>/publish/fields/field<fieldnumber>/<apikey>

Description

channels/<channelID>/publish/fields/field<fieldnumber>/<apikey> publishes messages to the Topic to update a channel field. Replace <channelID> with the channel ID, <fieldnumber> with field number that you want to update, and <apikey> with the write API key of the channel. To learn more about configuring your channel, see Channel Configurations. Use this method to update a single field in a channel.

  • Set the PUBLISH messages to a QoS value of 0.

  • Set the connection RETAIN flag to 0.

  • Set the connection CleanSession flag to 1.

To learn more about these flags, see MQTT v3.1.1 specification.

Payload Parameters

Data to be entered in the specified field of a channel, specified as a string. For example: 100

Examples

Configure MQTT.fx to send a PUBLISH message to update a channel field.

Replace <channelID> with the channel ID and <apikey> with the write API key of the channel. This PUBLISH message publishes a value of 45 to field1 of the specified channel.

Introduced in R2016b

Was this topic helpful?