# 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 asynchronous BSDP data frame transmission occurs when either a sensor value changes (1 \({}^{\circ}\)C temperature, 5% humidity), using a sensory probing period of 15 min or the MCU sets a state change to one of the hives actuating subsystems via the BACP protocol, or the MCU triggers an event via the BEP protocol. The event frames also occur asynchronously when a security sensor status change is indicated by the MCU. Upon each BSDP data transmission, the transponder is set to a receive state of 1-2 s in order to receive any control frames from the central hive and then the MCU sets its transponder unit to sleep state, until the next asynchronous BSDP interval/trigger or BEP transmission trigger. **Type 2: Communication between the central beehive and the LoRaWAN gateway**. The central hive transmits data information received from the cells using JSON encoded payload. That is, each data frame received from each cell will be a separate LoRaWAN data frame set for transmission. LoRaWAN technology is a new low-power media access control (MAC) and physical layer protocol for wide area networks that allows small data rates (from 250 bps up to 5.5 Kbps at 863-870 MHz ISM band [35; 36]) to be transmitted over long distances (7-12 km) [30; 37; 3]. In case of BSDP protocol periodic phase, a single LoRaWAN frame is transmitted containing mean measurements values of all received BSDP frames of the array. In cases of BSDP protocol asynchronous transmissions and BEP transmission, each frame is separately forwarded via LoRaWAN. The LoRaWAN frame is then base64 encoded and transmitted to the closest gateway. In case of repeated beehive cell transmissions from the same beehive (BEP protocol - BSDP asynchronous protocol) at the central beehive cell, only the last received record is transmitted while the others are discarded (wait time interval). LoRaWAN header is at least 13 Bytes long (MHDR (1) + DevAddr (4) + FCtrl (1) + FCnt (2) + Fport (1) + MIC (4)) [30]. LoRaWAN maximum frame size is set up to 45 Bytes in order for the LoRaWAN gateway to operate in the edge of SF12 mode (maximum payload for SF12, 50 Bytes, SF7, 220 Bytes) [30; 53]. The maximum LoRaWAN forwarding frame is the BSDPprotocol forwarding frame that includes a 4 Byte application ID unique for each beehive array, the 1 Byte Hive ID value identifying each beehive cell expanded to a 4 Byte value and 4 Byte values for each measurement (external-internal temperature humidity and sound/weight sensor and one 4 Byte for thermopad, peltier and humidity actuators). The minimum LoRaWAN forwarding frame is the BEP protocol that includes a payload size of 12 Bytes: A 4 Byte event ID (2-Byte event ID expanded to 4 Bytes), 4 Byte have ID and 4 Byte application ID. BACP protocol frames are received by the central hive cell in LoRaWan RX window 1 or 2 (1-2 s) and their payload includes 16 Bytes, 4 Bytes assigned for each actuator value (thermopad, peltier, humidity, sound/weight sensor). The LoRaWAN scalability parameter is controlled with the over-the-air duty cycle parameter which is EU limited to 1% for all 868 MHz frequencies, leaving a maximum node data transmission time of 36 s per hour, and a minimum payload of 59 Bytes at SF7 [30; 53; 54]. Prior to data transmission, the central cell node authenticates with the gateway using the over-the-air activation method (OTAA) and the data transmission follows the class A transmission mode. The LoRaWAN payloads used are of three types: 1. The first payload type is the BSDP data forward frame payload and includes the application ID, hive ID, measurements of a cell temperature, humidity, sound/weight and heat, peltier and humidity actuators state. 2. The second payload type is the alert incidents BEP payload which includes application and hive ID fields and the corresponding hive alert ID. 3. The third payload type is the control payload coming from the gateway to the cell and refers to a specific hive (hive ID). This payload is sent back during a class A RX1 or RX2 window.