Echobit connects a network instruction to an action on a device. This repository preserves the Arduino and NodeMCU side of the prototype developed during Talent Hackathon 2019: connect a microcontroller, receive a message and act on a digital output.
From a message to a physical action#
The firmware supports ESP8266 and ESP32. It connects over Wi-Fi, synchronizes time with NTP and configures a certificate-based TLS connection to AWS IoT. PubSubClient handles MQTT and ArduinoJson parses incoming messages.
The device subscribes to a Device Shadow update topic. When it receives a JSON object, it reads a pin number, drives that pin low for five seconds and then returns it high. That sequence is the concrete connection between the networked service and the physical output.
Keeping the connection alive#
The main loop services MQTT messages and checks connectivity. If the connection drops, it attempts to restore Wi-Fi and the broker session. The code also includes a sample data publishing function, although its periodic call is commented out in the prototype.
The firmware shows how a network message changes a pin’s state. It does not identify the actuator connected to that pin.