Skip to content

Cloud Management

Ioto can be service local management applications via the integrated embedded web server or it support cloud-based management apps via the integration with the Ioto cloud service that provides a complete end-to-end cloud-based device management solution.

Enabling Cloud-based Management

Cloud based management is enabled via the ioto.json5 services.

{
    services: {
        database: true,
        demo: true,
        keys: false,
        logs: false,
        mqtt: true,
        provision: true,
        register: true,
        serialize: 'auto',
        shadow: false,
        sync: true,
        update: true,
        url: true,
        web: false,
    },
}

The mqtt service enables cloud communications. The provision service enables devices to be claimed by cloud-based device managers and to be provisioned with TLS certificates for communication with the cloud service. The sync service enables transparent synchronization of device data with the cloud.

The easiest way to configure cloud-based management is to select the Manager app when building Ioto. The app will supply a configured ioto.json5 file.

make APP=manager clean build

The Manager app builds and configures Ioto for cloud-based management using the Device Manager.

Running Ioto

After Building Ioto run Ioto via make run:

$ make run
app: info: Starting Ioto 1.4.0 in "cloud" mode using "dev" profile
setup: info: Enabling services: db provision register sync serialize test web
app: info: Device Claim ID: M72DANY8BZ
register: info: Device registered with https://api.admin.embedthis.com/api
{
    "product": "01H4R15D3478JD26YDYK408XE6",
    "id": "M72DANY8BZ",
    "created": "2024-01-23T02:03:57.062Z"
}
register: info: Device not yet claimed
app: info: Ioto 1.4.0 ready, Device firmware 1.3.0

When Ioto starts, it registers with the EmbedThis Ioto cloud service and waits to be claimed by a user for management.

Device Association

The process of associating a device with a user is called "Claiming" and consists of a user presenting a device claim ID that authorizes the user as the owner of the device. The unique claim ID is typically printed on the manufactured device. When evaluating Ioto, the Ioto agent will display the claim ID to the console.

An Ioto enabled device can be claimed by any user. Once claimed, the device is associated with the user, a device manager and the underlying device cloud.

During evalution, it is easiest to use the pre-existing Builder Eval Cloud and Eval Device Manager. The Builder's Eval Cloud is a multi-tenant, shared cloud for evaluating Ioto. The Eval Manager is a developer device manager suitable for examining and managing devices and device data.

To claim the device using the Eval manager, navigate to the builder and select the Managers page.

Manager List

Then click the Manage icon for the Eval manager. This will launch the Device Manager.

Manager Login

When you log into the Device Manager, you are logging in as a device user. This is a different account to your Builder login account. Device Manager logins are unique for each device cloud.

Manager Login

Enter your desired username and password and click Register. You will be sent an email confirmation code to complete your manager login.

Claiming a Device

After logging in, you will see the device list, which will be initially empty. Click the Claim Device button and enter your device claim ID to claim your device for management.

Manager Login

The Claim ID is the unique device ID displayed by Ioto when run. This ID is dynamically allocated when first run, but can be initialized via the config/device.json5 configuration file. During production, a generated device claim ID is typically printed on the device packaging and device label.

Read more in the Builder Claiming Devices documentation.

1
2
3
$ make run
...
app: info: Device Claim ID: M72DANY8BZ

While an Ioto-enabled device is waiting to be claimed, Ioto will periodically check with the cloud service to see if it has been claimed.

Once the device is claimed via the Manager, Ioto will display:

provision: info: Device claimed
provision: trace: {
    accountId: "XXXXXXXXXXXXXXXXXXXXXXXXXX",
    certificate: "state/ioto.crt",
    endpoint: "xxxxxxxxxxxxx-ats.iot.xxxxxxxxxxxxxx.amazonaws.com",
    id: "M72DANY8BZ",
    key: "state/ioto.key",
    port: 443
}
provision: info: Device provisioned
checkin: info: Device has no pending updates for version: 1.3.0
mqtt: info: Connected to mqtt: xxxxxxxxxxxxx-ats.iot.xxxxxxxxxxxx-1.amazonaws.com:443
demo: info: Running demo cloud counter
demo: info: Send counter update via MQTT -- counter 0

When claimed, the Ioto agent will be provisioned with a unique device certificate for secure TLS communications and will connect to the cloud using the MQTT protocol. These will be saved under the ./state directory as ioto.crt and ioto.key.

Demonstration Cloud Messaging

The default Ioto configuration will run a demo routine to update a counter and send the updated value to the cloud. This counter updates every thirty seconds and can be monitored via the Device Manager.

In the Device Manager, select the claimed device from the device list.

Manager Login

This will then display the database tables and dashboard for this device.

Key/Value Store

The default device schema has a key/value table called the "Store". The demo counter, will update a value with the key of "counter". Click on the Store table to display the store contents.

This will display all the data items in the store for claimed devices. From here, you can modify an item by clicking the Edit icon or you can edit in place by clicking on a teal color cell and updating the value and then clicking Save.

Store Table

You can reload the table contents by clicking the table reload icon.

Manager Dashboard

The Device Manager includes the ability to display one or more dashboards with data widgets.

Click the Dashboard tab to display the default dashboard, then click the Add Widget icon to display the add widget panel.

Store Widget

You can display database and metric data using numeric, gauge or graphical widgets.

To display the demo counter as a numberic from the database, enter the following widget configuration:

Field Value
Type Numeric
Namespace Database
Model Store
Field value
Select Item key=counter

This will select the Store table item that has a key value set to "counter" and display the "value" field.

After the ioto agent has run for a minute, there will be sufficient data points for a "COUNTER" metric to be created. Metrics permit the display of current and historical data using graphical widgets.

To display the demo counter as a graph using metrics, enter the following widget configuration:

Field Value
Type Graph
Namespace Embedthis/Device
Metric COUNTER
Statistic avg
Resource Dimensions Device=YOUR-CLAIM-ID

That should get you started with Ioto and posting data to the cloud from your device.

-end-