-
Notifications
You must be signed in to change notification settings - Fork 2
Run AWS IOT core MQTT sample on EK‐RA8M1
Remove jumper J61 to enable Ethernet B
Jumper | Configurations |
---|---|
J61 | Open |

-
To run this sample, you need to create an account on Amazon Web Services: https://aws.amazon.com/
-
Once your account is created, sign in to AWS console as root user: https://aws.amazon.com/



- After signing in to AWS console, in the search bar, search for "IoT core" and open it

- Create a thing name "zephyr_sample", add certificate and policy for it.
- Go to "AWS IoT -> Manage -> Things -> Create things -> Create single thing"



- Create Cerificate for IoT thing, it's recommended to use the autogenerated one from AWS.

- Create and attach policy to certificate, when click "Create policy" a new tab will pop up at "AWS IoT -> Security -> Policies"

- Add below permission:
Policy effect | Policy actions | Policy resource |
---|---|---|
Allow | iot:Connect | * |
Allow | iot:Publish | * |
Allow | iot:Receive | * |
Allow | iot:GetRetainedMessage | * |
Allow | iot:ListRetainedMessage | * |
Allow | iot:RetainPublish | * |
Allow | iot:Subscribe | * |

- After finished creating the policy go back to the old tab, choose the policy and click "Create thing"

Important: After click "Create thing" you will be asked to download the Certificates and Keys, check and download Device Cerificate, Public key and Private key.

-
Copy the downloaded the certificates and keys file in step 4 to "zephyr/samples/net/cloud/aws_iot_mqtt/src/creds" and execute "zephyr/samples/net/cloud/aws_iot_mqtt/src/creds/convert_keys.py", it will help to generate the key in form of C code for the sample.
-
Modify "CONFIG_AWS_ENDPOINT" config in "zephyr/samples/net/cloud/aws_iot_mqtt/prj.conf" to your AWS account End point (it can be check in AWS IoT -> Settings)


-
Build and Flash application to board.
cd ~/zephyrproject/zephyr
west build -b ek_ra8m1 -p always samples/net/cloud/aws_iot_mqtt/
west flash
-
Verify result using "MQTT test client" on AWS IoT console.
- The sample is created to Publish a message to topic "zephyr_sample/data" and Subscribe to topic "zephyr_sample/downlink". On AWS IoT console "MQTT test client" we can Subcribe to topic "zephyr_sample/data" to verify message sent from board and publish a message to topic "zephyr_sample/downlink" to send a message to the board


Result:
- For each message MQTT test client send to top "zephyr_sample/downlink" board will response with a message to "zephyr_sample/data":

- Log show on board console:

RA Sample and Demo Hardware configuration
-
EK-RA8P1 Sample and Demo hardware configuration
-
EK-RA8M1 Sample and Demo hardware configuration
-
EK-RA8D1 Sample and Demo hardware configuration
-
MCK-RA8T1 Sample and Demo hardware configuration
-
EK-RA6M1 Sample and Demo hardware configuration
-
EK-RA6M2 Sample and Demo hardware configuration
-
EK-RA6M3 Sample and Demo hardware configuration
-
EK-RA6M4 Sample and Demo hardware configuration
-
EK-RA6M5 Sample and Demo hardware configuration
-
FPB-RA6E1 Sample and Demo hardware configuration
-
FPB-RA6E2 Sample and Demo hardware configuration
-
EK-RA6E2 Sample and Demo hardware configuration
-
FPB-RA4E1 Sample and Demo hardware configuration
-
Voice-RA4E1 Sample and Demo hardware configuration
-
EK-RA4E2 Sample and Demo hardware configuration
-
EK-RA4L1 Sample and Demo hardware configuration
-
EK-RA4M1 Sample and Demo hardware configuration
-
EK-RA4M2 Sample and Demo hardware configuration
-
EK-RA4M3 Sample and Demo hardware configuration
-
EK-RA4W1 Sample and Demo hardware configuration
-
EK-RA2A1 Sample and Demo hardware configuration
-
EK-RA2L1 Sample and Demo hardware configuration
-
AWS MQTT demo application
RX Sample and Demo Hardware configuration
RZ Sample and Demo Hardware configuration
-
RZ/V2H-EVK Sample and Demo hardware configuration
-
RZ/V2N-EVK Sample and Demo hardware configuration
-
RZ/V2L-SMARC Sample and Demo hardware configuration
-
RZ/N2L-RSK Sample and Demo hardware configuration
-
RZ/T2M-RSK Sample and Demo hardware configuration
-
RZ/T2L-RSK Sample and Demo hardware configuration
-
RZ/G3S-SMARC Sample and Demo hardware configuration
-
RZ/G2L-SMARC Sample and Demo hardware configuration
-
RZ/G2LC-SMARC Sample and Demo hardware configuration
-
RZ/G2UL-SMARC Sample and Demo hardware configuration
-
RZ/A3UL-SMARC Sample and Demo hardware configuration
-
RZ/A2M-EVK Sample and Demo hardware configuration