Web panel with React and MQTT on AWS IoT Core
Publicado originalmente en iot.gripe , como parte 10 de la serie "Domótica con ESP32 y AWS desde cero". Un panel web que muestra cada luz con un interruptor, y que se actualiza al instante cuando la luz cambia, necesita una conexión en tiempo real. Con AWS IoT Core, el navegador puede conectarse directamente al broker por MQTT sobre WebSocket , sin ningún servidor en medio. En esta parte…
A web panel showing lights with switches that updates instantly when a light changes requires real-time connectivity. Using AWS IoT Core, a browser can connect directly to an MQTT broker over WebSocket without an intermediary server. This article connects a React app to AWS IoT Core, displays the Device Shadow state, and ensures the interface never shows a false state.
The stack used includes React, Vite, and TypeScript, with mqtt.js for MQTT over WebSocket and the AWS SDK v3 for obtaining Cognito credentials and signing the URL.
Summarised by urgent.news, not translated. Machine-written; may contain errors — check the original.
Source: dev.to