Provisioning on Magistrala
The Bootstrap service in Magistrala (SuperMQ) provides remote provisioning for devices.
The main parts of the service are described below.
1. Core three-step process
Bootstrap is the first service a device contacts when it comes online.
- Registration (admin): Use a user token to create a server record that links an
external_id(such as a serial number) to aclient_id(the entity UUID in the system). - Request (device): On startup, the device sends
GET /bootstrap/{external_id}with its secretexternal_key. - Response (server): If the credentials match, the server returns the device's
client_id,client_key, list ofchannels, and custom JSON configuration content.
Note: You must create bootstrap records for multiple external IDs, although they may share one external key. This differs from ThingsBoard, where one profile can provision multiple devices with individual client IDs and client secrets.
2. Required information in a Bootstrap record
Provide the following fields when configuring Bootstrap:
| Field | Meaning |
|---|---|
| External ID | Physical device identifier (MAC address, IMEI, or serial number); the primary key. |
| External Key | Temporary secret used to authenticate with Bootstrap. |
| Client ID | ID of the Client (Thing) represented by the device. It may be left blank for automatic creation. |
| Client Key | MQTT/HTTP credential returned by the server. It may be left blank for automatic creation. |
| Channels | IDs of the channels the device may join. |
| Content | Optional custom data, such as {"sensor_type": "DHT22", "interval": 60}. |