Hi, this is Simon with IQRF.
We have designed the IQRF IoT Starter Kit in the way to be connectable to different clouds via
bidirectional MQTT channel. So you can collect,
store, process and visualize data on a cloud or you can send your commands to the IQRF network remotely.
In this particular video, we will configure the UP board to communicate with the Amazon web services through the MQTT channel.
So, let's start. Connect your UP board to your local network so it can obtain an IP address using DHCP.
In the following steps you will enter this address into your web browser and configure your gateway through the IQRF Daemon web application.
First, create an Amazon Web Services account. You have to fill in your personal or company data,
and add your credit card details. Your credit card will be used for payments in a case you exceed limits of the selected services.
In Services, in the Internet of Things section, find AWS IoT.
After selecting this item, click on GetStarted in the Onboard section. You will register your device,
download the connection kit, and configure and test the connection with your device.
Set up how you will be connected to the AWS IoT. Select the Linux operating system and Node.js
as the AWS IoT Device SDK.
Enter the name of your connected device and download the connection kit to get a certificate and keys for a secure MQTT connection.
Save and unzip this file. Store the certificate and the keys for further use.
Go to the documentation.
Here, look up the Download root CA string. Search in the entire site.
In the search results, find the article Using the AWS IoT Embedded C SDK.
Here you can find the root certificate.
Copy the string and save it as rootCA.pem to the directory with other certificates.
Next, click Done.
In the Settings, note the name of your endpoint because you will need it for the UP board configuration.
Copy the rootCA.pem, IQRF_Gateway.private.key, and IQRF_Gateway.cert.pem
files into the UP /etc/iqrf-daemon directory. We used WinSCP for transfer of the files.
In the new version of the IQRF Daemon web application, you can upload these files directly through the web interface.
Now, using the IQRF Daemon web application, set the MQTT channel on the UP board. In the Configuration menu,
select the MQTT interface.
We will not change the first MQTT interface because this one is used for a local application on the UP board.
Create or edit the second MQTT interface.
Enter the address of the endpoint that you copied before to the broker address field after the SSL protocol.
Write the port number 8883 at the end of this address.
Enter your ClientID and set up the other parameters.
Set IqrfDpaRequest as the topic for commands, and IqrfDpaResponse as the topic for responses.
Set the timeouts, the minimum and maximum connections
and correctly enter the path to the files that set up a secure connection between the gateway and the cloud.
Set the Trust store to rootCA.pem, Key store to IQRF_Gateway.cert.pem, and Private key to IQRF_Gateway.private.key.
Those are exactly the three files you've just copied into the UP board /etc/iqrf-daemon directory.
Save the configuration.
Then, IQRF Daemon must be restarted. After restarting, check the status of the UP board if the selected services are running.
Now let's test the connection between the cloud and the gateway.
In the web browser, click Test. Enter the IqrfDpaResponse to the Response topic to retrieve the gateway responses.
To send commands from the cloud to the gateway, set the IqrfDpaRequest as the topic for requests. Gateway will expect commands in this topic.
Insert a DPA packet in the JSON format into the text box
In our example, we send a command to turn on the red LED on the coordinator. You can find more commands on the GitHub.
We can see that the gateway picked up and executed the command, and sent a confirmation
with "No Error" into the IqrfDpaResponse topic.
We can visually double check the result of this command. The red LED turned on.
So, the bidirectional communication between IQRF network and the Amozon Web Services is up and running.
Now it's just up to you, to use it for your own IoT solution.
Không có nhận xét nào:
Đăng nhận xét