- MK.IO
- How To
- Edge devices
- On-board edge devices
- On-board edge devices using MK.IO API
On-board edge devices using MK.IO API
Prepare an edge device and register it to a project through the MK.IO Fleet API instead of the portal. The device must still be connected to the internet.
Prerequisites
Section titled “Prerequisites”- You can access the device’s local web UI or terminal.
- You have an API token with access to the target project.
Add the device to MK.IO
Section titled “Add the device to MK.IO”The on-boarding process has two parts:
- Prepare the device and obtain a short code or device ID.
- Use the code to register the device via the MK.IO API.
Once registered, the device is available for monitoring and control through MK.IO.
Remote on-boarding
The two steps above do not need to be completed by the same person. In a remote on-boarding scenario, the engineer installing the device can pass the short code verbally to an MK.IO user with permission to register it.
Prepare the device
Section titled “Prepare the device”Choose one preparation path:
- Local web UI: Follow Connect the device to MK.IO, then copy the short code or device ID.
- Device terminal: Follow Obtain the device ID.
The short code rotates periodically. Keep the device UI open until registration is complete, or use the longer-lived device ID.
Add the device using the MK.IO API
Section titled “Add the device using the MK.IO API”Register the device using the short code in the spec.shortCode field. Alternatively, use the longer-lived device ID shown in the device web UI or terminal in the spec.locationId field:
PUT https://app.mk.io/api/v1/projects/project_name/fleet/devices/device1
{ "metadata": { "displayName": "Device 1" }, "spec": { "siteName": "world", "locationId": "a7dafdba-4923-4317-aad1-dc76284b85b5" }}Verify on-boarding
Section titled “Verify on-boarding”Once the device is registered, go back to Appliance > Fleet in the device’s local web UI. The Registered field shows Yes and displays the device’s name.
You can now view device information and access the remote UI.
Update device software
Section titled “Update device software”Once the device is registered, before commissioning, update the device software to the latest version.