# A Reliable Publish-Subscribe Mechanism for Internet of Things-Enabled Smart Greenhouses
## 1 Introduction  
The Internet of Things (IoT)-enabled smart greenhouse is an innovative agricultural system that employs cutting-edge technology to improve crop yield [1, 2, 3, 4]. These systems are a technologically sophisticated variant of conventional conservatories designed to improve agricultural productivity, efficiency, and sustainability. The continuous collection of sensory data from sensors, such as temperature, humidity, light intensity, soil moisture, and other variables, is required to monitor and control environmental variables, considerably enhance the greenhouse's performance, and transmit environmental information to cloud-based systems. Remaining up-to-date with greenhouse climate characteristics and modifying them to correspond with the requirements of various crops has become a formidable obstacle [5, 6, 7]. Therefore, it is crucial to establish standardized seamless connections between the cloud infrastructure and IoT systems [8, 9]. Similarly, the articles discuss manymachine-to-machine (M2M) protocols employed for the transmission of IoT application information. These technologies include Constrained Application Protocol (CoAP) and Message Queue Telemetry Transport (MQTT) [4; 10; 11]. CoAP is a RESTful platform that employs a request/response structure. It is evolved from the Hypertext Transfer Protocol (HTTP) and developed specifically to adjust to the limitations of restricted systems [12; 13]. Nevertheless, in the context of cloud connectivity, a crucial aspect of devices is their ability to autonomously transfer data without being prompted for an additional request. Hence, the MQTT publish-subscribe (pub-sub) system presents the capability to transmit data to the cloud regularly [10; 14; 15; 16; 17], without necessitating the reception of a request. In addition, pub-sub structures establish connections between terminals or clients, such as IoT products and cloud platforms, through the assistance of a broker [18]. Pub-sub systems guarantee the transmission of information to the server by employing Transmission Control Protocol (TCP) as the communication protocol [19]. These systems supply two essential components for the messages: the topic, which is an organized list that specifies the context to which the sent data pertain, and the payload [4]. In terms of the topic classification between pub-sub clients and the broker, the establishment of a hierarchical categorization mechanism for messages facilitates the optimization of message routing and processing on the broker's end. Hence, the unorganized nature of the data presents an appropriate level of adaptability. However, it is important to acknowledge that this flexibility comes with certain limitations. For instance, the size of the topic and payload may range from tens to hundreds of bytes, as demonstrated in the studies conducted by researchers [15; 20; 21; 22]. Additionally, the implementation of a standardized pub-sub structure within the context of MQTT presents a significant challenge, as illustrated by the investigation performed by the authors [4; 10; 23; 24]. The deployment of pub-sub mechanisms through MQTT brokers may be categorized into two distinct types, namely, scalable and non-scalable, depending on the particular requirements of IoT applications. In circumstances where there is an imperative to provide support to a substantial quantity of publishers, subscribers, and messages, the presence of a scalable MQTT broker becomes crucial. In cases where scalability is not a fundamental desire, a non-scalable broker may be adequate for limited installations [25]. To address these challenges, this research paper proposes a Smart Greenhouse Protocol (SGP) based on the MQTT protocol. The principal objectives of this research are as follows:  
* Standardize the topic and pub-sub system to minimize server processing. * Reduce complexity and cost while providing optimal extensibility and flexibility to meet the demands of greenhouse systems.