The Octave Developer Hub

Welcome to the Octave developer hub. You'll find comprehensive guides and documentation to help you start working with Octave as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Controlling Device Properties

Overview

You can set values on an Octave edge device (e.g., the reporting period for a Resource, a Sensor threshold, etc.) by either:

  • permanently setting the Octave edge device's default configuration state; or
  • issuing Commands to temporarily change values that override the default configuration state, but revert back to the defaults when the device is rebooted.

The following methods can be used for changing values:

The following subsections use the example of setting the LCD value on the LCD screen included with the mangOH Red, to illustrate the two methods for setting a Resource value.

Permanently Changing a Resource via the Configured Value

Follow the steps below to permanently change a Resource value via the configured value (i.e., via the Resources Screen):

  1. Navigate to Device > Resources.
  2. Locate an example lcd/.
  3. Click the edit button to the right of the txt1 property, change the text value, and click Set and then Apply.
    The text on the LCD will change and this value will persist when the device is power cycled.

The change is actually a change to the device configuration.
You can determine if the configuration has been processed on the device and/or if there was an error, looking for PUSH_CONFIGURATION_START / PUSH_CONFIGURATION_COMPLETE in the stream :inbox of your device; they also appear in the Recent changes widget of the Device details screen:

Temporarily Changing a Value via the Command Button

Follow the steps below to temporarily change a value on the edge using the command button:

  1. Navigate to Device > Resources.
  2. Locate an example lcd/.
  3. Click the command button to the right of the txt1 property, enter a new text, and click Send. The text on the LCD will change but this value will not persist to the device reboot.

The command has been sent to the device sending an event with the new value into the stream :command of the device.
You can check the event you just sent:

  1. Navigate to Device > Streams, click on it to select it.
  2. Locate stream :command.
  3. Check the last event sent in the stream:

You can determine if the command has been processed on the device and/or if there was an error, looking for COMMAND_START / COMMAND_COMPLETE or COMMAND_FAULT in the stream :inbox of your device; they also appear in the Recent changes widget of the Device details screen:

Temporarily Changing a Value via an Event in the Command Stream


Follow the steps below to temporarily change a value by creating an event in the Command Stream:

  1. Navigate to Device > Streams.
  2. Locate the stream :command and select it
  3. Click on New event button.
  4. Populate the elems object with the event you want to send; the format is "resource path": Resource value. In the example below we change the txt1 of the LCD on the mangOH red:
{  
  "elems": {
    "lcd/txt1": "Pong !"
  },
  "hash": null,
  "location": null,
  "metadata": null
}
  1. You will see the event added to the :command stream of your device.

Like in previous example, you can determine if the command has been processed on the device and/or if there was some error by looking for COMMAND_START / COMMAND_COMPLETE or COMMAND_FAULT in the stream :inbox of your device; they also appear in the Recent changes widget of the Device details screen.

📘

Resource Path

Most of the time you will need to change the sub resource value of a Resource, in this case you add value to the resource path (e.g., /app/NAME/value).

The following example shows the event to send in order to update a virtual resource named lightThreshold :

{  
  "elems": {
    "virtual/lightThreshold/value": 1200
  }
}

It is possible to add a timeout or ttl: time to live parameter to the event you are sending to the :command stream of a device. When this parameter is set, Octave will attempt to deliver the command to the device until it succeeds, or the timeout is exceeded. Timeout and TTL are defined as optional attributes of the event metadata field, parameter is milliseconds.

In the example below the command will timeout after 1 minute:

{  
  "elems": {
    "lcd/txt1": "Pong !"
  },
  "metadata": { 
    "ttl": 60000
  }
}

Updated about a month ago

Controlling Device Properties


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.