mirror of
https://github.com/1technophile/OpenMQTTGateway.git
synced 2026-03-06 23:38:51 +01:00
109 lines
2.8 KiB
Markdown
109 lines
2.8 KiB
Markdown
# Integrate AWS IOT
|
|
## Create a thing
|
|
|
|
* From AWS console, search for IOT core
|
|
* Create a Thing and name it, this name will be used as the OpenMQTTGateway name.
|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|
## Create a policy
|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|
* Add this json code to the policy
|
|
```json
|
|
{
|
|
"Version": "2021-11-01",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"iot:Connect",
|
|
"iot:Publish",
|
|
"iot:Subscribe",
|
|
"iot:Receive",
|
|
"greengrass:Discover"
|
|
],
|
|
"Resource": [
|
|
"*"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## Create a certificate
|
|
|
|
* Create a new certificate
|
|
|
|

|
|

|
|
|
|
* Download certificates and key
|
|
|
|

|
|
|
|
## Attach Policy with certificate
|
|
|
|

|
|

|
|
|
|
## Activate certificate and attach it to Thing
|
|
|
|

|
|

|
|
|
|
## Find AWS EndPoint
|
|
|
|

|
|
|
|
## Gather the information for OpenMQTTGateway configuration
|
|
|
|
Now you should have the following information for the OpenMQTTGateway configuration:
|
|
* Root certificate
|
|
* Client certificate
|
|
* Client key
|
|
* End point url
|
|
* Gateway name
|
|
|
|
## Modify OpenMQTTGateway configuration
|
|
|
|
With Arduino IDE, you can update the following field into User_config.h with the information gathered:
|
|
* Gateway_Name
|
|
* `MQTT_SERVER "xxxxxx.iot-eu-amazonaws.com"`
|
|
* `MQTT_PORT "8883"`
|
|
* `AWS_IOT true`
|
|
* ss_server_cert with the root certificate
|
|
* ss_client_cert with the client certificate
|
|
* ss_client_key with the Client key
|
|
* `MQTT_SECURE_SELF_SIGNED 1`
|
|
* `MQTT_SECURE_DEFAULT true`
|
|
|
|
With PlatformIO you can directly leverage the environment `esp32dev-ble-aws`
|
|
|
|
## Build and upload
|
|
|
|
## Connect to a WiFi Access point [see portal](../upload/portal)
|
|
Enter your credentials and verify that Secure connection is marked.
|
|
|
|
## Verify that you receive data in AWS
|
|
|
|
* Go to things
|
|
* Click on the thing created
|
|
* Go to Activity
|
|
* Click on MQTT Test Client
|
|
* Subscribe to `+/#`
|
|
|
|
You should see messages coming.
|
|
|
|
 |