I've been trying to connect a PIC-IOT WA to my AWS IOT instance for a few days now, even digging into old provisioning code with no luck.
I've tried both of these tutorials:
- http://ww1.microchip.com/downloads/en/AppNotes/AN3089-Repurpose-AVR-IoT-WG-to-Connect-to-AWS-00003089A.pdf
- https://github.com/microchip-pic-avr-solutions/microchip-iot-developer-guides-for-aws/tree/master/connect-the-board-to-your-aws-account
The provisioning code does setup a Certificate Authority and also has steps for a rule and lambda functions to perform JITR. I have followed these steps closely and am unable to diagnose if the device is unable to connect (or not trying to connect) OR if the rules aren't being implemented.
As far as I can see through Cloudwatch is that the Lambda function never gets instantiated. The AWS IoT Rule is pretty straightforward:
SELECT * FROM '$aws/events/certificates/registered/#'
and if this happens trigger the lambda function. All the policies and user roles are set. From the code in the Lambda function, it checks for the certificate of the device and creates the "thing" based on the certificate and device ID.
From my perspective, it looks like the problem is either
- Certificate isn't loaded to the device properly through the provisioning script and so the device is trying to connect but is not successful
- The certificate is setup on the device properly but the rule isn't actually executing as expected.
I am reaching out to Microchip for #1, but was curious if there was anything I can do to check if the device is attempting to connect to the cloud. Or if there is a different rule I can setup to log connection attempts.
Note: the device is able to connect to the Microchip AWS instance through provisioning tool (option to connect to "sandbox")
Any help or advice here would be appreciated!!