This article is based on FOSS (Free or Open Source Software) BACnet Stack found at SourceForge.

If you have googled for “free bacnet source code” and found Steve Karg’s 5-star BACnet project on sourceforge.net, congratulations. If not, welcome, you are in for an illuminating introduction to the project.

This article describes in very simple steps how to prepare a standard linux system and compile and test the BACnet Server demo that is included in Steve’s stack (let’s just call it “The Stack” from now on).

The examples provided work on Ubuntu, as well as the “Windows Linux Subsystem” provided by Microsoft (!) with Windows 10. Furthermore I am going to assume that you have minimal linux experience and so I will start describing the required steps from scratch. So without further ado, here goes:

Make sure you have the necessary linux tools. To do so, install the gcc compiler as well as subversion source code version control system.

sudo apt-get install -y build-essential

(“sudo” for those not in the know, allows elevated permissions that are required to install new tools in linux, you will have to provide a password to authenticate the first time you run this).

sudo apt-get install subversion

Now that the minimal toolset is installed, obtain the source code, using subversion, directly from the repository on sourceforge. Running the following command line will actually pick a subset of the stack from the full repo, but rest assured it is a very useful subset. The source tree will be installed into a subdirecory that is named by the final parameter on the command line, in this case “bacdemo”

svn checkout svn://svn.code.sf.net/p/bacnet/code/trunk/bacnet-stack bacdemo

The screenshot below shows the final result of the quite lengthly download of the source tree.

Then, the stack has to be built.

cd bacdemo

make

The resulting compile will create many examples of bacnet tools and utilities, for example, BACnet clients such as “readproperty”. These will be discussed fully in a later article. Once again, just the trailing screenshot of the result..

Now, remember, out of the multitude of compiled executable programs, we are interested in the BACnet Server demo program. This can be run by simply typing:

demo/server/bacserv

Believe it or not, that results in a running BACnet server on your PC. There are a few issues that we will cover in another article regarding IP configuration parameters, but for now, the following screenshot shows the running server

And to confirm that this is running as expected, we need to go to a BACnet Client ON ANOTHER COMPUTER and run one of the available BACnet Client tools and discover this BACnet Server. The example below shows our BACnet Test Client displaying the discovered BACnet Server and BACnet Objects in that BACnet Server. This tool can be obtained from https://www.bac-test.com/bacnet-test-client-download/

If

That is it ! If you have any questions, please feel free to contact me at info@bac-test.com

Ed