Skip to main content
Version: 0.0.x

Run a Sample IoT SDK Project

IoT SDK provides open-source sample project videosdk-rtc-iot-sdk-example on Github. This document introduces how to run this project.

Prerequisites

Before you get started, ensure you have the following:

Generate Token

To manage secured communication, every participant that connects to a meeting needs an access token. You can easily generate this token from the VideoSDK Dashboard.

For development purpose, you can generate a temporary token from VideoSDK Dashboard's API section.


Run the Sample Project

Step 1: Configure ESP-IDF enviorment

tip

For setting up ESP-IDF, follow only Step 1 from the Videosdk's Documentation.
Inside Step 1, you do not need to run the project creation commands

// Create a esp-idf project
cd ~/esp
idf.py create-project your-project-name
cd your-project-name

once the tools and environment are set up, jump directly to Step 2 in this Run Sample Project.

Step 2: Clone the sample project

Clone the repository to your local environment.

git clone https://github.com/videosdk-live/videosdk-rtc-iot-sdk-example.git

Step 3: Add IoT SDK component

To integrate the IoT SDK component, clone the repository below.

git clone https://github.com/videosdk-live/IoTSdk

After cloning, copy the component’s local path and provide it in the idf_component.yml file as shown below.

main/idf_component.yml
dependencies:
IoTSdk:
path: // Full local path of the component

Step 3: Generate Token

Generate a token from generate videosdk token and modify token variable in quick_start.c file

const char *token = "GENRERATED_TOKEN"; // Your VideoSDK Authentication token

Step 5: Configure Publisher and Subscriber IDs

  • You can pass your your Ids or use any random ID for your-publisherId and your-subscriberId.
  • For your-subscriberToId, pass the participant’s ID whose audio you want to subscribe to.
result_t result_publish = startPublishAudio("your-publisherId");

// Start subscribing to an audio stream
result_t result_susbcribe = startSubscribeAudio("your-subscriberId", "your-subscriberToId");

Step 5: Build & Flash Project

Configure, build, and flash the firmware onto your ESP32 board. This compiles the code, applies the configurations, and uploads it to your device.

1. <!-- Run this command to set your board as the target-->
idf.py set-target esp32-s3

2. <!-- Run this command to do menuconfig -->

idf.py menuconfig

a. Inside the component config:
|
|———> mbedtls
| ——>Enable Support DTLS <!-- It enables 3 way handshake -->
| ——>Enable Support TLS <!-- It enables 3 way handshake -->
And click S to save and again enter

b. Inside Example Connection Configuration:
|
|———> WIFI SSID <!-- replace it with your WiFi name -->
|———> WIFI Password <!-- replace it with your WiFi password -->
And click S to save and again enter

c. Inside the Partition table :
|
|———> Partition table (custom partition table CSV)
|———> Enable Custom partition table CSV

d. Adjust the flash size inside Serial flasher config
(because some boards have limited flash memory)
| ——> flash size: 2MB (esp32s3 XIAO sense)
| ——> flash size: 4MB (esp32s3 qorvo2 v3.1)
And click S to save and again enter

e. Inside the Set Microcontroller :
| ——>**Audio hardware board (example : ESP32-S3-Korvo-2)**
| ——> Select your board name
|———> ESP32-S3-XIAO
|———> ESP32- ESP32-S3-Korvo
And click S to save and again enter

3. <!-- Run this command to build the project -->
idf.py build

4. <!-- Run this command to flash the project to your microcontroller -->
idf.py flash monitor

Got a Question? Ask us on discord