Skip to main content
Provisioning gives a device its Wi-Fi credentials and identity (device ID and user). The library persists these in Preferences, so it only happens once; on later boots the device connects automatically.

What begin() does

When you call device.begin(), the library:
  1. Tries to connect with saved Wi-Fi credentials
  2. Starts AP-mode if nothing is configured
  3. Sets up DNS + an HTTP provisioning page
  4. Initializes the realtime connection
  5. Loads deviceid, ssid, email, productid, and versionid from storage
  6. Registers default and user-provided command handlers
#include <hyperwisor-iot.h>
HyperwisorIOT device;

void setup() {
  Serial.begin(115200);
  device.begin();
}

void loop() {
  device.loop();
}

AP-mode provisioning (first boot)

If the device has no saved credentials, it starts its own Wi-Fi access point and serves a setup page:
AP SSIDNIKOLAINDUSTRY_Setup
AP password0123456789
Connect to that network, open the provisioning page, and enter Wi-Fi + device details. The device saves them and restarts, connecting automatically from then on.

Manual provisioning

To set credentials from code instead of the AP page:
// Wi-Fi + identity in one call (userId optional)
device.setCredentials("MySSID", "MyPassword", "my-device-id", "my-user-id");

// Or individually
device.setWiFiCredentials("MySSID", "MyPassword");
device.setDeviceId("my-device-id");
device.setUserId("my-user-id");
Helpers to inspect and reset stored credentials:
if (device.hasCredentials()) { /* already provisioned */ }
device.clearCredentials();     // wipe and re-provision

Reading identity at runtime

String id   = device.getDeviceId();
String user = device.getUserId();

Next: API reference

Every method you can call on the device.