# 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 Communication Protocols
The beehive array incidents (alerts-notifications) are transmitted using the RF beehive events protocol (BEP). This is an interrupt-driven protocol that wakes the beehive MCU from its sleep state or interrupts its current sensory data transmission state, similar to the RF Tania AHA (Ad-Hoc Alerts Protocol, Tania-AHA) protocol [52]. The incidents protocol uses acknowledged frames, and when it is triggered, due to an alert or a control signal set by the central hive, a sensory data transmission is forced to follow. In depth, type 1 beehive application protocols encapsulated inside a JeeLab frame, shown in Figure 3, are the following:  
**Beehive Sensory Data Protocol (BSDP):** This protocol frames layout is presented in Figure 3 and includes a 1 Byte packet ID sequence number, a 1 Byte hive node ID followed by a 1 Byte payload length field. Then, the measurements of temperature, humidity and hive actuator subsystems state values follow, then the alert event field if any of the security sensors (magnetic reed or gyroscopic) current alert status with alert codes for open lid, open-closed lid, gyroscopic left right movement, gyroscopic up down movement, etc. (default value is zero) and finally, transmission time expressed using the microcontroller millisecond (ms) counter (4 Bytes). The sound/weight 8 bit sensor value is an additional optional field that is transmitted if the beehive cell includes  
Figure 3: Beehive RF protocols format layout, used for beehives sensory data transmissions, events and control signals to/from the central beehive. either an external weight scale or an internal sound sensor. Both values are calculated from the 10 bit A2D MCU interface followed by a 10 bit to an 8 bit value reduction. BSDP protocol transmissions are performed asynchronously (at least one transmission every 1 or 2 h) and without frame acknowledgments, unless a notification or an alert event occurred. Then BSDP protocol acknowledged transmission is requested. In that case, the BSDP ACK frame format is similar to the BEP frame (see Figure 3), without the event-ID and transmission time fields. * **Beehive Events Protocol (BEP):** This protocol frames include the 1 Byte beehive cell ID, 1 Byte sequence number, the triggered notification or alert ID (event ID-2 Bytes) and the transmission time the first time the event was triggered. BEP protocol-transited frames to the central hive must be acknowledged with a BEP ACK frame that uses the same format with the BEP frame without the transmission time field. BEP protocol transmissions are always followed by an acknowledged BSDP transmission (Jeelabs frame A bit value equal to 1 and C = 0). ACK frames of BEP and BSDP protocols have in their Jeelab header the ACK value A = 0 and C = 1. * **Beehive Actuators Control Protocol (BACP):** Control protocol frames are sent from the beehives to the central hive and include control operation changes on their actuator states. That is, the thermopad, peltier or humidity actuators. Apart from its internal MCU actuator logic, such dynamic actuator state changes are signaled by the cloud ISMCA control service and enforce a common state for all the beehives of an array. The control frames format is presented in Figure 3 and includes the Hive ID, the sequence number and the three actuator fields setting all bits to one to the fields that do not require a state change and to the fields that require a state change in the new state. Control frames are broadcast frames and use the Jeelab header D = 0 option (node ID is the source and included as destination is the common node ID used in all beehive cells) at the JeeLab header frame. Since the MAC protocol logic includes a CSMA/CA mechanism with a random back off timer of at least 25-30 ms [50], the BSDP frames transmission and ACK reception duration is no more than 2 s. In case of an occupied channel due to transmission, the carrier sends a busy indication. The transponders that reach to a busy carrier back off their transmission with a random integer value, set in ms.