dnavarrom / aws_mqtt_arduino_uno

AWS IOT Bridge Client for Arduino Uno / Mega with Ethernet Shield
MIT License
10 stars 8 forks source link
amazon-web-services arduino-uno aws-iot ethernet-shield iot mqtt-client

aws_mqtt_arduino_uno

AWS IOT MQTT Bridge Client example for Arduino Uno / Mega with Ethernet Shield

Arduino Example connection to AWS IOT Mosquitto Broker

Tested on:

Instructions

1. Install libraries using this guide

Library 1: PubSubClient Library 2: ArduinoJson Library 3: SoftReset

2. Check if Docker AWS Bridge is up and running

mosquitto_pub -h localhost -p 1883 -q 1 -d -t localgateway_to_awsiot  -i clientid1 -m "{\"key\": \"helloFromLocalGateway\"}"

Setup intructions here

3. Setup arduino sketch

const char* mqttserver = "192.168.0.14";               // Local Broker
const int mqttport = 1883;                             // MQTT port
String subscriptionTopic = "awsiot_to_localgateway";   // Get messages from AWS
String publishTopic = "localgateway_to_awsiot";        // Send messages to AWS 

4. RUN

You should see mesages in your AWS IOT Console, Docker Logs and Arduino Serial Console