So, I have made some tests, and I have configured the CUSTOM GATT on ESP32, this enables to send data between IOS mobile demo and the microcontroller, today I don’t still generate the temporary token into the IOS mobile demo yet, because I’m implementing before all the process on the microcontroller to communicate with IOT Core and generate the new certificate and register, but if I send data into IOS demo with CUSTOM GATT I can send the certificate in another moment, we can try to generate this on the server with another SDK with another language, or using IOS SDK, but today I’ve been generating this on the terminal with the CLI application,
you have to create a template on IOT Core > Onboard > Fleet provisioning templates > create, then execute this on the terminal, of course, you need to configure awscli before,
I created the simple shell, you need the jq , awscli installed
#! /bin/bash aws iot create-provisioning-claim --template-name YOURNAME > create-provisioning-claim.json && cat create-provisioning-claim.json | jq -r '.keyPair.PrivateKey' > $(pwd)/1-provisioningClaimPrivateKey.pem && cat create-provisioning-claim.json | jq -r '.certificatePem' > $(pwd)/1-provisioningClaimCertificatePem.pem
so, these certificates are temporary for 5 minutes, you put this into the “aws_clientcredential_keys.h” compile and send to the microcontroller, with this certificate you can communicate with the IOTCore for register the new certificate and “thing” , for this communication I used the demo “MQTT” to send to this topic “$aws/certificates/create/json” and subscribe on this for receiving the response “$aws/certificates/create/json/accepted”, so this returns the new certificate, now you have to register the “thing” ,
After saving the permanent certificate on the device, the device must disconnect from the session that is initiated with the temporary provisioning claim certificate and reconnect using the permanent certificate.
I made few tests with a certificate and implementing vModeKeyProvisioning , when you receive the new certificate you pass to this function for sending to the flash memory, now you are ready for using this on new topics “MQTT” ,
I’ve been testing this, and it’s work, I’ve implementing until the part of the generate the new certificate, and it’s work, now I have to test the thing register, but I think it’s ok, of course, I have to finish the generation of the temporary certification on mobile to send the microcontroller
every this is coverage on the documentation here
I dont have any special custom implementation, I has used the demos the has with the freertos