This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

ThingSpeak Write

Publish data to the Internet of Things using ThingSpeak

Description

You can publish data from your target hardware to the Internet of Things using ThingSpeak.

ThinkSpeak is a web service for Internet-of-Things applications. It provides real-time data collection, data processing, visualizations, apps, and plugins.

For more information on how to use ThingSpeak, see Apps, Plugins, or Tutorials.

Parameters

Main

Channel ID

Get the Channel ID parameter from your channel on ThingSpeak.com.

After creating a ThingSpeak channel for your target hardware:

  1. In the ThingSpeak.com website, select Channels > My Channels.

  2. Under the channel that you created for this target hardware, click Settings.

  3. Click the Channel Settings tab and copy the Channel ID.

  4. Open the ThingSpeak Write block in your model and paste the value into the Channel ID parameter.

Write API key

Get the Write API Key parameter from your channel in ThingSpeak.com.

After creating a ThingSpeak channel for your target hardware:

  1. In the ThingSpeak.com website, select Channels > My Channels.

  2. Under the channel that you created for this target hardware, click Settings.

  3. Click the API Keys tab.

  4. Copy the key from Write API Key parameter.

  5. Open the ThingSpeak Write block in your model and paste the API key into Write API key parameter.

Number of fields

Set the number of fields to send.

The default value is 1.

Update interval (seconds)

Set the number of seconds to wait between sending the data.

The default value is 60 seconds.

Optional

Send location information

When this parameter is set to:

Input port, specify the location using a signal that is connected to the location block input.

Block dialog, specify the location using the Location (latitude, longitude, altitude) parameter.

In both cases, specify the location as a cell array of three elements:

[latitude,longitude,altitude]

Use decimal degrees notation to specify latitude and longitude. Use meters to specify altitude. For example:

  • The lowest human-sized point underground, the TauTona Mine in Carletonville, South Africa: [-26.416111,27.4275,-3900]

  • The highest point measured from sea level, the summit of Mount Everest in Nepal: [27.988056,86.925278,8848]

Location (latitude, longitude, altitude)

Setting the Send location information parameter to Block dialog displays this parameter.

Specify the location as a cell array of three elements:

[latitude,longitude,altitude]

Introduced in R2016b