-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create examples for ESP-IDF #199
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
This commit adds a new README file to the examples folder of the ThingsBoard Client SDK GitHub repository. The README provides comprehensive guidance on the directory structure, feature support, and platform compatibility of the examples included in the repository. The README begins with an overview of the directory structure and usage, explaining how the examples are organized and guiding users on how to choose the relevant example based on their target platform and desired ThingsBoard feature. It then delves into the feature support over MQTT and HTTP(S), outlining which features are implemented over MQTT and which need to be implemented manually over HTTP(S). Links to the relevant sections of the ThingsBoard documentation are provided for further information on implementing these features. A folder prefix guide is included to help users understand the naming convention used for each example folder, indicating the platform the example is designed for. The README also features a detailed examples overview table, listing each example's folder name, description, and supported platform. This table serves as a quick reference for users to identify the example that best suits their needs. Each folder within the examples directory contains its own README file with additional information specific to that example, providing users with detailed guidance on how to use it effectively. Overall, this README enhances the usability of the repository by providing users with clear and comprehensive documentation on the available examples and how to leverage them for their ThingsBoard development projects.
This commit introduces a new example for provisioning devices using the ThingsBoard client SDK on the ESP-IDF platform. The example demonstrates how to securely connect to the ThingsBoard server, provision a device, and reconnect using the newly provisioned credentials. ### Key Features: - **WiFi Initialization**: Establishes a connection to the specified WiFi network. - **ThingsBoard Client SDK Integration**: Utilizes the ThingsBoard client SDK for device provisioning and MQTT communication. - **Secure Connection**: Supports both encrypted and unencrypted connections to the ThingsBoard server. Uses SSL/TLS for encrypted communication with the server. - **Provisioning Process**: Implements the provisioning process by sending a provisioning request and handling the response to obtain device credentials. - **Reconnect with New Credentials**: Disconnects from the provision account and reconnects to the ThingsBoard server using the newly generated credentials. ### Code Overview: - `InitWiFi()`: Initializes the WiFi connection. - `processProvisionResponse()`: Handles the response from the ThingsBoard server after provisioning. - `provision_device()`: Manages the device provisioning process, including connecting to the server with the provision account, sending the provisioning request, and reconnecting with the new credentials. - `app_main()`: Entry point for the application, initializes NVS, WiFi, and starts the provisioning task. ### Example Usage: - Configure the `WIFI_SSID`, `WIFI_PASSWORD`, `PROVISION_DEVICE_KEY`, and `PROVISION_DEVICE_SECRET` with your specific credentials. - Optionally set `DEVICE_NAME` or allow it to default to the device's MAC address. - Build and flash the example to your ESP32 device. This example provides a comprehensive guide for developers looking to integrate ThingsBoard device provisioning into their ESP-IDF projects, ensuring secure and efficient device management.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request aims to solve the missing ESP-IDF examples mentioned in #175 .
Completed examples: