Constructors

Properties

advertisementData?: { [key: string]: any }[]
capabilities?: string[]
connected?: boolean
ESPProvisionAdapter: ESPProvisionAdapterInterface = ESPRMBase.ESPProvisionAdapter
name: string
security: number
transport: string
username?: string
versionInfo?: { [key: string]: any }[]

Methods

  • Disconnect the device.

    Returns Promise<void>

  • Gets the capabilities of the device.

    Returns Promise<string[]>

    A promise that resolves to an array of capabilities.

  • Gets the version info of the device.

    Returns Promise<{ [key: string]: any }>

    A promise that resolves to an object containing version info.

  • Initialize session with the device.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the session was successfully initialized.

  • Initiates a user node mapping request.

    Parameters

    • requestBody: Record<string, any> = {}

      The request body for the user node mapping.

    Returns Promise<any>

    A promise that resolves to the response from the API.

  • Provisions the device with the given Wi-Fi credentials.

    Parameters

    • ssid: string

      The SSID of the Wi-Fi network.

    • passphrase: string

      The passphrase of the Wi-Fi network.

    • onProgress: (message: ESPProvResponse) => void

      A callback function to report progress.

    • OptionalgroupId: string

      (optional) - The unique identifier of the group to which the node should be added.

    • provisionType: string = ProvisionType.CHAL_RESP

      (optional) - Provision flow type: ProvisionType.CHAL_RESP (default) or ProvisionType.MQTT.

    Returns Promise<void>

  • Asks the device to clear its Wi-Fi state over the open provisioning session.

    Sent on the network-control endpoint, so it needs an established session and leaves the user-node association intact — only Wi-Fi credentials are cleared. That is what makes retryNetworkCredentials possible after a wrong password, instead of making the user factory reset the board.

    Returns Promise<boolean>

    true when the device acknowledged the reset.

  • Re-sends Wi-Fi credentials after resetWifiStatus and runs whatever the original flow still owes, reusing the association from the first attempt.

    Sending credentials alone is not enough: on the MQTT flow node mapping and time zone setup follow them, and skipping those leaves a device on Wi-Fi that never appears in the user's account.

    Parameters

    • ssid: string

      Wi-Fi SSID, unchanged from the first attempt.

    • passphrase: string

      The corrected Wi-Fi password.

    • onProgress: (message: ESPProvResponse) => void

      Progress callback; emits the same messages as provision.

    Returns Promise<void>

    When no association has completed on this device yet.

  • Sends data to the device.

    Parameters

    • endPoint: string

      The endpoint to send data to.

    • data: string

      The data to send.

    Returns Promise<string>

    A promise that resolves to the response data.

  • Sets the proof of possession for the device.

    Parameters

    • proofOfPossession: string

      The proof of possession string.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the proof of possession was successfully set.

  • Starts the assisted claiming process. This method handles the complete claiming flow:

    1. Send ClaimStart to device
    2. Get device info and send to cloud
    3. Send ClaimInit with cloud response to device
    4. Get CSR from device
    5. Send CSR to cloud for verification
    6. Send certificate to device

    Parameters

    • OptionalonProgress: ESPClaimProgressCallback

      Callback for progress updates

    • OptionalclaimCapability: CAMERA_CLAIM

      Optional claim capability string. Pass ClaimCapabilities.CAMERA_CLAIM for camera devices to add video streaming node_policies.

    Returns Promise<void>

    Promise that resolves when claiming is complete

    Error if claiming fails at any step

  • Verifies the mapping between a user and a node.

    Parameters

    • requestBody: Record<string, any> = {}

      The request body for the user node mapping verification.

    Returns Promise<ESPAPIResponse>

    A promise that resolves to the response from the API.