An efficient networking solution for extending and controlling wireless sensor networks using low-energy technologies

Wireless sensor networks connect a set of highly flexible wireless devices with small weight and size. They are used to monitor and control the environment by organizing the acquired data at a central device. Constructing fully connected networks using low power consumption sensors, devices, and protocols is one of the main challenges facing wireless sensor networks, especially in places where it is difficult to establish wireless networks in a normal way, such as military areas, archaeological sites, agricultural districts, construction sites, and so on. This paper proposes an approach for constructing and extending Bi-Directional mesh networks using low power consumption technologies inside various indoors and outdoors architectures called “an adaptable Spider-Mesh topology”. The use of ESP-NOW protocol as a communication technology added an advantage of longer communication distance versus a slight increase of consumed power. It provides 15 times longer distance compared to BLE protocol while consuming only twice as much power. Therefore, according to our theoretical and experimental comparisons, the proposed approach could provide higher network coverage while maintaining an acceptable level of power consumption.


INTRODUCTION
Monitoring, measuring and controlling systems are rapidly evolving in today's world. Embedded systems, the Internet of Things (IoT), remote environmental monitoring, and smart home automation are just a few of the applications that have motivated by the creation of Wireless Sensor Networks (WSNs) (Labib et al., 2019). Wireless sensor networks typically connect smart sensors to other IoT modules for collecting, monitoring, and remotely controlling real-time physical parameters such as air temperature, humidity, air pressure, soil moisture, and other environmental variables. The collected data is sent to a central base station for automatic decision-making or notification of decision-makers (Babiuch, Foltýnek & Smutný, 2019). communication technologies are essential not only because they potentially replace wired networks , but they also enable peoples to use, control and monitor their devices everywhere in the world by connecting them to the Internet (Reinisch et al., 2007). Bluetooth, Z-wave, ZigBee, and Thread are some of the most widely used low-power wireless communication technologies for connecting devices and transferring/controlling data. The most common specs for these technologies are listed in Table 1 (Morales, Parado & Pasaoa, 2021). These technologies supports Star, Tree and Mesh topologies. The Mesh topology is the best option for constructing, extending and controlling the Wireless Sensor Networks (WSNs).
Researchers have studied and evaluated the effects of star and mesh Wireless Sensor Network (WSNs) topologies on response time, throughput, traffic drop and delay using Zigbee communication protocols. The results demonstrated that the network functions better with mesh topology than star topology (Abdulhussien & Ibrahim, 2020).
Other research measured and analyzed the average value of delay, throughput and packet loss parameters of star mesh and tress topologies using Zigbee communication protocols. The result show that the start topology is stable on measuring throughput and packet loss besides; it had the smallest delay value. However the mesh and tree topologies had the advantage of being able to send data over longer distances and adding more nodes than the star topology (Soijoyo & Ashari, 2017).
Wireless sensor networks (WSNs) with high power consumption technologies can extend network lifetime and enable efficient, reliable, and dependable wireless communications (Yick, Mukherjee & Ghosal, 2008). The power consumption technologies is divided into three parts; Sensing, Communication and Data processing. Bluetooth Low Energy and ESP-NOW protocols are two ultra-low-power consumption communication protocols that can be used in a wide variety of WSNs and IoT based systems.
According to the Bluetooth Low Energy Core Specification, Bluetooth Low Energy is used to establish three kinds of network structure: Star, Mesh and Tree structure network (Li, Zhang & Marie, 2019). Star topology is the simplest topology. BLE mesh is the most flexible and reliable network structure which has the ability to extend the network coverage area. It is a complicated and is not considered a power consumption and latency efficient protocol (Ghori, Wan & Sodhy, 2020). A Tree structure network consists of three different types of nodes: the root node, the intermediate node and the leaf node. it can connect more nodes than the star network. Moreover, its routing rules are significantly simpler than mesh routing rules (Li, Zhang & Marie, 2019).
The goal of this article is constructing an efficient network with mesh topology that can be used to extend and control Wireless Sensor Networks using low-energy communication protocols, as well as studying and analyzing the permissible distance between network nodes and the consumed power of each node. Selecting an energy-efficient routing mechanism for our suggested approach is an challenging task that necessitates a lot of experiments and comparisons. As a result, the extended work of this paper will focus heavily on choosing the most appropriate routing protocol for the network topology and the communication protocol that will be presented in this paper.

WIRELESS SENSOR NETWORKS COMMUNICATION PROTOCOLS
Communication protocols are essential for connecting devices and sharing data in wireless sensor networks and Internet of Things devices. Specific communication protocols are required for building networks for monitoring and controlling construction sites, the marine environment, and archaeological sites. These protocols should be low-power and capable of sharing data across all network nodes. The following communication protocols will be used to test the proposed approach in this study.

Bluetooth low energy
Classic Bluetooth, Bluetooth Low Energy, Wi-Fi, and ESP-NOW Protocols are all supported by the ESP32 boards. Compared to Classic Bluetooth, Bluetooth Low Energy is designed to use significantly less power while maintaining a similar communication range.
To connect devices using the BLE protocol, devices can act as a Central/Master (smart phones or PCs) or Peripheral/Slave (small devices such as smart watches or ESP32 boards). Peripheral devices advertise their existence and wait for the central device to connect to them, whereas the central device scans nearby devices and connects them. Devices can be either a Client or a Server after establishing a BLE connection, as depicted in Fig. 1. A server device has local resources such as ''profiles, services, and characteristics'' that clients can read (Santos & Santos, 2020).
Recently, mesh networks can be configured utilizing the BLE protocol, although there are several limitations. According to our experiments, the maximum distance between the server and clients is six meters, and the maximum number of clients connected to the server at the same time is three devices.
Researchers have been able to overcome these challenges in a variety of ways, including switching some client devices into break mode to allow other devices to connect in their place, or using a time division system to switch Server/Client mode for some devices on the network, but these techniques are extremely complex (Patti, Leonardi & Bello, 2016). The existing limitations of using the BLE protocol for establishing and expanding the Wireless Sensors Network pushed us to look for other low power consumption protocols that could address these difficulties.

ESP-NOW
ESP-NOW is a fast wireless communication proprietary protocol developed by ''Espressif organization'' that may be used to transfer small messages (up to 250 bytes) between ESP32 boards (https://www.espressif.com/en/products/software/esp-now/overview). As demonstrated in Fig. 2, data is encapsulated in a vendor-specific action frame and then sent from one device to another. The pairing between devices is required prior to their communication. After pairing, the connection becomes secure and peer-to-peer, with no need for handshake process (Pasic, Kuzmanov & Atanasovski, 2020).
The ESP-NOW protocol is similar to the low-power 2.4 GHz wireless connectivity. This protocol allows multiple low-power devices to communicated to each other and exchange data between ESP32 boards without the use of Wi-Fi or Bluetooth technologies (Random Nerd Tutorials, 2020a). Table 2 summarizes the essential differences between the Bluetooth Low Energy and ESP-NOW protocols. As demonstrated in Fig. 3, the ESP-NOW protocol allows to configure

Integrating ESP-NOW with Wi-Fi simultaneously
The ESP32 board can be used as a web server in Wi-Fi station mode, Access Point mode, or both. These capabilities enable us to develop a wide range of IoT applications and deploy diverse network architectures (Vasiljević-Toskić et al., 2019). As shown in Fig. 6, in some applications, we need to host an ESP32 board as a web server while also integrating it with the ESP-NOW communication protocol (Random Nerd Tutorials, 2020b).
Integrating WSNs with the Internet Protocol (IP) to develop Internet of Things (IoT) applications is one of the most important goals for WSNs. IoT systems enables things (a person with a heart monitor implant or a car with built-in sensors to inform the driver when tire pressure is low) to monitor the real-time live objects anytime and everywhere.
Integrating ESP-NOW with Wi-Fi in places where Wi-Fi technology is available allows us to build these applications (Pirbhulal et al., 2017).

AN ADAPTIVE SPIDER-MESH TOPOLOGY
The proposed approach acquires its novelty from constructing an adaptive spider mesh topology using the ESP-NOW protocol, which is incorporated into ESP32 devices. Instead

Figure 4 ESP32 one-way communication styles (adapted from Random Nerd Tutorials (2020a)).
Full-size DOI: 10.7717/peerjcs.780/ fig-4 of using the traditional tree and mesh topologies, the adaptive spider mesh topology is proposed for extending the network coverage. The ESP-NOW protocol can be used as a bi-directional communication protocol that can overcome the BLE protocol's connectivity constraints.
As illustrated in Fig. 7, the adaptive Spider-Mesh topology can have four levels, ranging from 0 to 3. Nodes are labeled with numbers like 1, 2, 3, etc. Nodes is this topology are organized into several levels, ranging from 0 to n. So, by increasing the number of levels,
The number of nodes can be easily determined using Eq. (1), as shown in Table 3, where N is the total number of nodes that may be connected using the proposed approach, n is the number of levels, and x is the number of nodes in the first level. In the last level, each node is connected to just three other nodes, but in the other levels, each node is connected to five other nodes.
The use of ESP-NOW protocol as a communication technology added many benefits, including the ability to exchange data between ESP32 devices without switching network nodes mode, and the ability to connect one board to seven other boards at once (supporting up to 20 nodes based on recent researches' experiments (Glória & Sebastião, 2021)). Using the capabilities of the ESP-NOW protocol, an adaptive Spider-Mesh topology has been proposed for constructing Bi-Directional mesh networks.
The proposed approach studies the possibility of expanding network coverage in locations where traditional Wi-Fi networks or permanent energy sources are difficult to establish, as well as the maximum permissible distance between network nodes using the ESP-NOW protocol inside various indoor and outdoor architectures and the maximum network node lifetime.

EXPERIMENTAL RESULTS
Two versions of ESP32 development boards were used in the experiments: the standard ESP-32S DEV KIT DOIT board with 30 GPIOs pins and the Wemos D1 R32 UNO ESP32 board. A power supply was also employed, which consisted of Wemos 18650 rechargeable lithium batteries (3.7 v and 4,800 mAh). The Arduino IDE version 1.8.12 has been used to upload code to ESP32 boards in our experiments.
In the first series of experiments, we tested the compatibility between ESP-32S DEV boards and Wemos D1 R32 UNO boards. The two ESP32 boards have been utilized as a transceiver to exchange various data types (up to 250 Mbit/s) from other boards. These experiments revealed that the two versions of ESP32 boards are extremely compatible.

Figure 7 Four levels of an adaptive Spider mesh topology using ESP32 boards and ESP-NOW protocol.
Full-size DOI: 10.7717/peerjcs.780/fig-7 Table 3 Number of levels and nodes for the proposed approach.

Levels
Number of nodes 0 1 1 1 + 5 = 6 2 1+ 5(2) 0 + 5(2) 1 = 16 3 1+ 5(2) 0 + 5(2) 1 + 5(2) 2 = 36 Exchanging data with the proposed approach through one-way and two-way communication methodologies, to control a group of peripherals based on the received value was the target of the second series of experiments. We were able to ensure the reliability and dependability of the proposed approach in exchanging data. Using the ESP-NOW protocol, we measured the maximum achievable distance between transmitter and receivers under various construction conditions using these experiments on three different indoor architectures and a set of outdoor regions.
The proposed approach was shown to be capable of establishing a simple and fully connected network inside various indoor and outdoor structures in the second series of experiments. As shown in Fig. 8, the maximum distance between network nodes inside various indoor structures is around 15.5 m, while the maximum distance between network nodes for outside environments is roughly 90 m as shown in Fig. 9.
The target of the last series of experiments is to identify the network node lifetime. This target was achieved by measuring the energy consumed in sending and receiving data using The network node lifetime may be easily determined using Eq.
(2) (Farahani, 2011), where T is the battery lifetime (network node lifetime), measured in hours (h); Q is the battery charge capacity which in our case is 4,800 milliamps per hour (mAh); and I is the  average current that a load is drawn from it which can be measured in milliamps (mA) as illustrated in Fig. 10. According to our experiments, the lifetime of a server node using the Bluetooth Low energy protocol is around 62 h (4,800 (mAh)/76.4 (mA), whereas the lifetime of client nodes is roughly 64 h (4,800 (mAh)/74 (mA). The lifetime of a sender node using the ESP-NOW protocol is 37 h (4,800 (mAh)/129 (mA), while the lifetime of a receiver node is 39 h (4,800 (mAh)/121 (mA). Keeping in mind that all previous experimental results are running in active power mode. Table 4 summarizes our experimental results and demonstrates the benefits of using Deep-sleep power mode to save the battery power for thousands of hours. A comparison between the proposed low power consumption communication protocols in this paper has been summarized in Table 5, while a comparison between an existing short range low power consumption communication protocols has be summarized in Table 6. Figure 11 illustrates the difference between our experimental results and existing researcher results (Mahmoud & Mohamad, 2016).

CONCLUSION AND FUTURE WORK
Recently, researchers are working to build a mesh network with low-power sensors, devices, and protocols in military sites, archaeological sites, smart parking, farmlands, and construction sites. This paper proposes an adaptive low power consumption mesh approach called ''An Adaptive Spider-mesh topology''. To be able to fairly appraise this study, we must examine network characteristics such as the desired network topology, communication protocol, maximum number of connected nodes simultaneously, communication methods, power consumed, and network node lifetime utilizing the proposed approach.
Although the ESP-NOW protocol is a proprietary protocol that consumes twice as much power of the Bluetooth low energy protocol, the experimental results show that it is an efficient bi-directional communication protocol for developing the proposed approach. Inside various indoor structures, the maximum distance between sender and receiver is roughly 15 m, whereas the maximum distance for outside environments is approximately 90 m. According to our experiments, the transmitter node can simultaneously connect to up to seven receiving nodes. The maximum distance between server and client nodes in the case of BLE protocol cannot exceed 6 m, and the maximum number of connected client nodes to a server node cannot exceed three nodes.
The proposed approach can be used in future work to collect, analyze and monitor unexpected weather conditions that may have severe consequences for construction equipment and materials at construction sites. Choosing the most appropriate energyefficient routing protocol to the proposed approach is one of the most important challenges we will attempt to address in future research. Machine learning techniques like as Neural Networks, Support Vector Machines, Decision Trees, and other approaches will be integrated with the proposed approach in assisting decision makers or automatically taking decisions in many fields of our daily life. Developing an efficient wireless network