Skip to main content

OakOS

Saving Configurations

Last updated: 15-Oct-2020

The Automatic Service

By nature, no state or configuration is stored when a machine starts up. Instead of having to call each service manually on boot, the automatic service will apply your configuration for you (hence the name!)

This is used to make settings "permanent", such as ensuring the rotation of a monitor and touch calibration after a reboot.

:info: Note

Network connection settings are persisted independently. See network.proto for more details.

When the Platform starts, the Apply is called using the Configuration message that was previously passed to the Store. It is also possible to manually use the Apply at any other time. The automatic configuration is NOT applied every time an application starts. It is only after the Platform is restarted, which is normally only after a reboot.

Instead of creating the Configuration message by hand, it is recommended that all of the configuration for each other service is prepared at once and then the Generate is used to create a Configuration message that would match the prepared state. Then that message can be passed to the Store. This is essentially a "Save Configuration" flow.

If there is an error in any of the configuration requests, then the Apply will stop executing at that point. When the cause of the issue is fixed, such as if a missing hardware component was reconnected, then the Apply endpoint can be called again to retry the automatic configuration.

Generate

Creates a Configuration message that, when sent to the Store, would lead to automatic configuration resulting in the same settings that are in place when Generate was called

GET Request

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/generate

Example Response

{
  "audio": [],
  "display": [
    {
      "display_id": "DP1",
      "configuration": {
        "enabled": false,
        "mode": "",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    },
    {
      "display_id": "DP2",
      "configuration": {
        "enabled": true,
        "mode": "1920x1080@60.00",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    },
    {
      "display_id": "VIRTUAL1",
      "configuration": {
        "enabled": false,
        "mode": "",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    }
  ],
  "touch": [
    {
      "touch_device_id": "Elo_Touch_Solutions_E801039_Edgley",
      "configuration": {
        "calibration": "",
        "orientation": "FORWARD_UPRIGHT"
      }
    }
  ],
  "displayGlobal": {
    "dpi": 96
  }
}

Think of this as a snapshot of the current settings

Store

Now you can POST the Generate response body to Store which will be applied on Reboot or you can use the Apply to save it now.

POST Request

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/store

POST Body

{
  "audio": [],
  "display": [
    {
      "display_id": "DP1",
      "configuration": {
        "enabled": false,
        "mode": "",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    },
    {
      "display_id": "DP2",
      "configuration": {
        "enabled": true,
        "mode": "1920x1080@60.00",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    },
    {
      "display_id": "VIRTUAL1",
      "configuration": {
        "enabled": false,
        "mode": "",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    }
  ],
  "touch": [
    {
      "touch_device_id": "Elo_Touch_Solutions_E801039_Edgley",
      "configuration": {
        "calibration": "",
        "orientation": "FORWARD_UPRIGHT"
      }
    }
  ],
  "displayGlobal": {
    "dpi": 96
  }
}

Apply

Apply uses the stored Configuration message to apply settings for each individual service

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/apply

View

Exposes the currently stored Configuration

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/view

Clear

Erases the currently stored Configuration so that no automatic configuration will be done on next Platform start-up.

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/clear

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo