Integration driven simulation environment for designing Internet of Things nodes

The article presents the possibilities of using simulation environments for designing Internet of Things nodes. At the beginning, the issues of the construction and use of Internet of Things devices and the construction of simulation environments were characterized. Next, a research experiment on designing the IoT node for dust measurement was presented. The work is summarized by the evaluation of the usefulness of simulation environments to support design processes.


Introduction
Interest in the subject of Internet of Things (IoT) is growing. The Internet of Things is a combination of devices equipped with memory and low computing power, as well as software that allows data collection, processing and transfer between devices [1]. Increasing availability of such devices necessitates the use of appropriate design methods.
Authors of the paper adopted this approach before starting the construction of the IoT node. They formulated the following questions: • Is it possible to design systems without using simulation methods? • How well known simulation methods are adequate for designing the IoT systems?
• Is the use of open source technologies, allowing for any integration of simulation tools, is the appropriate environment to simulate the design process of IoT devices?

Internet of Things and simulation processes
Nowadays, the Internet of Things opens up new possibilities for designing and building systems [2]. Systems where everything or almost everything can be combined. Sensors, measuring stations, actuators or other devices are connected using any communication protocols. Information obtained due to the multitude of these devices can be used in the cloud (Cloud Computing) or on the edge (Edge Computing) [4]. They can also power any systems, e.g. services (software as a service -SaaS) [5].
Based on [6], it is assumed that designing a complex IoT environment due to its heterogeneity and the use of many different scenarios can be difficult. Therefore, it becomes necessary to simulate the design process -both from a quantitative (scenario analysis) and qualitative (accessibility assessment) point of view. Appropriate methods and tools are used to simulate complex systems. For example, adopting an adaptive approach using parallel and distributed simulation, multi-level simulation and -in the case of complex systemsagent-based simulation [7] is being considered.
In the simulation of the design process of IoT systems, discrete event simulation (DES) methods can be used [8]. They create conditions for analyzing the evolution of the system, assessing events and relating these events to the state of the system.
Simulations based on parallel discrete event simulation (PDES) models are being considered [1]. Then complex models can be represented by corresponding parts of the simulation model.
Adaptive approach PADS (parallel and distributed simulation) that was used in the GAIA/ARTIS [9] simulator using time synchronization can be also applied. The multilevel modeling method was used there to simulate Yuki models [3].

The use of continuous integration processes as a method of embedded systems simulation
Simulation of software development processes for IoT systems is possible due to continuous integration of processes, services and devices. This integration can be a problem both in running the code in the embedded system, as well as in the construction of IoT nodes.
The demand for simulation environments that create favorable conditions for true automation and continuous integration is high. Experience shows that this can be achieved using fast virtual platforms along with simulator network models, in which the embedded system interacts.
An alternative solution for the simulation is hardware configuration. Standard system configuration procedure comes down to microcontroller configuration and analysis of test data obtained through measuring sensors connected to this system [10]. In turn, to properly test the embedded software, it is necessary to generate realistic data for the needs of these systems.
These data are usually generated by real-time models. Configuration of the equipment is expensive and only a few companies are able to carry out such tests. A solution is often used to develop a simulator using the API (application programming interface) [11].
Another approach is to run the software without API. This happens when it is assumed that the target software is largely independent of the target system modules. Many companies develop an approach combining elements of both methods described [2].
To create such an environment it is required that the virtual platform accurately reflects the operating conditions of the real system. These conditions, in turn, are necessary for the software being developed and for basic instructions allowing to simulate device registers, memory maps, interrupts and peripheral devices functionality.

Method for designing the Internet of Things nodes
At the first stage, requirements are formulated for the IoT node design process. If it is assumed that the network and system topology consists of simple nodes that collect and transmit a limited amount of data, then such requirements are easy. However, as part of the requirements for the nodes, it is necessary to specify the typical architecture of the network and the IoT node, as well as the type of microcontroller that processes data and runs software packages connected to the wireless device.
The next step is to determine the amount of data and how it will be transmitted between individual nodes. If it is assumed that the devices are communicating via network, the method of aggregating sensor data and displaying information should be considered. To consider choosing the right microcontroller, wireless communication module, as well as programming tools used in the design process of the microcontroller and devices for wireless transmission, are also needed.
After determining the requirements, the subsequent stage is choosing a microcontroller. It is largely a consequence of the function to be performed by the IoT node and the IoT network. For advanced nodes designed with intelligent systems, the 32-bit unit is the right choice.
Next is the choice of wireless connectivity. The costs of network design should be taken into account here. Wireless designers also need to determine if this is the solution that best meets the needs of the application.
If a high standard of 2.40 Ghz wireless networks is assumed, then high data throughput can be ensured. However, it should be assumed that the 2.40 GHz transfer has limited range, poor wall penetration and increases the energy consumption.
At the next stage, the project is simplified due to the integration of components. Until now, the IoT node has been discussed as the sum of its components: microcontroller, measuring sensors and power supply devices. However, this node can be considered as one device instead of using discrete components.
When creating the software that integrates devices, integrated devices can be used. The design process will be simpler after considering the requirements of low power devices.
An example of such a device can be the integrated EZR32 wireless microcontroller with the Peripheral Reflex System, which allows peripheral devices to interact with each other without waking up the central unit [8].

Research experiment -IoT node design
In the research experiment carried out by the authors, the construction of environment for simulation of IoT node design processes was carried out in five stages.
The first stage included the analysis of available technologies for the purposes of creating a visualization simulation environment and checking the correctness of sensor integration with Raspberry Pi. The possibility of using design technologies based on Linux and Windows systems was considered. The first step uses technologies working on the Linux Raspbian operating system based on the Debian distribution.
In the second phase, a simulation environment was designed. First, technology was used to allow data publication and subscription using the lightweight MQTT (message queue telemetry transport) data transmission protocol. An application written in the Node.js environment was prepared for the needs of this environment [12]. Then, the application was expanded to include the functionality of connecting to services created for the needs of the Internet of Things, such as: https://thingspeak.com/, https: opensensors.com/, http://evrythng.com/. These services are used to store, visualize and analyze data from external sources, e.g. sensors. Structure of the simulation environment is shown in fig. 1.

Fig. 1. Structure of the simulation environment
Then the environment for creating the application supporting the designed node -Node RED -was selected. It is a programming tool for connecting hardware devices, APIs and online services. Node RED has many predefined input and output modules that make further node design much easier. One of the modules used to design the data flow was the MySQL database module. This database was used to record the values downloaded from the sensors. The last component of the simulation environment was data visualization technology.
At the third stage, a simulation environment developed for the construction of the IoT node was used. Seven sensors were connected to the Raspberry Pi via a GPIO digital port. The following sensor types were considered: liquid level sensor (XKCY25T12V), distance sensor (HCRS04), motion sensor (PIR-HCSR501), sound sensor (Waveshare), temperature and humidity sensor (DHT22), light intensity sensor (BH1750) and pressure sensor (BMP280).
Individual sensors were connected to the Raspberry Pi and the flow of data derived from them was followed. The flow was analyzed using the Node Red environment, and data visualization was carried out using Grafan technology. An example of data flow operation, in which a temperature and humidity sensor is connected is shown in fig. 2.
At the fourth stage, the simulation results were the basis for the reconstruction of the IoT node. This solution required the use of an additional device -WiFi module ESP826601 -necessary to connect the Arduino to the computer network (effect of the simulation). Raspberry Pi with the MQTT server installed was used as a data capture server -the so-called broker. Various types of Arduino microcontroller were used -UNO, Nano, Pro mini.
At the fifth stage, the ESP826601 module capabilities were evaluated based on data flow analysis. It has been noticed that it has a programmable microcontroller, so efficient that it can successfully replace Arduino. Due to the limited number of GPIO and ADC ports in the ESP826601 module, the ESP8266-12 module has been selected, which has nine GPIO ports and one ADC line on the connector. To confirm the correct operation of the node and the usefulness of selected technologies, the simulation environment was re-used, which after another modification was based on a virtual machine with Linux Ubuntu.

Summary
The purpose of the paper was to present a simulation environment for IoT node design processes driven by technology integration processes, including IT environments and node technical components such as microcontrollers and measurement sensors. The method and own environment of simulation of node design processes in the conducted research experiment was presented. Both programming environments, measuring sensors and microcontrollers were selected. The significance of simulation processes for the selection of technologies, their subsequent integration, as well as for the selection of sensors and microcontrollers has been demonstrated.
Presented example, in which liquid level, distance, motion, sound, temperature and humidity sensors were connected to the Raspberry Pi microcontroller, showed the significance of an integrated simulation environment for data visualization for the light MQTT protocol, an environment for visualization of Node RED flows and presentation of Grafan data. The node has been reconfigured using this environment. The microcontroller has been changed to optimize the process of data acquisition and processing for the purposes of environmental protection.