Hello,
After looking at aws_iot sample files, I've stumbled upon the question regarding how one can dynamically change IDs and certificates for multiple 9160 devices? I've seen that it is possible to use %CMNG and store the credentials in the modem. However, it is stated from Nordic Semiconductor Infocenter that issuing the CMNG command will store credentials in NVM storage, is this a safe location for this? The best solution is probably to manufacture and upload the modem firmware/certificates at the same time for each device.. However:
1. What is the optimal and intended way to dynamically change the client ID used for connecting to MQTT? I saw that it is possible to store client_id in config before initializing aws library (using CONFIG_AWS_IOT_CLIENT_ID_APP
), but after a FOTA, how would a device know it's ID, where would it make most sense to store the ID? It seems pretty redundant to create multiple app_update.bin's just because each device needs its own prj.conf...
2. Would it be possible to extract the ID from the certificates since the certificates are generated on the cloud based on the client ID?
3. Lastly, AWS(or the cloud service being used) also require client_id in their topic names, and an example of this is AWS_IOT_LAST_WILL_TOPIC which can be seen in client_broker_init, aws_iot.c. Maybe it's easiest to disable CONFIG_AWS_IOT_LAST_WILL, and store custom, dynamic last will topic name and message to client config, based on the acquired client_id? I expect other topics to not be an issue though, considering it is possible to just dynamically change the topic names prior to the aws_iot_subscription_topics_add call.
Thanks in advance,
Eivind