You are currently viewing a new version of our website. To view the old version click .
Sensors
  • Communication
  • Open Access

13 January 2021

BACnet Application Layer over Bluetooth—Implementation and Validation

and
1
Faculty of Electrical Engineering and Computer Science, Stefan cel Mare University of Suceava, 720229 Suceava, Romania
2
MANSiD Integrated Center, Stefan cel Mare University, 720229 Suceava, Romania
*
Authors to whom correspondence should be addressed.
This article belongs to the Special Issue Sensors and Real Time Systems for IIoT

Abstract

The development of the smart building concept and building automation field is based on the exponential evolution of monitoring and control technologies. Residents of the smart building must interact with the monitoring and control system. A widely used method is specific applications executed on smartphones, tablets, and PCs with Bluetooth connection to the building control system. At this time, smartphones are increasingly used in everyday life for payments, reading newspapers, monitoring activity, and interacting with smart homes. The devices used to build the control system are interconnected through a specific network, one of the most widespread being the Building Automation and Control Network (BACnet) network. Here, we propose the use of the BACnet Application Layer over Bluetooth. We present a proposal of a concept and a practical implementation that can be used to test and validate the operation of the BACnet Application Layer over Bluetooth.

1. Introduction

The smart buildings [1] concept is nowadays becoming more popular. The aim of smart buildings is to improve the comfort of the residents in their daily life. This is possible by using gadgets that can assist residents in daily activities, such as controlling and monitoring the lighting system, heating system, utility consumption, etc. In order to respond to this desideratum, it is necessary to integrate monitoring and control systems [2] in the buildings or houses. These systems are known as Building Automation Systems (BASs). BAS systems offer various facilities for interaction with the resident people. In addition to these facilities, Internet of Things (IoT) [3,4] platforms can be developed in order to enable the interaction between people and these monitoring and control systems in a virtual environment. The monitoring and control devices used in smart homes are interconnected throughout communication networks (fieldbuses) based on standardized protocols [5], such as Building Automation and Control Networks (BACnets) [6], LonWorks [5], Modbus [7], and EIB/KNX [8]. The use of these standardized communication networks ensures interoperability between devices provided by different manufacturers. In addition, hardware solutions are being developed to meet the requirements that these devices must comply with, such as predictable event response time [9]. Based on these communication systems, different building monitoring and control software systems can be developed by integrating a wide variety of communication middleware technologies such as the one presented in [10].
In addition, BAS systems that are integrated into smart buildings can be used to provide the support needed for the remote monitoring and/or the self-monitoring of patients with various chronic diseases [11]. At this time, there are multitudes of devices that can remotely monitor various medical parameters [12], methods for the automatic processing [13] of these parameters, and alarms triggering when anomalies are detected [14].
Recently, mobile devices represented by smartphones and tablets have experienced explosive development. They are optimized for more computing power at lower energy consumption and a lower price compared to desktop systems, in addition to their mobility function. Now, the number of these mobile devices has exceeded the number of personal computers [15,16]. Mobile devices, such as smartphones and tablets, are used in daily activities for payments, Internet banking, reading newspapers, etc. These devices have Wi-Fi and Bluetooth communication interfaces. They can also be used to monitor and control smart homes by connecting to the Building Automation System. We propose the use of the BACnet Application Layer over Bluetooth. In order to validate this concept, a test system is developed to demonstrate the functionality of the BACnet Application Layer over Bluetooth. This solution has the advantage that the connection to a BACnet network can be made from any computing device represented by smartphones, tablets, and personal computers.
The following sections are structured as follows: Section 2 contains a short presentation of the BACnet protocol. Section 3 presents BACnet gateways to other protocols presented in the specialized literature, and Section 4 presents the proposed concept related to the implementation of the BACnet Application Layer over Bluetooth. Section 5 presents a practical implementation of the proposed concept. Conclusions are drawn in Section 6.

2. BACnet

BACnet is a communication protocol [17] used in the development of smart homes or in building automation. BACnet is organized into four layers, as shown in Figure 1.
Figure 1. Layers of the Building Automation and Control Network (BACnet) protocol [17].
At the Application Layer, BACnet is object-oriented. A BACnet device is a collection of objects that contain device-specific features. At the moment, 60 types of objects are standardized [18], the most used types of objects being: Analog Input, Analog Output, Analog Value, Binary Input, Binary Output, Binary Value, Command, and Device. Each type of object has a set of properties such as identifier, name, type, and value. Each property is characterized by a data type and a conformance code that indicates whether the property is mandatory or optional. A BACnet device is characterized by a device object and may contain one, more, or none of the other object types.
The BACnet Data Link Layer organizes/segments data into frames or packets called Network Protocol Data Unit (NPDU) packets that are transmitted to lower levels. The maximum size of a NPDU is determined by the communication technology used at the physical layer. The lower layers are the Data Link and Physical Layers. As can be seen from Figure 1, at lower layers, we can have the following options: Logical Link Control and Ethernet, Logical Link Control and ARCNET, Master–Slave/Token-Passing (MS/TP) and EIA-485, Point-to-Point and EIA-232, and LonTalk.

5. Concept Implementation and Validation

In order to validate the proposed concept, we implemented a test system that aims to exemplify how communication is achieved at the BACnet Application Layer over Bluetooth. Since the functionality of the other layers of the BACnet model is similar to other communication protocols, it was chosen to focus on how it works at the Application Layer. The test system is divided into two components. The first component is a software application that is loaded on the STM32F4DISCOVERY development board for building a BACnet device and communication via Bluetooth using an HC-05 Bluetooth module. The second component is the graphical software application for PC that aims to highlight the functionality of the BACnet services via Bluetooth. The BACnet device implements one Device object and two Analog Input objects. The implemented services are the following: Who-Has, I-Have, Who-Is, I-am, ReadProperty, ReadPropertyConditional, ReadPropertyMultiple, WriteProperty, WritePropertyMultiple, AddListElement, RemoveListElement, CreateObject, and DeleteObject.
The first part of the test system is developed and implemented using the KEIL Microcontroller Development Kit (MDK) debugging and tracing environment. With the help of this toolset, a virtual BACnet device is created that contains three virtual objects: an object of the Device type and two objects of the Analog Input type. This application also takes into account the fact that the data will be transmitted using a serial port. For this reason, in the application, a software module is used that allows the selection of data according to the request received throughout the Universal Asynchronous Receiver/Transmitter (UART) port via the HC-05 Bluetooth module, the request that is transmitted from the graphics application. The second part of the test system is a graphical application developed to run on PCs with the Windows operating system. The main window of this application is shown in Figure 4.
Figure 4. The main window of the application executed on a PC.
As can be seen in Figure 4, the main window of the graphical application has a submenu that is disabled; the Segmentation option from the menu, which has the role to execute an interface that computes the number of segments; and the Close option from the menu, which closes the application. In the beginning, we presented the graphical interface of the application that communicates with the BACnet device implemented on the STM32F4DISCOVERY development board. In the first phase, from the Com option, by selecting the Search suboption, we must select a COM port because the Bluetooth device is seen by the PC as a virtual COM port. This virtual port is configured in the Bluetooth connection setup stage between the PC and the Bluetooth device. At this step, we know the COM port number associated with the BACnet device, and the next step is to select this port and select the Connect suboption from the Com option to activate the connection between the application and the BACnet device via Bluetooth wireless communication. If the steps are correctly followed, the window shown in Figure 5 will be obtained (the display box on the bottom left contains the message: “The connection was activated successfully.”).
Figure 5. The BACnet objects provided by the device.
Once we obtain the window shown in Figure 5, we can see that we have access to the LED option (to the LEDs) that allows us to turn on and turn off the LEDs on the development board. At the same time, we have access to the “BACnet Objects” option from the menu that, after accessing, will display objects available on the device BACnet, as shown in Figure 5. This option uses the Who-Has service in order to display all the objects of the BACnet device implemented on the STM32F4DISCOVERY development board.
At the same time, by selecting the “BACnet Objects” option, the board will indicate that this option was chosen by turning on the red and green LED, as can be seen in Figure 6.
Figure 6. The requests indicated by LEDs on the STM32F4DISCOVERY development board.
In order to view the properties of an object, the object to be analyzed must be selected from the selection list from the bottom left, according to Figure 5, followed by the selection of the “Object Details” option. If a selection is made that proves invalid, then a warning message will be displayed regarding the problem.
After selecting the object type and the specific option, a new window will appear showing the properties of the selected object as shown in Figure 7. Consequently, the properties of the objects within the BACnet device are obtained, which is essential for the protocol because this information is at the base of communication in a BACnet network. One of the properties is the value associated with the object. This exemplified the interaction between objects built on a BACnet device and services that create requests for information embedded in objects.
Figure 7. Details related to a BACnet object.
Furthermore, segmentation takes place at the Network Layer (Bluetooth from Figure 2), and in this sense, a computer was introduced in the application that has the role of determining the number of segments for a certain transmission technology and the information included in each segment. If we refer to the main window presented in Figure 4, we will notice that there is an option called Segmentation). After selecting this option, we will be allowed to choose the technology at the Data Link layer as it is exemplified in Figure 8. If no Data Link technology is selected, and if we want to open the segmentation window, then a warning message will be displayed.
Figure 8. Segmentation window.
In order to calculate the number of segments, it is absolutely necessary to enter the size of the Network Protocol Data Unit (NPDU), which has at least 2 bytes given by the segment header and the Identification (ID) from which the segment numbering starts. After entering this data, we can proceed to calculate the number of segments. Thus, for the Point-to-Point (Bluetooth) technology previously selected, and for an NPDU of 3000 bytes that has the ID of the first segment equal to one, a number of six segments were obtained (see Figure 9). As can be seen in Figure 9, segmentation is performed according to the Data Link technology used. Thus, in this case, the first 5 segments carry the maximum information given by 501 bytes, and in addition to the transported information, the segments are characterized by an ID and a Flag that takes the 0 value if the transmitted segment is the last.
Figure 9. Example of a segmentation operation.
The security vulnerabilities of the proposed solution are generated by Bluetooth communication. A detailed analysis of these security vulnerabilities is presented in [28]. To address these issues, Bluetooth communication is implemented in Security Mode 4 that uses the encrypted key exchange.

6. Conclusions

Herein, we proposed and tried to present the use and the utility of the BACnet Application Layer over Bluetooth. This can be performed by designing and developing a BACnet device with a Bluetooth connection or by implementing a gateway that connects to a classic BACnet network via Bluetooth. We proposed and validated a concept by implementing a BACnet device on the STM32F4DISCOVERY development board, which contains an HC-05 module for Bluetooth connection and a PC application that communicates with this module via Bluetooth, all being implemented at the BACnet Application Layer over Bluetooth. The proposed solution is convenient because most modern smartphones and tablets support Bluetooth communication, the main disadvantage being that Bluetooth allows point-to-point connection only. In fact, the purpose of the proposed solution is to allow access to the BACnet network for the visualization of the measured parameters (temperature, humidity, light intensity, energy consumption, etc.) and to transmit simple commands such as turning on/off the light and not to perform real-time control of the smart building.

Author Contributions

The authors contributed equally to this work. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the project “119722/Centru pentru transferul de cunoștințe către întreprinderi din domeniul ICT—CENTRIC—Contract subsidiar 15567/01.09.2020/DIW-PADCU/Fragar Trading”, contract no. 5/AXA 1/1.2.3/G/13.06.2018, cod SMIS 2014+ 119722 (ID P_40_305), using the infrastructure from the project “Integrated Center for research, development and innovation in Advanced Materials, Nanotechnologies, and Distributed Systems for fabrication and control”, contract no. 671/09.04.2015, Sectoral Operational Program for Increase of the Economic Competitiveness co-funded from the European Regional Development Fund.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

Data sharing not applicable.

Acknowledgments

The authors would like to thanks the editor and anonymous reviewers for our manuscript review.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Casado-Vara, R.; Canal-Alonso, A.; Del Rey, A.M.; De La Prieta, F.; Tejedor, J. Smart Buildings IoT Networks Accuracy Evolution Prediction to Improve Their Reliability Using a Lotka–Volterra Ecosystem Model. Sensors 2019, 19, 4642. [Google Scholar] [CrossRef]
  2. Froiz-Míguez, I.; Fernández-Caramés, T.M.; Fraga-Lamas, P.; Castedo, L. Design, Implementation and Practical Evaluation of an IoT Home Automation System for Fog Computing Applications Based on MQTT and ZigBee-WiFi Sensor Nodes. Sensors 2018, 18, 2660. [Google Scholar] [CrossRef]
  3. Gaitan, N.C.; Gaitan, V.G.; Ungurean, I. A Survey on the Internet of Things Software Arhitecture. Int. J. Adv. Comput. Sci. Appl. 2015, 6, 140–143. [Google Scholar] [CrossRef][Green Version]
  4. Dang, L.M.; Piran, J.; Han, D.; Min, K.; Moon, H. A Survey on Internet of Things and Cloud Computing for Healthcare. Electronics 2019, 8, 768. [Google Scholar] [CrossRef]
  5. Bhatt, J.; Verma, H. Design and Development of Wired Building Automation Systems. Energy Build. 2015, 103, 396–413. [Google Scholar] [CrossRef]
  6. Tang, S.; Shelden, D.R.; Eastman, C.M.; Pishdad-Bozorgi, P.; Gao, X. BIM assisted building automation system information exchange using BACnet and IFC. Automat. Constr. 2020, 110, 103049. [Google Scholar] [CrossRef]
  7. You, W.; Ge, H. Design and Implementation of Modbus Protocol for Intelligent Building Security. In Proceedings of the IEEE 19th International Conference on Communication Technology (ICCT), Xi’an, China, 16–19 October 2019; pp. 420–423. [Google Scholar] [CrossRef]
  8. Gecova, K.; Vala, D.; Slanina, Z.; Walendziuk, W. Air condition sensor on KNX network. In Proceedings of the SPIE-The International Society for Optical Engineering, Wilga, Poland, 7 August 2017; Volume 10445. [Google Scholar] [CrossRef]
  9. Gaitan, N.C.; Gaitan, V.G.; Moisuc, E. Improving Interrupt Handling in the nMPRA. In Proceedings of the 12th International Conference on Development and Application Systems (DAS), Suceava, Romania, 15–17 May 2014; pp. 11–15. [Google Scholar] [CrossRef]
  10. Ungurean, I.; Gaitan, N.C. Monitoring and control system for smart buildings based on OPC UA specifications. In Proceedings of the 13th International Conference Development and Application Systems (DAS), Suceava, Romania, 19–21 May 2016; pp. 82–85. [Google Scholar] [CrossRef]
  11. Majumder, S.; Aghayi, E.; Noferesti, M.; Memarzadeh-Tehran, H.; Mondal, T.K.; Pang, Z.; Deen, M.J. Smart Homes for Elderly Healthcare—Recent Advances and Research Challenges. Sensors 2017, 17, 2496. [Google Scholar] [CrossRef]
  12. Mardini, M.; Iraqi, Y.; Agoulmine, N. A Survey of Healthcare Monitoring Systems for Chronically Ill Patients and Elderly. J. Med. Syst. 2019, 43, 50. [Google Scholar] [CrossRef]
  13. Shuwandy, M.L.; Zaidan, B.B.; Zaidan, A.; Albahri, A.S. Sensor-Based mHealth Authentication for Real-Time Remote Healthcare Monitoring System: A Multilayer Systematic Review. J. Med. Syst. 2019, 43, 33. [Google Scholar] [CrossRef]
  14. Bhatia, H.; Panda, S.N.; Nagpal, D. Internet of Things and its Applications in Healthcare-A Survey. In Proceedings of the 8th International Conference on Reliability, Infocom Technologies and Optimization (Trends and Future Directions) (ICRITO), Noida, India, 4–5 June 2020; pp. 305–310. [Google Scholar] [CrossRef]
  15. Mobile Now Exceeds PC: The Biggest Shift since the Internet Began. Available online: https://www.searchenginewatch.com/2014/07/08/mobile-now-exceeds-pc-the-biggest-shift-since-the-internet-began/ (accessed on 15 December 2020).
  16. Desktop vs Mobile vs. Tablet Market Share Worldwide. Available online: https://gs.statcounter.com/platform-market-share/desktop-mobile-tablet (accessed on 15 October 2020).
  17. BACnetTM-A Standard Communication Infrastructure for Intelligent Buildings. Available online: http://www.bacnet.org/Bibliography/AIC-97/AIC1997.htm (accessed on 15 December 2020).
  18. ANSI/ASHRAE Standard 135-2016: BACnet A Data Communication Protocol for Building Automation and Control Networks. Available online: https://www.ashrae.org/technical-resources/bookstore/bacnet (accessed on 15 December 2020).
  19. Lopez, E.; Monteiro, J.; Carrasco, P.; Saenz, J.; Pinto, N.F.D.; Blazquez, G. Development, implementation and evaluation of a wireless sensor network and a web-based platform for the monitoring and management of a microgrid with renewable energy sources. In Proceedings of the International Conference on Smart Energy Systems and Technologies (SEST), Porto, Portugal, 9–11 September 2019; pp. 1–6. [Google Scholar] [CrossRef]
  20. Stamatescu, G.; Stamatescu, I.; Arghira, N.; Fagarasan, I. Cybersecurity Perspectives for Smart Building Automation Systems. In Proceedings of the 12th International Conference on Electronics, Computers and Artificial Intelligence (ECAI), Bucharest, Romania, 25–27 June 2020; pp. 1–5. [Google Scholar] [CrossRef]
  21. Hong, S.H.; Kim, S.H.; Kim, G.M.; Kim, H.L. Experimental evaluation of BZ-GW (BACnet-ZigBee smart grid gateway) for demand response in buildings. Energy 2014, 65, 62–70. [Google Scholar] [CrossRef]
  22. Li, Y.-C.; Hong, S.H. BACnet–EnOcean Smart Grid Gateway and its application to demand response in buildings. Energy Build. 2014, 78, 183–191. [Google Scholar] [CrossRef]
  23. Lan, M.; Yan, H. Research on Multi-protocol Parsing in Intelligent Buildings. In Proceedings of the IEEE 5th Information Technology and Mechatronics Engineering Conference (ITOEC), Chongqing, China, 12–14 June 2020; pp. 710–715. [Google Scholar] [CrossRef]
  24. Xie, J.; Gao, Q. Design and Implementation of Embedded Protocol Conversion Gateway for Intelligent Buildings. In Proceedings of the IEEE 10th International Conference on Software Engineering and Service Science (ICSESS), Beijing, China, 18–20 October 2019; pp. 1–5. [Google Scholar] [CrossRef]
  25. Raza, S.; Misra, P.; He, Z.; Voigt, T. Building the Internet of Things with bluetooth smart. Ad Hoc Netw. 2017, 57, 19–31. [Google Scholar] [CrossRef]
  26. Hayat, H.; Griffiths, T.; Brennan, D.A.; Lewis, R.P.; Barclay, M.; Weirman, C.; Philip, B.; Searle, J.R. The State-of-the-Art of Sensors and Environmental Monitoring Technologies in Buildings. Sensors 2019, 19, 3648. [Google Scholar] [CrossRef]
  27. Karthikeyan, P.; Sumanth, N.; Jude, S. Bluetooth based function control in a car. IOP Conf. Ser. Mater. Sci. Eng. 2017, 263, 42065. [Google Scholar] [CrossRef]
  28. Lonzetta, A.M.; Cope, P.; Campbell, J.; Mohd, B.J.; Hayajneh, T. Security Vulnerabilities in Bluetooth Technology as Used in IoT. J. Sens. Actuator Netw. 2018, 7, 28. [Google Scholar] [CrossRef]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.