You are on page 1of 3

Full Technical Description

1.0 Project Overview

Put simply, the project is to facilitate the BMS of the facility operating with BACnet, to communicate with
LoRa devices.

For this purpose a LoRaWAN gateway is used to send the data to a cloud platform of choice. BACnet
packets must be read and replies should be sent according to the format understood by the BMS.
Otherwise, a proper format should be suggested. Number of nodes of the LoRa end is taken as ten for this
project and there must be room for expansion. Following is the suggested architecture for the project.

MQTT server

BACnet Protocol

MQTT client

The data from the LoRaWAN is published to the TTN or TTS. Then the MQTT option of the TTN/TTS can be
used to send the data via built-in MQTT server. Setting up the LoRa connection is straight forward. The
Python script developed for the application must communicate with LoRa section and keep the relevant
data ready for the BMS controller.

TTS community edition will be what we are going to focus on. However, TTN is also available, which is the
older version of TTS.

This way of implementation has its own advantages as there would be room for expansion from data
storage to visualization.
Additionally, data can be analyzed with python based tools. Further discussion of the project is broken
down into three sections.

1. MQTT Server / Client implementation section


2. BACnet communication section
3. Data exchanging between the two segments.

2.0 MQTT Server / client program with Python

TTN or TTS Community edition has the MQTT option available which would be useful for this
implementation. The data from the LoRa devices in TTN can be accessed with the built in MQTT server API,
while a python script can be developed to act as a MQTT client to obtain the data. So TTN/TTS can publish
messeges for the MQTT client.

This process can be presented as follows.

MQTT client with


Paho

MQTT
Server/Broker

Moreover, Paho from Eclipse Foundation is used as the base library for the MQTT program development.
This is a less complex approach and a reliable way of developing the program. Having said that, by using
the python approach, libraries such as Pandas, Numpy, Django or Streamlit can be utilized for further
development of the project.

For establishment of connection following is the data requested,

i. Host name
ii. Port (Usually 1883)
iii. Keep alive ( 60s)

After a connection is established a payload can be sent. The response can be published to a CSV or the
program memory as a data frame.

Overall, the MQTT approach can lead to a system with a scalable, low network bandwidth consumption,
and a very well-suited for remote sensing and control.
3.0 BACnet Communication between BMS and the Python Script

BACnet, short for “Building Automation Control Network”, is a data communication protocol for building
automation and control networks. There are two types of main BACnet network types,

i. BACnet/IP
ii. BACnet MS/TP (Master-Slave/Token Passing)

A BACnet message itself is independent of the MAC layer used to transport the message. Therefore, in
BACnet, messages to command or monitor information are the same, no matter which MAC layer used for
transport.

BACnet/IP is commonly used with existing Ethernet infrastructure.. Devices plug directly into Ethernet
switches. This is a fast and high performance type of LAN. BACnet/IP uses UDP/IP for compatibility with
existing IP infrastructure.

The BMS must have an option to connect to the PC as a BACnet device. To make a connection between
the BMS and the python script, the program must act as a client. Moreover, the client must also have all
the information collected from the LoRa devices via TTN. This means, we have to build a virtual BACnet
client for the controller. This is done by the BACØ python library.

BACnet client based on the BACØ python library

The client can be developed into an interface so that the values from the loRa devices can be viewed directly
from the client PC.

By integration of the two codes MQTT client and the BACnet client the required results can be obtained. So
basically LoRa device data obtained via MQTT is passed to the client via BACnet on request. The conversion of
data is done within the python code itself.

You might also like