Cross-Platform Real-Time Environment Monitoring System Based on Personal Area Networks (PAN)

This paper studies cross-platform data processing systems, including databases, and developed a database for storing and displaying data on a working window. A system consisting of a transmitting node, a coordinator and a data processing system has been built. In addition, functional and physical models of personal networks for data transmission have been developed. The element base was substantiated and devices for monitoring the personal environment, devices for receiving and processing sensory data, as well as a web application for visual presentation of data were developed.


INTRODUCTION
The need for a transition to wireless communications between personal information devices became urgent at the end of the 20th century, when, thanks to advances in the field of micro-and nanoelectronics, these devices became small.Wired communication between them has become inadequate for a number of user characteristics -convenience, accessibility, availability time, etc [1].In the modern world, the main scenarios for the use of WPAN are the creation of communication networks for peripheral elements of personal computers, the creation of episodic networks of portable computers (laptops), the creation of personal networks for accessing information devices to trunk communication lines by using mobile phones as access points, the creation of sensor networks that provide environmental control and objects [2].
In the world, research work is being carried out aimed at developing methods for building personal networks to provide a mobile wireless network of small radii of smart homes, smart cities, transport systems, etc.In this work, we have developed a cross-platform system based on sensor networks whose main goal is to show and test wireless sensor networks for the implementation of such projects.

CROSSPLATFORM SYSTEMS AND APPLICATIONS
A cross-platform computing product or system is a product or system that can run on multiple types of platforms or operating environments.Different types of cross-platform systems include both hardware and software systems, as well as systems that require separate builds for each platform, as well as other broader systems designed to work the same way on multiple platforms.Cross platform is also known as multiplatform or platform independent.In general, the term "cross-platform" is used differently in many areas of the IT industry.Resources from developer communities and open source projects indicate that the definition of the term can refer to running a program or system on different operating systems and programming environments, or even different types of physical hardware devices [3].Each device and operating system has its own programming interface for working with applications.Manipulating them in a variety of ways can help IT systems work effectively in a variety of environments.One common type of cross-platform system is a virtual product or system that will run in a cloud computing or wireless network environment.Here, developers will look for synergy between external and internal systems that can be connected remotely via a global IP connection.
Developers or users can talk about cross-platform systems that can be configured to run on an end user device regardless of the manufacturer or in any number of end user environments provided by the vendor or open source.In many cases, cross-platform operations include not only working with application programming interfaces, but also with any existing licensing requirements.Open source software and operating systems have reduced the use of the traditional software license agreement, but many of the best operating systems and other environments are still provided under traditional licenses [4].
So, the project that was developed for the introduction of ZigBee technology to IoT technology also reflects the concept of crossplatform.Because, in today's time, there are a sufficient number of systems and devices, and the term "cross-platform" is already a mandatory requirement for running and operating software.When developing my project, it was taken into account that it would be cross-platform.

MODELING A WIRELESS SENSOR NETWORK
The work included the basic organization and construction of a Wireless Personal Area Network (WPAN) for a smart home.Through this network, it is possible to transmit and receive temperature and humidity values measured using a sensor [5].
The sensor is also referred to as a humidity and temperature sensor.As an example for the project, a DHT11 type sensor was chosen, but any sensors for various purposes can be used.
All data is transmitted digitally over a single-wire bus.Work with the sensor can be carried out only at positive temperatures.Relative humidity can be accurately determined within the range of 20-90%.In order for the DHT-11 module to work correctly with the Arduino, a 10 kΩ resistor must be connected between the Vcc and Data pins on the sensor if the distance to the Arduino is less than 20 meters.If the distance is more than 20 meters, use a 5.1 kΩ resistor.When transmitting data over a distance of 30 meters, use a shielded wire and a capacitor to avoid large errors.Due to the fact that the sensor sensor only takes measurements on demand, the module is very energy efficient.While waiting for a request, it will consume 100 uA.In request mode, the sensor consumes 2.5 mA.It is possible to receive data no more than once every 2 seconds [6].
The model of the data transmission network in the project is given in the figure 1.
In addition, a physical model of WPAN was created using the ZigBee protocol, since it is the most accessible and one of the most relevant protocols.The following devices were involved in the simulation process: • Arduino Uno Rev3 board controlled by ATmega328P microcontroller; • Digi XBee module; • Raspberry Pi 4 Model B; • Sensors for data collection.Used operating systems and programs: To create a connection between the module and the microcontroller, the following diagram shown in figure 2 was used.
The next step is to configure the module.The ZigBee module is configured through the XCTU software environment.
XCTU is a free, multi-platform application that allows developers to interact with Digi RF modules through an easy-to-use graphical interface.It includes new tools to make it easier to set up, configure, and test XBee RF modules.
XCTU includes all the tools a developer needs to quickly get XBee up and running.Unique features such as the Network Graphical View, which graphically represents the XBee network along with the signal strength of each connection, and the XBee API Frame Builder, which intuitively helps you create and interpret XBee API frames used in API mode, are combined to facilitate development.on the XBee platform is easier than ever [7].
Modules are configured differently depending on the destination, i.e. end node, router, or coordinator.The settings of the end node differ in that the sleep mode is turned on in the node, which allows the device to save energy, for which the corresponding parameter is set in the SM (sleep mode) settings, which is selected from the drop-down list.The settings of the router and the coordinator are almost identical, both are configured for uninterrupted operation -without sleep mode, the only exception can be setting the CE Cordinator Enable value to the Enable (1) mode when configuring the coordinator.All devices on the network must have identical PAN IDs.
As a result of the settings, the network is ready for research, the network architecture is given in the figure 3.However, for the The script includes two functions: 1. Interaction of Zigbee module and Arduino microcontroller; 2. Reception of data from the Zigbee module and subsequent output of information to the serial port for further processing by external devices.
In this work, the external device is a Raspberry Pi 4 Model B running Ubuntu running WPAN applications.In an external device, which in turn is also a coordinator, a script is launched to read data from the Raspberry Pi serial port, which allows you to sequentially receive data on the serial port, followed by posting the received values to a specific website.

ORGANIZATION OF DATA STORAGE, DISTRIBUTION AND PRESENTATION
On the server side of the system, an application was launched that was written to read data, store it in a database, and also display values in real time.For these purposes, first of all, a database was created.
A database is an ordered collection of structured information or data that is usually stored electronically on a computer system.The database is usually managed by a database management system (DBMS).The data together with the DBMS, as well as the applications that are associated with them, is called a database system, or, for short, just a database.

DATABASE TYPES
There are many different types of databases.Choosing the best database for a particular company depends on how it intends to use the data.
Relational databases.Relational databases came to dominate in the 1980s.The data in a relational database is organized in tables of columns and rows.A relational DBMS provides fast and efficient access to structured information [8].
Object-oriented databases.Information in an object-oriented database is represented in the form of an object, as in object-oriented programming.
Distributed databases.A distributed database consists of two or more parts located on different servers.Such a database can be stored on multiple computers.
Data warehouses.As a centralized repository for data, a data warehouse is a type of database specifically designed for fast querying and analysis.
NoSQL databases.The NoSQL database, or non-relational database, makes it possible to store and process unstructured or semistructured data (as opposed to a relational database that defines the structure of the data it contains).NoSQL databases are growing in popularity as web applications become more widespread and more complex.
Graph databases.A graph database stores data in the context of entities and relationships between entities.
OLTP databases.An OLTP database is a database designed to carry out business transactions performed by multiple users.
These are just a few of the dozens of database types currently in use.Other, less common databases are designed for very specific scientific, financial and other tasks.The project used the PostgreSQL object-relational database system.
PostgreSQL is a powerful open source object-relational database system that uses and extends the SQL language, combined with many features to securely store and scale the most complex data workloads.The origins of PostgreSQL date back to 1986 under the POSTGRES project at UC Berkeley and have been actively developed on the main platform for over 30 years.To use Postgre, we installed the Postgre database server, a graphical database administration and management tool, and pgAdmin, the most popular GUI Tool for Postgre.

DATABASE DEVELOPMENT
In general terms, the server side looks like this: The program has the main class ProjectWorkApplication from where the application is launched.In addition, there is application.properties where settings for the application are written, for example, we specify the port for the application or set up communication with the database, etc.After the application starts, the server is ready to process data.We created a ProjectWork model for data, declared it a table using the @Table annotation, and Spring Data Jpa itself drew this model in the database as a table.All data can be processed directly in the controller, but it will be more correct and decent if processing is implemented in the service.Therefore, it was created in the API controller for POST requests and passing data to the create method of the service.The data in the phyton script was passed to this API.The Create method in the controller catches this json data, as a template, which is requests and passes it to the service's create method for processing.The results of the server part of the application are shown in the figure 4.

DATA PRESENTATION
The next step performed by the system is to display the values in a browser application in the form of a graph so that this data is more informative and interactive.For this, a project was implemented in the JavaScript programming language using the React JS library.The main packages that were installed for the project to work are React JS, React Chart js, Chart JS.Chart JS is a library that provides ready-made components for various chart and chart canvases.In addition, CustomLineChart was called -a component that draws a graph depending on the input data and options.As a result of 12 minutes of data processing from the sensor, the web application displays informative temperature and humidity graphs as given if figure 5.

ORGANIZATION OF DATA STORAGE, DISTRIBUTION AND PRESENTATION
After starting the system and checking the performance, we conducted several experiments on the network.Experiments were conducted to determine the delivery time of requests, as well as the coefficient of request delivery.To display the delivery time of requests, we listened to one port, that is, requests from one node through XCTU where we created requests through the environment request generator.Requests were sent through the end device and received a response from the coordinator about the delivery of the request.By fixing the transmission and reception times, we can calculate the average one-way request delivery time using the formula [9][10]: The results of the experiment are shown in figure 6.
From the values of the figure and the calculation, it can be obtained that, on average, one-way requests reach an average of 400 milliseconds with a distance between devices of 10 meters of line of sight.To identify the dependence of delivery time on distance, the experiment was carried out several times at different distances, the results of which are shown in figure 7.
The second stage of the experiment was carried out to calculate the coefficient of delivery of requests and its dependence on distance.For this experiment, the previous method was used, since if a response is not received from the coordinator, one can argue about the non-delivery or acceptance of the request.As the distance increases beyond 220 meters of line of sight, requests begin to disappear [11].
Thus, by gradually increasing and counting the number of lost requests, you can plot the dependence of the number of lost requests on the distance.The graph is shown in figure 8.

CONCLUSION
Personal networks serve primarily to interconnect computer components within a short range -in the so-called personal zone.Several devices are connected to almost any computer: monitor, keyboard, mouse, printer, each of which is connected to the system unit using cables, but it is much more convenient to use a wireless connection.However, personal networks are needed not only to connect computer peripherals: as the number of devices connected to the network grows, sensor technologies are introduced and smart infrastructure is being built, the problem of their wireless connection in the personal zone becomes more and more urgent.
In this article, a physical wireless personal network was built on which practical experiments were carried out.A system for collecting, storing and processing data based on the created network has also been developed.
The conclusions of the study are as follows: • The implemented system is fully functional and can be applied in different variations of sessions.• ZigBee-based wireless personal network is currently the best in terms of data transfer speed, module availability, free scalability, and data security.• The constructed model showed that the range of the constructed personal network is over 500 meters, but the radius    of up to 300 meters is optimal, since over this distance, packet loss increases sharply, starting from 10%.• Request delivery time does not strongly depend on the distance between nodes and is in the range from 380 to 600 milliseconds in the coverage area.

Figure 7 :
Figure 7: Dependence of delivery time from distance.

Figure 8 :
Figure 8: Dependence of the number of lost requests from distance.