Device to Cloud Command Line Interface Getting started

To get started with d2c you need to perform the following three steps:

  1. Install python package dtiot_d2c.
  2. Create initial DMO access profile.
  3. Create d2c’s oneM2M application entity (ae) d2ccli in DMO if it doesn’t exist already.

Pre-Requisites

To run the d2c you need to make a python 3.10 or 3.12 accessable on your machine and make sure that it can be executed with the command python3.

Installation

To install the python package dtiot_d2c with pip perform the following commands:

python3 -m pip install --upgrade dtiot_d2c 

The --upgrad option forces pip to update the package if it is already installed.

Pip not only installs the python packages into your local site-packages it also generates the executable d2c.
For Windows make sure that the directory %APPDATA%\Python\PythonXX\Scripts (or similar) is in your search path. If not you cannot execute d2c on the command line.

Verify Installation

To verify if d2c can be started from your command line run the command

d2c version
If everything is ok d2c prints the version info to the console:

d2c version
{
    "build_version": "0.8.9",
    "build_date": "2025-04-11T14:34:15"
}
NOTE

d2c provides a small GUI application to manager DMO access profiles. If you like to use it you need to install tkinter on your machine. After this it should be possible to start the graphical profile manager with the command

d2c profile-manager

Create DMO access profile

After installing the dtiot_d2c package and the d2c command you need to setup your first DMO access profile. On the console run the command

d2c create-configuration

The command will ask you for following inputs:

  • Profile Name: Name of the profile
  • API URL: URL of the DMO API including the tenant. Normally you can simple copy the URL from the IoT Hub GUI.
  • Get Token URL: Token issuer URL of the registered application which you can copy from the IoT Hub GUI.
  • Client Id: Id of your application credentials.
  • Client Secret: Secret of your application credentials.

The command creates the directories ~/.d2c and ~/.d2c/profiles, stores the defined DMO access profile as json file into the profiles directory and updates the configuration file ~/.d2c/config to let point the configuration to the just created profile as active profile.

Create DMO application entity

To use the d2c command line interface an oneM2M application entity with the name d2ccli is required within your DMO tenant for which you just configured your access profile. To let d2c create the ae run the command

d2c add-d2ccli-application

This command will create the application entity in case it doesn’t exist.

To check if oneM2M application entity d2ccli exists run the command

d2c get-application --name d2ccli

If everything is ok you should get an output such as

{
    "id": "67ffb5dc0aced48199fa6c42",
    "name": "d2ccli",
    "labels": {
        "type": "d2c"
    },
    "creationTime": "2025-04-16T13:51:24",
    "lastModificationTime": "2025-04-16T13:51:24",
    "urls": []
}