AWS IoT Core
The integration details with AWS IoT Core service.
Last updated
Was this helpful?
The integration details with AWS IoT Core service.
Last updated
Was this helpful?
AWS IoT Core is a managed cloud service that allows connected devices to interact easily and securely with cloud applications and other devices. The integration with AWS IoT Core is facilitated through Device Shadow.
Uplink Support: Blynk supports uplinks through Device Shadow updates, allowing seamless data communication.
Downlink Support: Downlinks are managed by updating the shadow's desired state, ensuring synchronized device operation.
Device Importing: Efficiently import devices, simplifying asset management.
To connect the AWS IoT Core integration, you need to complete several fields and actions in AWS to enable Blynk to connect to your AWS IoT Core server and access your devices.
First, open your Blynk Console and go to Developer Zone → Integrations → AWS IoT Core Integration.
Fill in all the required fields:
Begin by selecting your AWS Region. You can locate this in the top-right corner of the AWS Management Console, near your account name.
Provide the AWS IoT Core Domain. To find it:
Navigate to AWS IoT Core in the AWS Console.
Go to Connect → Domain Configurations and copy the domain name.
If you have the AWS CLI tool installed and authorized to your account, execute the following command to retrieve the Credentials Provider Domain:
Alternatively, you can run this command in the AWS Console using the CloudShell tool.
Find your AWS Account ID by clicking on your account name (top-right corner) in the AWS Console and copying the Account ID displayed.
Copy the Policy JSON provided on Blynk's integration page.
In the AWS Console, go to AWS IoT Core → Security → Policies → Create New.
Assign a name to the policy (e.g., BlynkPolicy
).
Select the JSON Policy Editor, paste the copied JSON policy, and click Create.
In the AWS Console, navigate to AWS IoT Core → Security → Certificates.
Click Add certificate → Create certificate.
Change its status to Active and click Create.
Download the Device Certificate and Private Key files, then upload them to the corresponding section on the Blynk integration page.
Click Continue in the Blynk interface.
In the AWS Console, open the newly created certificate.
Click Attach policies, select the previously created policy (e.g., BlynkPolicy
), and click Attach policies.
On the Blynk integration page, copy the Role JSON.
In the AWS Console, navigate to the IAM service:
Go to Roles → Create Role.
Select Custom Trust Policy and paste the copied JSON.
Click Next, then Next again, and name the role BlynkRole.
Click Create Role to finalize.
Next, on the Blynk integration page, copy the Role Permission JSON.
In the AWS Console, open the created BlynkRole, and:
Click Add Permissions → Create Inline Policy.
Choose the JSON Policy Editor and paste the copied JSON.
Enter a name for the policy and click Create.
In the AWS Console, navigate to the IoT Core service.
Go to Security → Role Aliases → Create Role Alias.
Enter BlynkRole as the role alias name.
Select the previously created BlynkRole as the associated role.
Click Create to finalize.
Now, in Blynk Console on the integration page click Connect and you should see the successful connection message.
Once the integration is connected, you need to configure it:
Create a Blynk Template
If you haven’t already, create the Blynk Template that will be used for your devices.
Map the AWS Thing Type to the Blynk Template
Blynk uses the AWS Thing Type to map devices of the same template to a corresponding set of devices on AWS.
Scroll to the bottom of the AWS Integration page, select the Thing Type you want to use, and its corresponding Blynk Template.
Click Link to save the selection.
After mapping the Thing Type, you can import devices of this type from AWS into Blynk:
Click the Import button.
Select the specific devices you want to import. Alternatively, you can click Import All to import all devices of the specified Thing Type from AWS.
You can also manually create a device in Blynk by editing its "Thing Name" meta field. Ensure the value matches the exact Thing Name used in AWS IoT Core and include the device's region.
Once the integration is successfully connected and the Thing Type is mapped to the corresponding Blynk Template, the system is ready to receive uplink data.
Configure Datastreams Begin by setting up the datastreams within the Blynk Template. Ensure the names of the datastreams align with the JSON key names in the AWS IoT Device Shadow, and that their types match the JSON value types. Use Virtual Pins, Enum, and Location datastream types.
Below is an example of datastream configurations:
Sample AWS IoT Device Shadow:
To send a downlink to your device, first ensure that the necessary datastream is created. Then, add a control widget to the Web Dashboard or Mobile App.
When the widget is triggered, Blynk will update the device's unnamed shadow desired state with the value provided by the user.
With a configured Blynk template and a working device, you can now start creating a Web Dashboard and Mobile application.
Additionally, take advantage of other powerful Blynk features, such as Automations, WebHooks, Device Connection Lifecycle, and the Device HTTPS API, to build more advanced workflows.