Comparative Performance Evaluation of MQTT, WebSocket, and Firebase on ESP32-C3 for Real-Time IoT Communication: - M. Ikrar Yamin; Ariman Ariman; Riadi Marta Dinata; Niko Purnomo (Institut Teknologi Nasional Malang, 2026)
This study presents a comparative evaluation of three IoT communication protocols, namely MQTT, WebSocket, and Firebase, implemented on the ESP32-C3 microcontroller. The objective is to examine protocol performance under identical testing conditions by varying payload size, transmission frequency, and database integration. A hardware-assisted setup was developed, including four input buttons to trigger predefined payload sizes (32, 64, 128, and 256 bytes), a 16x2 LCD display for device status, and a battery-powered ESP32-C3 for stable field operation. Latency, success rate, and bandwidth usage were measured across all scenarios, with results calculated as average values for each payload category. The findings show that WebSocket provides the lowest latency and highest reliability, while MQTT offers balanced and efficient performance suitable for constrained networks. Firebase demonstrates significantly higher latency due to its cloud-based architecture but benefits from seamless database integration. These results highlight the practical trade-offs among the three protocols and provide evidence-based guidance for selecting communication architectures in real-time IoT applications using ESP32-C3 devices. The study emphasizes the importance of unified testing conditions for achieving meaningful protocol comparisons in IoT system design.