Use MQTTs protocol to transfer data to AWS IoT#

Register your device on the AWS IoT page to obtain the client certificate and private key.#

  • Click on Things to enter the page.

../../media/awsiot-things.png
  • Click on Create Things to go to the creation page.

../../media/awsiot-things1.png
  • Click Next to go to Specify things properties

../../media/awsiot-things2.png
  • After entering the Thing name, click Next to proceed to Configure device certificate.

../../media/awsiot-things3.png
  • Click Next to go to Attach policies to certificate

../../media/awsiot-things4.png
  • Click Create policy to enter the Create policy page, enter a policy name, copy the content below into the JSON input box, and click Create to complete the creation.

Policy document#
 1{
 2  "Version": "2012-10-17",
 3  "Statement": [
 4    {
 5      "Effect": "Allow",
 6      "Action": [
 7        "iot:Publish",
 8        "iot:Receive",
 9        "iot:PublishRetain"
10      ],
11      "Resource": "*"
12    },
13    {
14      "Effect": "Allow",
15      "Action": "iot:Subscribe",
16      "Resource": "*"
17    },
18    {
19      "Effect": "Allow",
20      "Action": "iot:Connect",
21      "Resource": "*"
22    }
23  ]
24}
../../media/awsiot-things5.png
  • Return to the Attach policies to certificate page, check the box for the policy you created, and click Create Things to complete the creation process.

../../media/awsiot-things6.png
  • First download the certificate and private key, then click Done to complete the Create Things process.

../../media/awsiot-things7.png

Configure Scanner#

Set MQTT mode#

../../media/AT2BMQTTMODE3D4.png

Set MQTT Port to 8883#

../../media/AT2BMQTTPORT3D8883.png

Set Client Certificate#

   

Astuce

If the QR code is too large, we recommend taking a screenshot and sending it to your phone. Then, turn your phone screen brightness to maximum before scanning it with a barcode scanner.

Set Private Key#

   

Astuce

If the QR code is too large, we recommend taking a screenshot and sending it to your phone. Then, turn your phone screen brightness to maximum before scanning it with a barcode scanner.

Configure WiFi and Broker#

Astuce

After entering the corresponding WiFi information and service address, the scanner will actively connect to AWS IoT. Once the connection is successful, the green indicator light on the scanner will stay on.

   

MQTT test client#

  • Click on MQTT test client to enter the page.

  • After entering the topic you want to subscribe to and clicking Subscribe, use the barcode scanner to scan the barcode and receive the data from the scanner.

../../media/awsiot-test.png