Visit the BACnet website at Powered by Linux

BACnet for Linux


Open-Source BACnet Protocol ( stack for Linux.

This project's goal was to develop a complete implementation of the BACnet protocol for use by anyone who wishes to give their products BACnet communication capability. Note: This project is no longer active. See BACnet Stack at SourceForge for an active BACnet stack that runs on Linux.

Current Status

So, what does it currently do?

How do I use it?

First, download the source code.

Extract and build the project:

$ tar -xvzf bacnet4linux-0.0.0.tgz
$ cd bacnet
$ make clean all

Run the resulting executable file with some parameters:

$ ./bacnet4linux --help
BACnet4Linux - Version 0.3.10
An Open-Source BACnet Protocol stack for Linux.
Copyright (C) 2003 Greg Holloway
This is free software, and you are welcome
to redistribute it under certain conditions.

./bacnet4linux [options]
-c# BACnet COV support (0=disable,1=enable)
-C### BACnet COV lifetime (seconds)
-D# debug level, larger is more verbose (0-9)
-h### HTTP server port (0-65534)
-I### Number of concurrent queries (invoke ids)
-q### Initial query delay (seconds, 0=disable query)
-rfilename Initialize device database from XML 'filename'
-s### BACnet Sync Time Periodic (seconds,0=disabled)
-wfilename Write device database to XML 'filename'
-x###-### eXclude devices except range ### to ### (multiple -x's OK)
-d### BACnet device instance number (0-4194303)
-e# BACnet Ethernet (0=disable,1=enable)
-iname BACnet Ethernet interface name (eth0, eth1, etc.)
-m### BACnet MS/TP port number (0-65534)
-p### BACnet/IP UDP port number (0=disabled,1-65534,0xBAC0)
-t### BACnet APDU timeout (seconds)
-v### BACnet Vendor Identifier (0-65534)
-V Returns the version information
default settings:
-c1 -C300 -D1 -h8000 -I1 -q5 -s0
-d2 -e1 -ieth0 -m0 -p0 -t10 -v6

Well, that was neat, but you probably want to make bacnet4linux do some real work. Run the code without parameters:

$ ./bacnet4linux
0.193: BACnet4Linux Version 0.3.10
0.194: ethernet.c:82: ethernet: Not being run as root, so an 802.2 socket is impossible.

Well, it does need root priveleges to do BACnet/Ethernet, so run it under root or with sudo (see the sudo man pages for more details about sudo). Use CTRL-C to stop it (or send it a kill from another console session).

$ sudo ./bacnet4linux
0.392: BACnet4Linux Version 0.3.10

Impressive, no? Well, to see it really working, use a browser and browse http://localhost:8000/ if you have access to a browser on the machine that is running BACnet4Linux. If not, browse to the machine that is running BACnet4Linux on port 8000 (or another port specified by the -h command line parameter. You should see something like this.

BACnet4Linux also has a fair amount of debug information built into it. Use the -D parameter to control the amount of debug information.

$ sudo ./bacnet4linux -D4
0.392: BACnet4Linux Version 0.3.10
0.692: MAIN: Program built: 10:38:30 Jan 27 2005
0.692: MAIN: Configuration from command line parameters:
0.692: MAIN: Acting as BACnet Device: 2
0.692: MAIN: Vendor ID: 6
0.692: MAIN: APDU Timeout: 10 seconds
0.692: MAIN: 802.2 Ethernet interface: eth0 (enabled)
0.692: MAIN: Using BACnet/IP port: 0 (0x0)
0.692: MAIN: Using HTTP port: 8000
0.693: MAIN: COV Support: enabled

What needs to be done?

The following items have been started, but still require additional work to complete.

How can I help?

Our hope is that others can contribute to this project by adding in the parts that their application requires until the entire protocol has been implemented. Greg works with BACnet products daily and had an interest to learn the protocol more thoughly, which is why he started this a few years ago. Since then, others have expressed interest in helping, so he wanted to open this up to a larger audience.

The project is currently licensed under the LGPL.


Try out the current released code. CVS is setup so any additions or changes can be checked in, or the latest and greatest cutting edge code can be checked out. SourceForge has documentation about CVS, and this project name is bacnet4linux. The module names are bacnet, stable, and mstp.

See the BACnet4Linux Project Summary

To discuss this project, jump to the Discussion Forums

You can email Greg, at or Steve at if you have any questions or comments.

SourceForge Logo

Valid HTML 4.01!