espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
431 stars 145 forks source link

Questions about factory reset (MEGH-4554) #260

Closed Vieufoux closed 11 months ago

Vieufoux commented 1 year ago

Answers checklist.

General issue report

Hi, I have some questions about factory reset:

shahpiyushv commented 1 year ago

Will the aws iot certificate which stored in nvs be cleared after factory reset?

No, since that is stored in the fctry partition, which is separate from nvs.

If the certificates are cleared, if the same node invoke the claiming API again, is the content of the aws iot certificate generated by rainmaker cloud each time the same or different?

Certificates will be cleared only if you explicitly erase the entire flash or the fctry partition using esptool or its variants (via Arduino as an example). Assuming that you cleared the certificates in this way, even then, for self claiming, the same node id will be assigned, but the certificate will be different.

The rmaker core will trigger a user mapping reset (if mqtt connection is active) so that the node gets removed from the user's account immediately. If the node is factory reset when mqtt connection is inactive, and is not connected to the Internet again, will the node always keep existing under the user's account?

Yes, because the cloud has no way to know that the node was removed. However, if another user provisions that same node, it will then get removed from the older user's account.

Can i still see the node on Rainmaker dashboard or ESP Insights after node factory reset? or will it be removed from dashboard after factory reset?

Since factory reset just erases the nvs partition and not the certificate information, the node will keep showing on RainMaker/Insights dashboard. Even if the flash itself is erased, the node will keep showing on dashboard. The node will disappear only if it is using self claiming and was added by some other user later.

Vieufoux commented 1 year ago

@shahpiyushv When I was reading the Rainmaker document, I saw this note image

So I have some other questions:

shahpiyushv commented 1 year ago

When the client invokes the API to update node param, cloud will send MQTT message to node. Does the cloud respond to the HTTP client immediately after sending the MQTT message, or wait until the execution result of the node is received before responding?

The cloud responds to the HTTP request immediately after sending the MQTT message. It reports an error only if the node is offline.

Will the cloud store Node Configuration and the value of parameters? When the client invokes the API to get the value of node param, whether the value of param is obtained directly from the cloud database or from node in real-time?

The cloud stores the config and params received from the nodes and returns values from this store when queried for. There is no real time query.

Note that we have added a command-response framework in cloud backend and firmware for somewhat synchronous querying but it is not yet being used from phone apps yet.

shahpiyushv commented 11 months ago

Closing this issue since all questions have been answered.