# IoT Device Provisioning Setup
**SPX** (**S**ervice**P**le**X**) IoT Device Provisioning involves the registration of a device onto the cloud platform, enabling seamless communication and interaction between the cloud and the registered device.
Creating a device profile enables us to obtain the necessary credentials. With these credentials, we can then proceed to provision the device.
## SPX side
### Provisioning setup
1. Sign in to the ThingsBoard Console, open the ThingsBoard Cloud
2. In the left navigation panel, choose Profiles, choose Device Profiles, and then click Add device profile.
3. Enter a name for the Device Profile and the remaining details as needed.
## Device side
### Generate Access Token
1. Subscribe to provision response topic
2. Publish message with Provision Device Key and Provision Device Secret to provision request topic
```c!
#define TEST_WIFI_SSID "your ssid"
#define TEST_WIFI_PASSWORD "your password"
#define THINGSBOARD_URI "mqtt://spx.5giotlead.com"
#define THINGSBOARD_PORT 1883
#define THINGSBOARD_ACCESS_TOKEN "your access token"
#define PROVISION_DEVICE_KEY "your provision device key"
#define PROVISION_DEVICE_SECRET "your provision key"
#define PROVISION_DEVICE_NAME "Device/Thing name to register"
#define THINGSBOARD_TELEMETRY_TOPIC "v1/devices/me/telemetry"
```
## References
* [ThingsBoard IoT Device Provisioning Setup](https://buildstorm.com/blog/thingsboard-iot-device-provisioning-setup/)