# Developing a Fire Monitoring System Based on MQTT, ESP-NOW, and a REM in Industrial Environments
## 1 Introduction
However, his work focused primarily on general IoT applications and did not specifically address monitoring for fires. Additionally, [PERSON] did not integrate more advanced techniques, such as the REM, which could further enhance network reliability and reduce interference in industrial environments. Research on using REMs to optimize wireless sensor networks is still relatively limited. [PERSON] and [PERSON] [11] applied a REM to optimize wireless networks for industrial monitoring systems, focusing on improving network stability in environments with significant electromagnetic interference. Their work highlighted the potential of REMs for node placement and communication path optimization but did not explore their application in fire monitoring systems. Their research also suggested that integrating a REM with low-power protocols, like ESP-NOW, could offer significant advantages in terms of coverage and reliability. Although these studies provide valuable insights into the use of wireless technologies and protocols in industrial monitoring systems, there are still several gaps in the literature. First, while MQTT and ESP-NOW have been studied independently, few works have explored their combined use in a unified system for real-time fire detection. Secondly, although the REM has shown promise in optimizing network performance, its application in fire monitoring systems remains underexplored. This paper fills these gaps by developing a fire monitoring system that combines MQTT for message exchange, ESPNOW for multi-hop wireless communications, and a REM for node placement optimization. This system is specifically designed for industrial environments, addressing the issues of signal interference, energy consumption, and scalability. The main objectives of this paper are as follows. First, we design a wireless fire monitoring system using ESP-NOW for multi-hop communications, ensuring that data can be transmitted over long distances in large industrial environments. Secondly, the MQTT protocol is leveraged for efficient communications, thereby providing a reliable, low-latency message exchange between fire sensors and the central monitoring server. Lastly, the REM is utilized to optimize the placement of relay nodes, ensuring reliable and robust communication across the wireless network. The remainder of the paper is structured as follows. Section 2 describes the system architecture, including the key components of the wireless model, such as ESP32-CAM sensors, the multi-hop wireless network, MQTT communications, and radio environment maps. Section 3 details the methodologies utilized in the system, highlighting the roles of MQTT and ESP-NOW protocols in ensuring efficient and low-latency message transmission across the network, YOLOv5 for fire detection, and REMs. Section 4 focuses on the experimental details, including network setup, data collection for environment mapping, machine learning integration for REM construction, and the integration of a central monitoring server and multi-hop transmissions. Section 5 presents the results and performance evaluation of the system, discussing multi-hop network performance, data transmission, and network scalability. Section 6 concludes the paper, summarizing the findings and discussing future work aimed at enhancing the system's scalability and accuracy.