This is the client for sending protocol buffers messages to the AWS IoT Core MQTT endpoint.
Will send a protocol buffers message to MQTT endpoint every 10 seconds. This example code comes with an .env file. You need to supply following values (see blog article chapter "Configure environment variables " for further reference)
IOT_ENDPOINT
- enter the device endpoint supplied by AWS IoT (see “Get your endpoint”). Looks something like this CA_CERT_PATH
- the absolute path of the downloaded AWS Root certificate e.g. AmazonRootCA1.pemDEVICE_CERT_PATH
- absolute path for the device certificate e.g. DEVICE_KEY_PATH
- the private key for the certificate e.g. TOPIC
- the topic you want to send the protobuf messages to and where the IoT Core rule should listen to (use the one we configured in the policy, see “Create policy”)go build cmd/iot-prototype/main.go
build main./main
execute main