Integrate ioID SDK in your device
In this step, we will use the popular ESP32 board as our connected device and create a simple firmware that enables the device to be registered on-chain by the device owner. This demonstrates the integration of ioID-SDK with minimal setup, making it a practical and efficient way to securely connect your connected devices to your Dapp on the IoTeX blockchain.Below is a flowchart illustrating the basic flow common to most use cases. The process ensures proper device registration at boot and, during normal operation, the device utilizes its DID key to sign messages securely.
Prerequisite
Before proceeding, ensure you have an ESP32 toolchain correctly configured on your system. This is essential for building the code and deploying it to your ESP32 board. A VS Code extension is also available.Get the ioID-SDK example
Clone ioID-SDK and enter the ESP32 examples folder:Build the demo
Testing the Firmware
In this demo, the firmware is designed to accept HTTPS connections from a client and respond to a request to sign an ioID registration message that the client will utilize to call the ioID registration contract (ref. ioID Registry Contract).In other scenarios, the device might communicate via Bluetooth or simply request the owner’s address to perform on-chain registration directly.
Register the device on IoTeX
The device is now ready to be registered. While any device project can provide their own client to perform the actual registration, here are some tools that work with the device communication protocol implemented in this demo:- The IoTeX Hub Portal: https://hub.iotex.io/my-devices
- An example command line tool community-developed using NodeJS: https://github.com/simonerom/ioid-registration-js

