Skip to main content

User-Node Mapping

about

In ESP RainMaker, Claiming is performed first when the node initially contacts the RainMaker cloud, followed by user-node mapping.

  • Claiming registers the device with the cloud and assigns it a unique node ID, but it does not link the device to any user.
  • Before the devices under a node can be monitored and controlled remotely, the node must first be mapped to a user to ensure that only the specific user has access permissions.
  • This user-node mapping process can only be performed using the ESP RainMaker phone app or CLI, as they drive the workflow for assigning the node to a user.

User-Node Mapping Workflow

host-driven


  1. During Wi-Fi provisioning, the client sends the user ID and a randomly generated secret key to the node using BLE. The node then sends its node ID back to the client.

  2. The client sends the node ID and the secret key to the RainMaker cloud over a secure and logged-in session. The RainMaker cloud responds with a request ID to the client.

    Why is the user ID not sent from the client to the RainMaker cloud?

    The user ID is not sent because it is extracted by the Cloud from the session information. Since the request happens in a logged-in session, the cloud already knows who is making the request, reducing extra data transfer and minimizing security risks.

  3. The node also sends the node ID, user ID, and secret key to the RainMaker cloud over secure MQTT.

    info

    Step 2 and Step 3 can occur in reverse order without affecting the workflow.

  4. The client queries the RainMaker cloud for the status of the request based on the given request ID. There are three types of responses based on the request status:

    StatusDescription
    ConfirmedIf the RainMaker cloud receives matching information from both the client and the node, the mapping is considered successful.
    Timed OutIf one minute has passed since the request was made, but no matching information was received from the other end, a timeout is triggered.
    RequestedMapping is still in progress. Keep checking.

tip
  • To learn more about the node-side communication in Step 3 of the workflow, refer to User-Node Mapping.
  • To learn more about the client-side communication, click here.

On this page