Set up Your Programming Environment
The first step in developing your Direct Connected Device is getting your programming environment up and running.
#Clone the Repository
There are two Git repositories for working with the Direct Connected Devices SDK. The first Git repository has the core Device SDK library. The second Git repository contains reference Device applications.
You can choose to download only the References repository from Git if the chipset you are using has already been ported to SmartThings. In this case, the IoT Core Device Library and chipset SDK can be downloaded as submodules in the reference repository through the
setup.py script defined below. If you are new to the SmartThings SDK for Direct Connected Devices, we recommend you to use the reference repository for easier understanding.
Clone the Git repository into your desired directory on your local machine. In this example, we will use the References repository:
For the rest of this document, we will assume the above path
~st-device-sdk-c-ref is the default example source code.
#Download the Core Device Library and chipset vendor SDK
When using the reference repository, you can use the
setup.py script found in the repo to automatically download the
IoT Core Device Library and your chipset vendor's SDK (e.g.
#Create a Device Identity
In order for your Device to connect to the SmartThings Cloud, authentication data files are required.
Run the following
stdk-keygen script in a terminal on your local machine to create a Device Identity.
Copy the serial number and public key. You will need to upload these values to the Developer Workspace - Projects page when you register your device later in the development process.
If you create a device identity with a command line option like the example above, you can get ready to use the device_info.json directly.
#Set Up the Appropriate Toolchain
You must set up a toolchain according to each chipset you selected.
- Set up the ESP8266 toolchain by following the official Espressif documentation.
- Set up the ESP8266 environment for the SmartThings SDK for Direct Connected Devices by running
- Set up the ESP822 development environment by following the official Espressif documentation.
- Set up the ESP32 environment for the SmartThings SDK for Direct Connected Devices by running
#Example: ESP32_v3.3 (legacy)
- Set up the ESP32 toolchain by following the official Espressif documentation.
- Set up the ESP32 v3.3 environment for the SmartThings SDK for Direct Connected Devices by running
- Install and configure the mbed microcontroller to use the USB serial port on Windows.
- Upgrade the DAP firmware. The recommended DAP firmware is
You must use a Windows PC for downloading a binary, while the source code for this chipset must be built using cygwin or linux.