Production ESP32 + MQTT Firmware

    1

    Production-grade ESP32/ESP8266 firmware with MQTT resilience, deep sleep optimization, and hardware watchdogs.

    $24

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Production ESP32 + MQTT Firmware

    Example session with this skill installed

    Build a PlatformIO project for an ESP32 that reads a DHT22 sensor every 10 minutes and uses deep sleep. It needs to report to Home Assistant via MQTT and handle Wi-Fi drops.

    • Read your context and instructions
    • Compiled the production esp32

    I have generated a resilient PlatformIO firmware configuration for the ESP32. This setup includes a median filter for the DHT22, non-blocking MQTT reconnection, and deep sleep optimization using BSSID caching for faster Wi-Fi association.

    Resilient ESP32 MQTT Firmware

    #include <WiFi.h>
    #include <PubSubClient.h>
    #include "secrets.h"
    
    // Configuration
    const char* topic = "home/bedroom/sensor1/data";
    const int SLEEP_SECONDS = 600; 
    
    WiFiClient espClient;
    PubSubClient client(espClient);
    
    void connectToWifi() {
      if (WiFi.status() == WL_CONNECTED) return;
      WiFi.begin(WIFI_SSID, WIFI_PASS);
      // Implementation of non-blocking reconnect with backoff
    }
    
    void goToSleep() {
      Serial.println("Entering deep sleep...");
      esp_sleep_enable_timer_wakeup(SLEEP_SECONDS * 1000000);
      esp_deep_sleep_start();
    }
    
    void setup() {
      Serial.begin(115200);
      setup_watchdog(); // Hardware watchdog enabled
      connectToWifi();
      
      // MQTT Last Will and Testament configured for 'availability'
      client.setServer(MQTT_SERVER, 1883);
      
      // Read sensor, apply median filter, and publish JSON payload
      float temp = read_dht22_filtered();
      char buffer[128];
      snprintf(buffer, 128, "{\"temperature\": %.2f, \"unit\": \"C\"}", temp);
      client.publish(topic, buffer, true);
      
      goToSleep();
    }
    
    void loop() {
      // Loop remains empty due to deep sleep pattern
    }
    

    Next steps

    1. Create a secrets.h file containing your WIFI_SSID, WIFI_PASS, and MQTT_SERVER credentials.
    2. Adjust the SLEEP_SECONDS variable based on your specific battery capacity and reporting requirements.
    3. Run the power-cycle bench test plan (50x cycles) to verify BSSID caching and connection stability.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Reconnect, secure boot, power profiling and soak tests.

    Build reliable ESP32 / ESP8266 / Raspberry Pi Pico W sensor and actuator firmware that reports over MQTT (or directly to Home Assistant via MQTT discovery) - Wi-Fi reconnection, TLS, deep sleep for battery, watchdog, debounce, and a bench test plan. Use when the user creates an IoT device, writes Arduino/ESP-IDF/MicroPython/ESPHome code, or has devices that drop off Wi-Fi, drain batteries or report garbage values.

    Includes an EXPERT.md reference (exact parameters, thresholds, failure diagnosis).

    Acceptable use: civil and commercial applications only. Any military, paramilitary or weapon-related use is prohibited, as stated in the skill itself.

    Requires manual setup of secrets.h or secrets.yaml files. Does not provide PCB design or hardware safety certification. Scope limited to ESP32, ESP8266, and Raspberry Pi Pico W.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 28 days ago

    Permissions

    Read Files
    Listed28 days ago

    What's inside

    Frequently Asked Questions

    This skill provides the logic and architecture to build production-grade IoT firmware that avoids common failures like "hanging" on router reboots or excessive battery drain due to unoptimized Wi-Fi polling.

    The skill is compatible with ESPHome, Arduino/PlatformIO, ESP-IDF, and MicroPython, allowing you to choose the environment that best fits your existing hardware workflow.

    Yes, it includes specific logic for TLS-secured external brokers and implements 'Last Will and Testament' (LWT) messages so your system knows exactly when a device goes offline.

    You will receive a comprehensive implementation guide, pre-configured resilience logic for Wi-Fi and MQTT, power management profiles, and a testing plan for validating hardware stability.

    The skill focuses on firmware resilience and communication protocols; it does not include physical circuit designs, PCB layouts, or specific hardware wiring diagrams.

    New in APIs & Backend