User-Node mapping
In ESP RainMaker, claiming is performed first upon the node's initial contact with 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
-
During Wi-Fi provisioning, the client sends the User ID and a randomly generated secret key to the node using BLE. The node will then send its Node ID back to the client.
-
The client will then send the node ID and a secret key to the RainMaker Cloud over a secure and logged-in session and the RainMaker Cloud will send back a request ID to the client.
Why is the User ID not sent from the client to the RainMaker Cloud?User ID is not sent as it is extracted by the Cloud from the session information as the request happens in a logged-in session, where the cloud already knows who is making the request, avoiding extra data transfer and reduce security risks.
-
The node will also sends the Node ID, User ID, and Secret Key to the RainMaker Cloud over secure MQTT.
infoStep 2 and Step 3 can occur in reversed order without affecting the workflow.
-
The client will then quey Rainmaker cloud for the status of the request based on the given request ID. There are three types of responses based on its request status:
Status Description Confirmed If the RainMaker Cloud gets the same information from both the client and the node, the mapping is considered successful. Timed Out If one minute has passed since the request was made, but no matching information was received from the other end, a time-out is triggered. Requested Mapping is still in progress. Keep checking.