Develop low cost IoT module with multi-agent method

Internet of Thing (IOT) is a very hot topic recently, many of the important issues in the field of research. But to the conventional apparatus or systems and network connections, sometimes we need complex modifications or expensive costs. Therefore, this paper using the MCS-51 series single-chip integration of analog, digital signal input, and ETHERNET, WIFI and other communication interface, to develop general-purpose IOT modules. This module can be used to replace existing equipment or devices, or combination use with the original device. We also use the module in a Multi-Agent Method, we can ensure that the module in signal capture or communication failure can be replaced or assisted by other modules. Finally, we can use these modules to build the sensor network.


Introduction
Internet of things technology (IOT) is a very popular research topic recently, because this technology can make people's life more convenient.For example, Gubbi, Jayavardhana, et al. [1] put forward many examples and visions for the application and future of this technology.In addition, He, Wu et al. [2] proposed an intelligent parking cloud service and a vehicular data mining cloud service.From this example we can know that the IOT technology is also the basis of cloud computing and big data.And [3] Yang, Geng, et al.Put forward the application of IOT in home care.In addition to these applications related to people's daily lives, IOT is also the basis of industrial 4.0 and intelligent factories [4].
From the above example we can know that the IOT technology for future life have a great impact.But IOT technology still has many problems to be solved.For example, many devices simultaneously communication problems, different devices connected, and IOT module costs higher etc.In this paper, we use the lower cost single chip as the core, integrating many communication interfaces.As well as multi-channel A / D and digital I / O, to development of a low-cost IOT module.This module can operate independently, and can be operated directly with the browser.In addition, modules can be P -63 grouped according to the communication interface or function.Grouping mechanism can be manual; we can also use multi-agent method to automatically create a group module.Finally, we have also developed a monitoring system for the management of all modules and data collection.This constitutes a complete system, and let the paper developed by the module in the use of more flexible.

System Architecture
The IOT module developed in this paper is based on MCS-51 series of single-chip-based controller.Because this module is IOT applications as the main purpose, so in the communications we have integrated Ethernet and WIFI interface.In addition the module also has UART (Universal Asynchronous Receiver / Transmitter), this interface can be converted into RS232 / 422/485 interface.So that modules can be connected with many traditional devices or devices.Finally, we also provide a 433/868/915 MHz triple-frequency, 170-channel RF interface.This module allows communication even more complete and powerful.The IOT module in addition to powerful communications features also has a digital and analog interface.In the analog interface section, the module has eight 10-bit A / D channels, and in the digital I / O section, the module has 10 channels.When necessary or when the application is not used to the A / D, it can also be changed to digital I / O, so this module can have a maximum number of 18bit I / O channels.In addition the IOT module also has a 1280Byte eeprom, which can be used to record the A / D data.This allows IOT module can calculate preliminary data, so that IOT module has certain decision-making analysis capability.In addition, this function can also be used in case of communication failure, as temporary storage of data.This IOT module structure is shown in Figure 1.In order to make the communication module more efficient, we designed a communication protocol, the communication protocol structure shown in Table 1.

Multi-agent Method
We designed the IOT module can operate independently, and from our design of the communication protocol, our system can have up to 65,536 devices.If using IPV4 protocol, so much the device will need 256 Class C network segment.So the device for the communication and management will cause great distress.Therefore, we use the structure of the group, so that modules can be grouped in accordance with the function or task group approach.Group communication, is handled by the group manager, the group has two ways.
(1) Based on Sensor Kind: This approach is based on the module preset Sensor Kind grouped, which is based on modules grouped categories.(2) Grouped by task: This approach is by the user, depending on the task, such as fire detection, gas detection, and greenhouse control and so on.The

P -64
user can freely set the task type and the task type to which the module belongs.The group manager in the group is generated in the following way.Each communication interface is set with different weights as shown in Table 2. Usually we first manner of communication create a group, and we have three modules while communication interface work.So the weights are the sum of the weights of the three communication interfaces.If one of the interfaces fails, the weight of that interface will be set to 99.So all the normal network communication module, the probability of a group manager will be higher.The number of connected modules of the module manager will also affect the weight, the impact of which is shown in Table 3.Finally, the module is wired to the module manager's algorithm.We use the A* algorithm, because the algorithm is simpler, so the IOT module can calculate itself, without the need to pass through the monitoring system.In addition, if the IOT module has the ability to locate or set location information, this algorithm can also be used to find the shortest secure path.This algorithm is shown in Equation 1.
F(n) is the movement cost of any path point.G(n) is the cost of movement from the starting point to any point on the path.H(n) is predicts the cost of moving from any point on the path to the end.We are based on the IOT module Sensor Kind and Module as coordinates.Therefore, when we create a group in mode 1, the modules of the same type can quickly become a group.And group Module smallest value becomes higher probability of a group of managers.
When using a task to create a group, Sensor Kind changes to the task number set by the user.These same task modules to quickly create groups.Because of our communication interface, and the number of modules connected modules are set weights so that the total weight was W: W=w1+w2 Therefore, we can rewrite Equation 1 as.
This allows the module to quickly create groups, and when the group is abnormal, the module can quickly reestablish the group, so that the entire system management communication more efficient.

Experimental Results
We use MCS-51 series of single-chip, combined with Ethernet, WIFI, RF and other communication interface to complete a low-cost IOT module.This module is modular design, all the communication interface, can be installed in accordance with demand, and can have three communication interface work at the same time.And all the A / D and I / O can allow users to determine their own functions, so that the use of the entire IOT module more flexible.Each IOT module can operate independently, when necessary, between the modules can also use multiagent method to form groups. Module between groups can function in accordance with the communication priority or function priority setting, when the group manager failure, the group well automatically re-generate the manager module.The use of such a mechanism, to ensure that data communication between the transfer modules will not be interrupted.In this way, when use of Ethernet or WIFI communication, it also to reduce IP use and collision, improve the efficiency of the entire system.Figure 2 is some example of a group of modules.We also designed a management software as shown in Figure 3, this system can immediately manage and monitor all modules of the situation and information, so that the whole IOT system more convenient.Finally, in order to make it easier to use, we make all the IOT module has WEB server function, so all of the IOT module can operation directly with a browser.Do not need to through other management software or WEB server, the results

P -65
shown in Figure 4.This makes our IOT module system more complete.

Conclusion Tables
We have developed a MCS-51 single-chip-based IOT module, the module has Ethernet, WIFI, RF and other communication interface.This module can operate directly in the browser, but the overall cost only about US $ 30.Therefore, the IOT module developed in this thesis is powerful and inexpensive, which will be very helpful for the application and development of IOT system.
In the future we will continue to improve the function of our development module.For example, let the number of connections for each module is capable of more, let IOT module can support IPV6, and let the volume IOT module smaller, more power saving.Finally be able to develop into a wearable device, so this paper developed modules can be applied in more fields.