Towards a secure and self-adapting smart indoor farming framework

Facing the increase in world population and the stagnation in available arable land there is a high demand for optimizing the food production. Considering the world-wide and ongoing reduction of the agricultural labor force novel approaches for food production are required. Vertical farming may be such a solution where plants are being produced indoors in racks, cared by robotic appliances which will be operated by specialized software. Given the multitude of parameters which determine the ideal condition, a lot of data needs to be acquired. As this data is used to adapt the entire Cyber-Physical System to a changing environment the data has to be secure and adaptations have to consider safety aspects as well. Such systems must hence be secure, safe, scalable and self-adaptable to a high degree. We present an important element for such solutions, a cloud, IoT and robotic based smart farming framework.


Introduction
In 2050 the expected growth of the world population will reach 9.8 billion [1]. This high number of people brings with it a variety of problems regarding food security and food supply, especially in dense urban areas. A total of two thirds are expected to be living in urban areas at that time [5]. The reduction in arable land due to factors such as soil degradation, reduction in soil quality and climate change, as well as reduction of work labor, etc. is worsening the ability to supply this high amount of people [2]. A technology that is addressing this issue is called vertical farming. Here food production of vegetables, fruits and other crops is done in buildings, in a vertical array of growing areas (shelves/platforms), with help of Internet of Things (IoT) and robotic devices. Especially in indoor production facilities, where sensors and actuators are constantly measuring and adapting the environment, the full potential of vertical farming is utilized. Vertical farming provides the ability to garden indoors and thus in cities and also places where the environment is too harsh for agricultural production (e.g. dessert, cold or hot climate). Indoors the plants are supplied with light by using light emitting diods (LEDs). One promising type of vertical farming is hydroponics. This technology enables plant growth without soil, by applying liquids containing the essential nutrients for the plant directly to the roots [3]. A subgroup of hydroponics is aeroponics, where the roots are completely exposed to the air and frequently supplied with nutrient enriched spray or mist. Pumps are used to circulate the nutrient enriched water in a closed system. Space is used much more efficient than in other technologies as it is vertically arranged and thus yield per m 2 is higher. Arrays in vertical stacks are much lighter, as no soil is used, and can be built cheaper. Further, there is a lower water and nutrient usage, as it is a recirculating system (up to 90% less compared to conventional agriculture) [3]. Faster growth rates through optimized nutrient supply and environmental parameters (e.g. temperature, light) is also experienced [4]. No pesticides are necessary and the fertilizers can also be reduced and reused.
On the other hand, the system is volatile to failure. If an error stops the nutrient supply to the roots, crops are at risk to fail in no time [4]. Thus, automation and self-adaptation are key factors for this systems to work. Depending on the condition a lot or less data is required hence the system has to be scalable. As the data November 2019 136. Jahrgang determines how the system adapts itself the system must be secure. As adaptation also controls robots safety must be considered.
In this paper, we investigate on possible technologies for an Indoor Farming Support as a Service (IFSaaS) prototype that integrates different IoT devices and a robotic spray system (AgroRobot). Following above arguments we consider scalability, self-adaptability, security and safety.

Related work
Although being a relatively new approach, considering integration of IoT, research on aeroponic dates back to the 1950's, where Carter [6] researched methods for roots examination and introduced air culture as a method for plant growth in water vapor. Newer approaches use Cyber-Physical System (CPS) elements for automating growth processes. [7] designed an automatic aeroponic irrigation system that monitors and automatically waters a greenhouse using an Arduino 1 microcontroller. They arranged a master-slave connection between two Arduino via WiFi, the slave gathering sensor data and automating pump activity and the master storing it in a database, and presenting it on a webpage. They implemented safety alarms when the pump has zero water level to pump from, the nutrient solution level is below a minimum value and if the sprinklers are clogged. This events force the system to stop, yet manual restart is necessary. A related aeroponic system design was established by [8]. They introduced a concept on designing a control system, a data collection system and a main computer (base station). The first part consists of actuators altering the environmental parameters such as temperature, light, wind flow, etc. The data collection unit measures the values needed by the control system to work optimized. Values for wind, temperature, humidity and light are measured and forwarded to the main computer. This unit saves all data collected and forwards it to a centralized database and allows access to every activity via a web based Android 2 application. The centralized unit analyses the data enabling decision making for optimal plant production.
Regarding IoT networks [9] designed and deployed a low power, wireless sensor network using 6LoWPAN, 3 a low power IPv6 for wireless personal area networks, CoAP, 4 a protocol for communication of constrained devices, and ContikiOS, 5 a light weight, low power OS. They implemented a sensor network with a processor board, containing a microcontroller and flash for storing, and a carrier board with a low throughput sub-GHz radio, a real time clock and a power supply. Routing Protocol for Low power and Lossy Networks (RPL) [16] was used as an effective routing algorithm for the desired mesh network setup. They further used Border Router and RESTful 6 services GET and DELETE to gather data from the nodes which they further processed via satellite link to a MySQL 7 database.
Robotic elements in vertical farming are often used for harvesting or surveillance of the systems. For a future building strategy [10] designed a robot supported urban farming system, in which a robot operates a greenhouse that is attachable to facades. In their work on IoT support for vertical farming systems [11] discuss a robotic 1 https://www.arduino.cc/. Accessed 2019 August 01.  extension for an existing indoor farming system that identifies ripe plants and harvests these. A camera visually detects the plants and a robotic frame moves a robotic manipulator that harvests the plants. Alongside the harvesting algorithm, steering the process, they further propose a planting algorithm, that enables automated optimized planting in empty pots. [14] used a robotic system to monitor and adapt humidity, temperature, plant seeds and water a greenhouse. The so called iPlant further detects smoke and alerts an operator in case of an alarm.

Use case
Our focus is on the production of micro greens (shoots after first leaves developed) and the design of a commercial indoor aeroponic system. Micro greens have growth cycles of 7-9 days, which enables for quick system test cycles. We focus on measuring and optimizing the environmental parameters in the root chamber, as it plays an important role in the plant growth process, and yet few research was done in this area. Therefore, it is vital to measure relative humidity, temperature of the nutrient liquid, oxygen level (O 2 ), air temperature, carbon dioxide level (C0 2 ), pH value and electrical conductivity (EC) which indicate the amount of fertilizer in liquid. Equivalent actuators must hence be implemented to regulate these parameters. We focus on 2 setups that apply nutrient liquids in different forms. The first will have a set of nozzles attached to the sides of the grow box, spraying the roots sideways. The other is a spray robot (AgroRobot) that moves horizontally on the bottom of the root box, spraying the roots from below. We will also install a reference system with the same setup. This is necessary to find optimal parameters of the root chamber environment and hence optimize growth and efficiency of the system. According to measurements of environmental parameters the AgroRobot and the actuators need to adapt themselves to the changing environment. We thus identify the need for an Indoor Farming Support as a Service (IFSaaS) prototype that allows for monitoring and operating such a complex system. The system is supplemented by fan and lighting in the ambient area. See Fig. 1 for a layout of the AgroRobot and the IFSaaS.

Design
Our main goals in the design of IFSaaS and AgroRobot are scalability, self-adaptability, security, safety and also sensor management. Therefore, we concentrate on integrating and implementing elements that address this goals.

IFSaaS
To operate a multitude of sensors in a distributed network we need a setup that enables easy integration and management of sensors. We 342 heft 7.2019 propose usage of low power consuming, constrained devices that are able to communicate wirelessly over IEEE 802.15.4 (6LoWPAN) 8 such as merkurboard 9 . Such devices are low cost and low power which is ideal for large amounts of sensors. As an operating system we use established IoT operating systems like ContikiOS or RiotOS, that are low energy consuming, open source and written especially for IoT networks [13]. These microcontrollers can interface with sensors and actuators and communicate with each other in a mesh network that dynamically self-organizes itself. This should aim for safety and fault-tolerance if a few nodes fail. Additionally, over the air programming enables to maintain, update and reprogram nodes easily and without physically operating on the device [15]. We propose a registration of IoT devices that allows for coupling of heterogeneous systems & components, whilst maintaining a chain of trust, like Arrowhead 10 [17]. The usage of IPv6 is proposed due to its high address space, quality of service and for its implementation in low power communication protocols like 6LoWPAN. We further suggest usage of Constrained Application Protocol (CoAP) as it uses URIs, and RESTful interaction and supports IP multicast communication and is ideal for machine to machine (M2M) communication [12]. Sensor measurements are forwarded in Sensor Measurement Lists (SenML) 11 data package format which is ideal for constrained devices. The whole network is only accessible via an OpenVPN 12 tunnel. Further security features such as CoAPs over dtls and https over tls, etc. are considered. Different approaches will be evaluated and implemented. For the control algorithms that operate the farming system we suggest a hybrid cloud setup, that integrates several rapid prototyping software such as Node-RED, 13 meteor.js 14 and meteor kitchen 15 in a cloud. We propose nginx 16 as a reverse proxy that forwards requests to the relevant system components and munin 17 for network monitoring. For safety reasons it is necessary to implement an emergency program directly on the nodes that enables plant survival. Access to the system must be established for different user groups and roles such as admins, operators, chief executives, etc.

AgroRobot
Depending the watering of the aeroponic system a robotic appliance will be created that aims at automation and self-adaption, called AgroRobot. Using the mechanics of a 3d printer, we will arrange a spraying lance on an appliance that moves vertically inside the root box spraying the roots. The goal is to find the optimized spray time and the right spray volume, as well as, the right spraying pressure and array of nozzles. Moreover, the moving speed of the spray lance needs to be optimized. Thus, we will conduct multiple tests varying this parameters. Based on yield weight proportional to dry weight, mineral uptake, height of the plants the yield is evaluated. Additionally, AgroRobot needs safety functions if the root box

Fig. 2. Design layout for AgroRobot
is opened, to prevent accidents with this moving mechanical element. Furthermore, alerts need to be sent to responsible operators. This logic will further be depicted in the cloud setup and, in case of a failed connection to the cloud, also locally. For a layout of the proposed AgroRobot see Fig. 2. We plan to use 2 of these AgroRobots on 2 different locations.

Conclusion
In this paper we identified the need for and presented a framework for a cloud, IoT and robotic based smart farming system. The goals of this setup are to address scalability, safety, security and selfadaptability. A robotic appliance is currently being designed and developed based on investigations and proposal in this paper. Further, an Indoor Farming Support as a Service (IFSaaS) is provided for controlling, monitoring and operating a distributed network.