International Scholarly Publisher
Serving Researchers Since 2012

Smart City Backup Network System Using ESP32 for Automatic Network Failover

DOI : 10.5281/zenodo.21350353
Download Full-Text PDF Cite this Publication

Text Only Version

Smart City Backup Network System Using ESP32 for Automatic Network Failover

Ghadeer Saud Alshammari

Department of Computer Engineering, University of Hail Hail, Saudi Arabia

Rawan Lafi Aljahad

Department of Computer Engineering, University of Hail Hail, Saudi Arabia

Salma Badr Albdaran

Department of Computer Engineering, University of Hail Hail, Saudi Arabia

Fai Fahid Alenezi

Department of Computer Engineering, University of Hail Hail, Saudi Arabia

Sarah Abdullah

Department of Computer Engineering, University of Hail Hail, Saudi Arabia

Supervisor: Dr. Tahani Gasmalla

Department of Computer Engineering, University of Hail, Saudi Arabia

Abstract – Smart city environments rely heavily on continuous internet connectivity to support essential services such as surveillance systems, traffic management, and smart infrastructure applications. Any interruption in network connectivity may affect system performance and reduce the reliability of smart city operations. This paper presents the design and implementation of a Smart City Backup Network System using ESP32 microcontrollers and OLED displays to provide automatic failover between a primary and backup network connection.

The proposed system consists of two ESP32-based smart city units representing a surveillance camera system and a smart traffic signal system. Each ESP32 continuously monitors network availability and automatically switches to a backup connection whenever the primary network becomes unavailable. OLED displays are used to provide real-time monitoring and display network status information.

A miniature smart city prototype was developed to simulate a realistic environment containing roads, traffic intersections, buildings, surveillance units, and smart traffic infrastructure. Mobile hotspot connections were used as primary and backup networks to provide a low-cost and practical implementation approach. Experimental testing was performed under different network conditions to evaluate the reliability of the system.

The results demonstrated that the proposed system successfully detected network failures and automatically switched to the backup network without manual intervention. The implemented prototype also demonstrated the practical use of low-cost IoT technologies for improving service continuity and network reliability within smart city environments.

Keywords – Smart City, ESP32, IoT, Backup Network, Failover, OLED Display, WiFi Monitoring

  1. INTRODUCTION

    Smart cities have become an important part of modern technological development because they improve quality of life through intelligent systems and connected infrastructure. These environments depend heavily on continuous internet connectivity to support various services such as surveillance

    systems, traffic monitoring, transportation management, and smart public services. Reliable communication between smart devices is considered essential for ensuring efficient operation and maintaining service continuity.

    One of the major challenges in smart city environments is network interruption. Internet failures can affect critical services and reduce the reliability of smart city applications. Systems such as surveillance cameras and smart traffic signal systems require continuous communication to operate effectively. Any interruption in connectivity may result in monitoring failures, delayed responses, or reduced system performance.

    To address this issue, this paper proposes a Smart City Backup Network System based on ESP32 microcontrollers and automatic WiFi failover mechanisms. The proposed system continuously monitors the primary network connection and automatically switches to a backup connection whenever a failure is detected. The system includes two ESP32-based smart city units representing a surveillance camera system and a smart traffic signal system, each connected to an OLED display for real-time status monitoring.

    A miniature smart city prototype was developed to simulate a realistic environment and evaluate the performance of the proposed solution under different network conditions. The main objective of this work is to improve service continuity and network reliability using a practical and low-cost IoT- based solution.

  2. BACKGROUND

    1. Smart Cities

      Smart cities represent modern urban environments that use advanced technologies to improve quality of life and enhance the efficiency of public services. Smart city systems integrate communication networks, sensors, Internet of Things (IoT) devices, and intelligent monitoring systems to support various

      applications such as transportation, healthcare, security, energy management, and traffic control. Continuous connectivity is considered one of the essential requirements for maintaining reliable operation in smart city environments.

    2. IoT and ESP32

      The Internet of Things (IoT) enables physical devices to communicate, exchange information, and perform automated actions through internet connectivity. IoT technologies play an important role in smart city systems because they allow real-time monitoring and control of connected devices.

      The ESP32 microcontroller is widely used in IoT applications due to its built-in WiFi capability, low power consumption, small size, and affordable cost. In this project, ESP32 devices were used to monitor network availability continuously and manage automatic switching between primary and backup internet connections. OLED displays were integrated with the ESP32 devices to provide real-time status information.

    3. Network Failover Systems

    Network failover systems are designed to maintain service continuity when a primary communication network becomes unavailable. The failover mechanism automatically redirects communication to a backup connection whenever a failure occurs. Such systems are commonly used in critical environments where uninterrupted connectivity is necessary.

    In smart city applications, network failover techniques improve system reliability by reducing service interruptions and ensuring that important systems continue operating during internet failures. In this project, an automatic WiFi failover approach was implemented using ESP32 devices to maintain connectivity for smart surveillance and traffic signal systems.

  3. METHODOLOGY

    1. System Architecture

      The proposed Smart City Backup Network System was designed to maintain continuous internet connectivity for critical smart city services using an automatic failover mechanism. The system architecture consists of two ESP32 microcontrollers, two OLED displays, smart city service units, and wireless network connections.

      The first ESP32 device represents a smart surveillance camera system, while the second ESP32 represents a smart traffic signal system. Each ESP32 continuously monitors the availability of the primary network connection. During normal operation, both devices connect to the primary network. If the main network becomes unavailable, the ESP32 devices automatically switch to the backup network without requiring manual intervention.

      OLED displays were integrated with both ESP32 devices to provide real-time monitoring of network status and device operation. The displays show whether the devices are connected to the primary network, backup network, or disconnected from both networks.

      Mobile hotspot connections were used to simulate the primary and backup internet sources because they provided a simple, low-cost, and practical implementation method during testing.

      Fig. 1. Proposed smart city backup network system architecture.

    2. Hardware Components

      The hardware components used in this project were selected based on simplicity, availability, and suitability for IoT applications.

      • Two ESP32 Microcontrollers

        Two ESP32 boards were used in the implementation. The first ESP32 represented the smart surveillance camera unit, while the second ESP32 represented the smart traffic signal system. Both ESP32 devices continuously monitored internet connectivity and controlled the automatic switching process between the primary and backup networks.

      • Two OLED Displays (SSD1306)

        Two OLED displays were used to show real-time network status information. One display was connected to the surveillance camera system and the second display was connected to the traffic signal system.

      • Breadboard and Jumper Wires

        Breadboards and jumper wires were used to connect the ESP32 boards and OLED displays during hardware implementation and testing.

      • Mobile Hotspot Networks

        Two mobile hotspot connections were used to simulate the primary and backup internet sources. The ESP32 devices connected to the primary hotspot during normal operation and automatically switched to the secondary hotspot whenever the primary connection failed.

    3. System Implementation

      The system implementation phase focused on building a practical smart city prototype capable of demonstrating automatic network failover under different network conditions. A miniature smart city environment was

      developed to simulate real-world smart city infrastructure and verify the operation of the proposed backup network system.

      The implementation used two ESP32 microcontrollers and two OLED displays. The first ESP32 represented the smart surveillance camera unit, while the second ESP32 represented the smart traffic signal system. Each ESP32 device was programmed independently to monitor internet availability and continuously check the status of the connected network.

      During normal operation, both ESP32 devices attempted to connect automatically to the primary network source. Mobile hotspot connections were used to simulate the primary and backup networks because they provided a simple, low-cost, and practical implementation approach. If the primary connection became unavailable, the ESP32 devices automatically switched to the backup hotspot without requiring user interaction.

      Each OLED display showed real-time information including network status, connection mode, and system operation status. The displays provided visual feedback indicating whether the system was connected to the primary network, backup network, or disconnected from both connections.

      The smart city prototype included roads, traffic intersections, buildings, surveillance camera poles, traffic signal systems, and environmental structures to create a realistic demonstration environment. This implementation allowed the project to simulate how critical smart city services can continue operating during internet interruptions.

      Fig. 2. Implemented smart city prototype used during system operation and testing.

      Fig. 3. Smart surveillance camera unit displaying network status during operation.

      Fig. 4. Automatic backup network activation after primary connection failure.

    4. Testing Procedure

    Several experimental tests were conducted to evaluate the performance and reliability of the proposed smart backup network system under different network conditions. The testing process focused on verifying the automatic failover functionality and ensuring continuous operation of smart city services.

    Initially, both ESP32 devices were connected to the primary mobile hotspot network. The OLED displays showed successful connection status and confirmed that both the surveillance camera system and traffic signal system were operating normally.

    To evaluate the failover mechanism, the primary hotspot connection was intentionally disconnected. The ESP32 devices continuously monitored network availability and automatically detected the connection failure. After detecting the interruption, both devices switched automatically to the backup hotspot network and updated the OLED displays with the new connection status.

    Additional testing was performed by disconnecting both the primary and backup networks simultaneously. In this scenario, the OLED displays showed warning messages indicating the loss of internet connectivity. This test verified that the system could detect complete network failure and notify users appropriately.

    Multiple test scenarios were repeated several times to ensure stable operation and verify the consistency of the failover process under different conditions.

    Testing Results

    Test Case

    Actual Result

    Status

    Connect devices to primary network

    Connected successfully

    Passed

    Disconnect primary network

    Switched to backup network

    Passed

    Restore primary network

    Reconnected successfully

    Passed

    Disconnect both networks

    Offline warning displayed

    Passed

    OLED status updates

    Updated correctly

    Passed

    Surveillance camera unit

    Worked successfully

    Passed

    Traffic signal unit

    Worked successfully

    Passed

    TABLE I. TESTING RESULTS

    Fig. 5. OLED display showing successful switching to the backup network during testing.

  4. RESULTS AND DISCUSSION

    The proposed smart city backup network system was implemented and tested successfully using two ESP32 microcontrollers and OLED displays integrated within a miniature smart city prototype. Several experiments were conducted under different network conditions to evaluate the functionality and reliability of the automatic failover mechanism.

    During normal operation, both ESP32 devices successfully connected to the primary mobile hotspot network. The OLED displays showed real-time status information indicating that the surveillance camera system and traffic signal system were operating normally and connected to the primary network.

    When the primary network was intentionally disconnected, both ESP32 devices continuously monitored the connection status and detected the network interruption automatically. After a short period, the devices successfully switched to the backup hotspot connection without requiring manual intervention. The OLED displays updated immediately and confirmed activation of the backup network.

    The system was also tested by disconnecting both available networks. In this case, warning messages appeared on the OLED displays indicating that no internet connection was available. This behavior demonstrated that the system could identify complete communication failure and notify the user appropriately.

    The testing results confirmed that the proposed system- maintained service continuity and successfully demonstrated automatic network failover functionality. The implementation also showed that low-cost IoT devices such as ESP32 can be used effectively to improve connectivity reliability in smart city environments.

    Fig. 6. System operation after automatic switching to the backup network.

    Fig. 7. Final implemented smart city prototype during testing and evaluation.

  5. CONCLUSION

Bfore implementation, the proposed project existed as a conceptual idea aimed at solving one of the important challenges in smart city environments, which is maintaining continuous connectivity during internet failures. The initial concept focused on developing a low-cost backup communication mechanism capable of supporting critical smart city services such as surveillance systems and traffic management infrastructure.

After implementation, a practical smart city prototype was successfully developed using ESP32 microcontrollers, OLED displays, and automatic WiFi failover functionality. The implemented system demonstrated the ability to monitor network availability continuously and switch automatically from the primary network to a backup connection whenever a failure occurred.

Experimental testing confirmed that the proposed system successfully maintained connectivity for smart city services without requiring manual intervention. The developed prototype also demonstrated that low-cost IoT technologies can provide practical solutions for improving network reliability and service continuity within smart city environments. Future improvements may include cloud integration, larger-scale deployment, and support for additional smart city services.

ACKNOWLEDGMENT

The authors would like to express their sincere gratitude to Dr. Tahani Gasmalla for her valuable guidance, continuous support, and helpful feedback throughout the development of this project and research work.

REFERENCES

  1. H. Ning and H. Liu, Cyber-Physical-Social Thinking Space: The Internet of Things Thinking System, IEEE Internet of Things Journal, vol. 2, no. 1, pp. 210, Feb. 2015.

  2. A. Zanella, N. Bui, A. Castellani, L. Vangelista, and M. Zorzi, Internet of Things for Smart Cities, IEEE Internet of Things Journal, vol. 1, no. 1, pp. 2232, Feb. 2014.

  3. M. Ammar, G. Russello, and B. Crispo, Internet of Things: A Survey on the Security of IoT Frameworks, Journal of Information Security and Applications, vol. 38, pp. 827, Feb. 2018.

  4. Espressif Systems, ESP32 Series Datasheet, 2024. [Online].

    Available: https://www.espressif.com

  5. M. Patel and J. Wang, Applications, Challenges, and Prospective in Emerging Body Area Networking Technologies, IEEE Wireless Communications, vol. 17, no. 1, pp. 8088, Feb. 2010.

  6. S. Madakam, R. Ramaswamy, and S. Tripathi, Internet of Things: A Literature Review, Journal of Computer and Communications, vol. 3, no. 5, pp. 164173, May 2015.

  7. A. Al-Fuqaha, M. Guizani, M. Mohammadi, M. Aledhari, and M. Ayyash, Internet of Things: A Survey on Enabling Technologies, Protocols, and Applications, IEEE Communications Surveys & Tutorials, vol. 17, no. 4, pp. 23472376, 2015.

  8. SSD1306 OLED Display Documentation, OLED Display Module User Guide, 2024. [Online]. Available: https://learn.adafruit.com