# An Internet of Things-Based Low-Power Integrated Beekeeping Safety and Conditions Monitoring System
## 2 Related Work on Internet of Things (IoT) Beehive Incident Response and Management Systems
### IBSMC Services and Services Functionality  
The Information System (ISMCA) user interface is a web-based apiary management portal. Its implementation is based on PHP and JavaScript open source software frameworks [55; 56]. The ISMCA application server will include a database service [57], for the purpose of recording the environmental conditions and the events of the beekeeping hives per apiarist/farmer. The information system services interact with each farmer individually thought a mobile phone application (Android application). The hive array location coordinates are manually uploaded by the apiarists to the ISMCA system through the mobile phone application. Additionally, the ISMCA system includes a statistical trends module, to display statistics per array such as daily, weekly, monthly and yearly averages and trends of use of the array subsystems, average hive energy consumption, and number-type of alerts over time. The ISMCA system also interfaces with Internet weather and weather forecasting sources from the WunderGround registered meteorological stations using the weather API [58], so as to obtain relevant information through the meteorological records service and offer predictions to the farmers in terms of push notification messages to their mobile phone applications (in relation to the uploaded GPS coordinates of their beehive array placement). The basic services provided to the farmer by the Information System (ISMCA) are the following:  
1. Management of farmers, and their arrays, farmer-related information, productivity records placement into the map. 2. LoRaWAN service for the process of authenticating IBSMC LoRaWAN gateways and central hive LoRaWAN class A nodes using OTAA authentication. Data recording component, an MQTT service [43], for receiving the telemetry push data of LoRaWAN gateways, decoding the MQTT JSON payload and encoding it into postgreSQL table records. 4. An HTTP ReST GET/PUT interface is used for the data exchange between ISMCA postgreSQL recorded data and the farmers' mobile phone application for read/write requests accordingly. The farmer can issue a subsystem control command for a specific hive ID, followed with a unique key ID, using HTTP PUT write request translated to a resource value change of the specified hive array resource. Similarly, for temperature, humidity measurements and actuators status acquisition per array, or beehive, HTTP GET requests are issued using a format similar to that in Reference [59], that includes a key attribute and a hive ID attribute. Then, the ISMCA responds with JSON-encoded measurements of all beehives included in that specific array. 5. Asynchronous database resource requests are triggered by notifications delivered by a CoAP UDP-based service [60; 61; 44], in which each array hives and each one of the hives subsystems and attributes (values) are resource-registered (thermo-pad, peltier and humidity actuators). The LoRaWAN Gateways are connected to the CoAP service using python agents per array and CoAP observes the resource changes, issuing an additional JSON payload frame transmitted to the array's central hive as a payload response at a LoRaWAN class A RX1 or RX2 window [33]. CoAP sensory data are continuously synchronized with the postgreSQL database in order for the farmer's mobile phone to successfully perform HTTP data reads or writes. 6. Notifications and alerts service and logic, which is responsible for sending notifications, alerts and messages in respect to beehive conditions and array security incidents, as indicated by the push data records. The notifications and alerts service utilize the Firebase engine push notifications API to trigger asynchronous notifications to the farmers' mobile phone [62]. 7. Personalized weather forecasting module-service notification and text messaging capabilities via the WunderGround API [58] and text messaging using the Firebase SDK [62].