Tag Archives: BACnet

Wacnet – Making the jump to hardware

PCs are everywhere. Except when you need one.

I’ve recently released an open source BACnet webserver and toolkit onto this world. As with my traditional naivety, I was saying:

“It’s really simple! You just have to take any PC that you have available and make sure it’s never turned off.”

The response I got from many of my customers was underwhelming to say the least.

Well, turns out PCs are kind of a hard thing to get for some building managers. They can’t just take an old PC laying in a storage bin… many need to contact their IT department, ask the permission to get a PC and get someone to install and configure it. This often also means a new windows licence, new login/password for the machine… in short, it’s a pain.

In search of cheap computers

I decided to take matters into my own hands and to install Wacnet on the smallest machine I could get my hands on. This way, I might be able to sell small computers to my customers for a fraction of the cost of using one already owned by them. (This statement alone is mind boggling… it might be cheaper to buy new than to re-use something you already own if you must go thought all administrative hoops.)

First I was thinking about small netbooks. About 2 years ago, I was able to get a brand new one for around $300. Surely now they would be cheaper!

Wrong. Instead, the market shifted towards tablet with a nice little mean price of $500. Not really what I wanted.

The sad thing about tablets is also how hard it can be to tinker with them. Especially those without USB ports.

Almost dedicated hardware

A little saddened by this market shift, I decided to take a look to the Raspberry Pi and alike. In short, all the ARM based miniature PCs.

Not only was I able to install Wacnet with minimum hassle, I was also able to configure a linux distro to boot quickly and start Wacnet immediately.

For the user, this means no more installation necessary and no more shell script or batch file to start the application automatically.

You plug the power on the mini PC, and Wacnet starts! Magic!

I’ve effectively turned this mini PC into a (almost) dedicated hardware.

Behold, the mini PC I’m currently using:


MK802 picture shamelessly taken from http://pakitong.blogspot.ca/

While this is known as the MK802 Allwinner A10 Mini PC, Wacnet should be able to run on all the devices based on the same architecture.

A complete plug and play BACnet webserver for a fraction of the price of some thermostats? Count me in!

Introducing Wacnet: a BACnet Webserver

Here it is! A free open source BACnet webserver to help everyone with their BACnet networks!

  • Run without any installation;
  • Can run directly from a USB flash drive;
  • No licence or limit on the number of BACnet objects;


The purpose of BACnet is to provide interoperability between devices from multiple manufacturers.

The idea is that if all devices speak the same language, no one will be ‘trapped’ with a proprietary protocol, forcing him to always buy at the same place.

This common language also have other advantages, such as making it easy to gather data and make advanced analysis. Simply checking the historical data plotted on a graph is enough to find and solve most problem.

However, despite all BACnet’s promises, the landscape is still mostly occupied by a handful of manufacturers.

In addition, BACnet is pitched as an ‘open protocol’, but the standards need to be ordered; even bacnet.org doesn’t provide a link to download the specs. This isn’t making it easy for newcomers. Want to see and try BACnet? Well, send us money and we’ll send you a boring pdf, and maybe, maybe you will stick with us.

For the developers, there’s some highly cryptic application that will provide some support, but for the newcomer that’s simply counterproductive to even try them.

This results in an horrible situations for the users. Building managers are often clueless as to what to do with a BACnet network. They don’t know what’s in it, nor do they know how to browse it. (Of course manufacturers will offer their own software… for a price.) There’s nothing wrong with selling software, but for such a basic need, browsing the network, a free software should be available. It’s like comparing Notepad and Word. Sure, sell Word, but the user should at least be able to write basic stuff in notepad.

Wacnet is a humble try to ameliorate the situation. By enabling an easy and almost instantaneous setup, anyone can at least see what’s on the network. Newcomers can explore the different properties and learn them.


Getting the application

If you know Clojure, download the source and do lein uberjar.

If you do not, download the pre-packaged version at https://bacnethelp.com/how-to/wacnet.

Running the application

No installation necessary and can run from a USB key!

The standalone jar file can be started on any computer with Java installed. We recommend starting it from the command line as such:

 java -jar <filename>

For example:

 java -jar wacnet-0.1.1-BETA-standalone.jar

You can of course start it by simply double-clicking on the .jar file, but you might have a hard time finding the ‘off’ switch. (You will have to manually kill it.)

Once the application is started, go to http://localhost:47800 and browse your network!

Advanced usage (REPL)

The REPL is an interactive evaluation environment to enable power users to use tools tailored to their needs. If a feature is lacking, it’s even possible to add it on-the-fly!

Why Every HVAC System Is Oversized (And How To Rectify This)

The revelation

At university, I learned something so groundbreaking, so vitally important, that in retrospect I should have known it all along…

From first grade, we learn incrementally complexer math. From addition and multiplication, to calculus and imaginary numbers (such as square-root of -1).


Wait, you mean by hand?

The assumption that one develops in such an environment is that everything must require complex math… which isn’t the case. The revelation I had was the following: What is hard isn’t the math, not at all. What is hard is to get the data!

This is especially true in the HVAC world. My god are those equations easy! You can easily fit them in a spreadsheet and you are good to go. But how do you know exactly what heating power will be needed? Unless you have the data, you won’t be able to do more than an educated guess.

The Car Analogy

Let’s imagine a map with a Start location, and a Destination location. You know where you are, you know where you are going, but you have some important data missing: you don’t know how you will get there. Will the road be a straight line, or will there many detours?


You must guess how much gas you need. There’s no way to know which road is available.

Furthermore, you have to fill your gas tank before you start your journey and you won’t be able to fill it en route.

What’s the value of the dashboard’s fuel consumption under these circumstances? What is this ‘equation’ worth? Without the distance, it’s worthless.

You have to guess how much gas you’ll need. You can’t underestimate, because you will then be stranded in the middle of nowhere. So you have to make an educated guess, based on your past experience on the road. You will also add a little incertitude bias, just to be sure you will make it.

Thus, under normal circumstances, you will always have some gas remaining in your tank when you reach your destination. In addition, this gas will cost you more money upfront, and will add to the total vehicle weight, consequently making it burn more fuel. Physics’s a bitch.

Back to HVAC

It’s the same thing with any HVAC component. Suppose you need a boiler for a new school. What size should it be? Engineering firms can guesstimate, but they will also add a little extra, just to be sure. To a certain extend, you can control an oversized boiler to keep the temperature comfortable, but if the boiler is too small, no amount of control will allow you to reach your temperature setpoint.


When is ‘big’ too big?

As with the car, you need to overestimate. Unfortunately, a bigger boiler means an additional upfront cost. Bigger components also means higher operational costs.

You have BACnet? Use it!

All of this, of course, is the consequence of not having enough data! Without data, math equations are worthless.

It’s ALL about data. Let me make this clear: data data data data data.

Hopefully, building owners and engineering firms will tap into the torrent of data the BACnet protocol can offer them.

Building a new installation similar to another one? (Engineering firms love to copy-paste) Check the original installation! Boiler is cycling? Too big!

Same thing for renovation: You want to install a shiny new heat pump in an existing building? Well now you have data on a silver plate! Instead of guessing what is required, you can actually know it.

There you have it. Until the industry starts to seriously use the available data, HVAC systems will be oversized. Not because someone is lazy, but because without data, oversizing is a necessity!

Geothermal and heat pump controls

How heat pump works

Heat pumps are quite different from other heating devices: contrary to them, the heat they produce is a by-product, rather than the main heat source.

Take an electric heater for example. It consumes electricity to produce heat directly. A heat pump will use this electricity to move the heat from a place to another. What’s the difference? Well it turns out that it’s cheaper to move heat than to create it. For the same amount of electricity required to produce 1kW of heat, you could move 7kW. (Of course this can vary greatly depending on a variety of factors.)


A heat pump takes heat from a place and move it to another (thus there’s always a hot side and a cold side)

If I were to put in sentimental terms, I would say that using electricity to produce heat is one of the stupidest and wasteful way to use electricity. Moving heat is far more intelligent.

Heat pump controls

Transferring heat from one place to another requires some work. The bigger the temperature difference between the two places, the more work it requires.

You could see it as moving dirt using a wheelbarrow. The temperature difference in this case would be the height difference. To take heat (wheelbarrow) from a cold place (low ground), you would have to push it to the hot place (high hill). The hotter the destination, the higher the hill.

Knowing this, to expand the least amount of energy possible, you would want to find the lowest possible hill to dump your dirt. In other words, you want your heat pump to work at a minimum temperature differential.


To accelerate heat transfer however, you must increase the temperature difference. The heat transfer is proportional to the temperature differential squared. This means that in order to keep a room warm in the cold months of winter, you might have to increase your heater set point to a higher temperature.

Let’s sum this up in those 2 following points:

  1. For optimal efficiency, always seek the lowest temperature differential;
  2. To increase heat transfer, you have to increase the temperature differential.

Thus, we can see that the optimal way to control a heat pump is to always try to use the lowest temperature differential, and only increase it when necessary to enable a bigger heat transfer.

If we were to follow this rule and to plot it compared to the exterior temperature, this is what we would get:


The optimal heat pump set point should look like a mirror image of the exterior temperature

As you can see, the lower the exterior temperature, the higher the heat pump set point (to increase the heat exchange between the heat coils and the room air). But as soon as the exterior temperature rises, we lower the heat pump temperature set point.

The cold, hard, real world

Unfortunately, an optimal control is often supposed when salesman and engineers push for heat pumps, but is rarely applied once the machine is installed.

In the snowy french world of Québec, Canada, electricity is a province matter and is heavily subsidized. Even if ‘burning’ electricity directly to create heat is the dumbest way to use electricity, it’s often cheaper than to invest heavily in other solutions.

To patch this problem, the government created some ‘energy efficiency programs’. Geothermal energy and heat pumps can become a wise investment with these, but all estimates always assume an optimum heat pump control. And why shouldn’t they? If you buy a manual transmission car, everyone assumes you are going to shift gears when the time comes.

Alas, this is not the real world. Once installed, these systems are often tuned to ‘work’ and that’s it.

I’ve recently monitored a geothermal installation that reminded me of this cold hard fact. Here is what the heat pump set point looks like:


An actual heat pump set point compared to the exterior temperature

Does this looks like a mirror image? No, it looks like a single set point for every exterior temperature. If this set point is enough for the worse case exterior temperature (-30°C perhaps?), then it’s overkill for everything else. -20°C and still the same set point? You have a needlessly big temperature differential and are thus using the heat pump in a less efficient manner.

What does it mean? Plainly, money is wasted. Remember the manual car analogy? Here the car is always in the first gear, regardless of its speed. Will the car go forward? Sure! Will you burn more fuel? Yup!

The sad part of this is that everything is in place to use it efficiently. No need to buy or replace components. Only how this system is used should be changed. This could be rectified with some lines of code… Meanwhile, electricity is wasted and money lost.

Yet another reason why everyone with a BACnet network should do everything in their power to have historical data: to spot any easy-to-change costly behaviours.

What is BACnet? A video experience

A quick and dirty explanation of what is BACnet

You now have the chance to enjoy my beautiful voice, along with my strong (and hopefully sexy) french accent.

In my opinion, the most important part of BACnet is how it opens up a whole lot of possibilities by giving access to all these sweet sensors. It’s not for nothing that I’m actively archiving gigabytes of data from various HVAC systems…

I say in this video that BACnet offers a way to free the building owners. It does, but mostly for updrades. As I’ve already mentioned, vendors can still inflict a non-negligible switch cost with their proprietary programming language. Vendors might do this totally unwillingly, but the burden is still there and must be paid.

I had a discussion recently with fellow BACneteers about this very subject. Many possible solutions are currently studied. I might summarize it on my mailing list… Meanwhile let’s just say that the statu quo might not persist.

My Video experience

I spent way too much time doing this video… at least for what I consider to be a so-so result. The next time I’ll try to jack up the audio a little, so that my voice is loud and clear.

I could also slack on the drawing board. The effect is nice, but boy is it time consuming! Each drawings must be accelerated ~8 times to have an interesting look. This means that if I want 2 minutes of doodling, I must do it for 16 minutes! That’s if I have everything right the first time (which I didn’t). Another downside of the drawings is to make sure the audio is in sync. Here again, that was quite long.

Next time I might give a try to screen capture. I have a tutorial to do… and as everyone who has written a tutorial before knows, nobody RTFM. A video might be what it takes to capture the attention.

The Importance of Data Visualization

As I’ve mentioned in previous post, I’m working on bacnethelp.com, a website dedicated to help those with a BACnet network.

The current main service is about recording the state of the network for future consultation. If you don’t really know what is a BACnet network, let’s just say that this service is comparable to recording the life signs of an individual, but for buildings. You can then see how it reacted to various stimuli, or even if it’s still alive.

However obtaining the data is only a small part of the work. The biggest part is giving it meaning. “Does the temperature changed because someone opened the window? Is this because my boiler is out of fuel?” One should seek to maximize the speed at which he can troubleshoot.

Here is a minuscule example of what a raw trend log can look like:

{:value "1159.0", :time "2009-03-02T15:45:00.000-05:00"} 
{:value "1160.0", :time "2009-03-02T16:00:00.000-05:00"} 
{:value "1161.0", :time "2009-03-02T16:15:00.000-05:00"} 
{:value "1162.0", :time "2009-03-02T16:30:00.000-05:00"} 

Quite dry isn’t it? Obviously this is not to be used directly.

Now look at how everything is instantly easier when you can see it in a graphical form.


Overview of multiple analog objects – bacnethelp.com

Oh my! If I had a something not working in there, I can almost guarantee it’s the first one. Did I look at the numbers? Nope, the simple shape of the graph was enough.

Of course, any children could tell you that. But why is it easier to use a graph than numeric data?

Let’s say you are looking at the number “3”. In reality your are seeing a particular shape on your screen. Your brain must then analyze it step by step to realize it is indeed the number “3”. In order, the steps taken:

  • Shape
  • Analyze
  • Realize

We shall call it the mental process.

What if you had to make a relation between many numbers? Say for example that you want to determine if a series of 20 numbers is exponential. Well now it gets more complicated, because with the realization of numbers, you will probably try to draw a graph in your head. Once you can visualize it, you will analyze it.

  • Shape
  • Analyze
  • Realize (multiplied by the 20 characters)
  • Visualize shape
  • Analyze
  • Realize

Even if we suppose that that the visualization part is effortless, we still have a total of 21 mental processes. And that’s only for 20 numbers.

If a computer were to draw the series for you, you would only be seeing a shape.

  • Shape
  • Analyze
  • Realize

A single mental process, versus 21 for the raw data. The visualization tools offers the possibilities of simplifying the data back to a single mental process regardless of the data size. The more data you have, the more the advantageous this becomes.

The same principle applies if I were to compare multiple graphs. Instead of having the previous 4 individual graphs, it could be easier to find relations by merging them together. Once again, this reduce the work our brain have to do.


Comparison of multiple analog objects – bacnethelp.com

This video (at around 2m40s) really shows the difference between the data merely ‘dumped’, versus a carefully designed representation. You will see that even if the data is the same, the difference for the user is staggering.

BACnet lock-in and the program object (16)

The BACnet marketing

You are in the HVAC business and trying to sell some BACnet devices. How will you market your product? Well, you’ll probably talk about how this protocol protect the user from being victim of a vendor lock-in.

Switching manufacturer

How wonderful! You can tell the customer how easy it will be for him to switch to another company if you ever let him down! But will it be so easy? Besides the various BACnet variants that might be a compatibility problem, what could be a kick in the teeth? Let’s make a quick check list of what you need in order to perform a vendor transfer:

  • Access to the controller I/Os? Yes;
  • Access the trend logs? Yes;
  • Access to alarms? Yes;
  • Access to the programs? NO!

Wait what? So the user can access every I/Os in the building, but can’t change his system behaviour. So, besides monitoring, what can he do?

“Sure, you can reprogram your controllers, but you’ll need to use our closed source interface application in order to change anything in your programs. We will gladly let you buy one for the modest amount of <insert stupid locked-in price>$ and your soul for eternity.”

This, my friends, is a lock-in.

It is also the moral fight that the Free Software Foundation and the open source projects under the GNU licence are trying to win. You should not be a slave of your programs (nor should your clients).

Priority is power

Not only can’t the user change the programs, he is most likely to be unable to change the programs priorities. This means that even if the user were to try to do a tug of war with the existing controllers by adding a new one with a whole new program in it, the new commands could be completely ignored! If the old devices have higher priorities than your the new one, it’s game over!

Towards a BACnet language standard?

The obvious solution (but less obvious to implement) is to have a language standard which could be read and edited by everyone. Obviously I would go for a lisp-like language, because I think it’s easier to grasp for the everyman. Anyone who have done primary school mathematics can understand how the parentheses are evaluated.

A language standard, while possible, is highly unlikely. The amount of work and cooperation between the many manufacturers would be non-trivial to say the least. In addition, if the program standard was ill-designed, it could drag down the entire BACnet standard with it.

Plain text program

There is however one little change in the standard that could help greatly. What if the programs were plain text and accessible through the BACnet network? Then every workstation would be able to at least open the program and let the user study it. Bonus point if they can also modify it.

The Program object type defines a standardized object whose properties represent the externally visible characteristics of an application program. In this context, an application program is an abstract representation of a process within a BACnet Device, which is executing a particular body of instructions that act upon a particular collection of data structures. The logic that is embodied in these instructions and the form and content of these data structures are local matters. – BACnet Standard 135-2004

Instead of making the content of the programs “local matters”, it could be a property, such as the description.

I can understand how, when the BACnet draft was elaborated, the controllers couldn’t have hold the plain text version of their programs, but today there’s no excuse.

Towards a truly open solution!