Search code examples
c#.netbacnet

Bacnet/IP with .NET


I have a task where I need to understand the technical feasibility to setup a remote monitoring scenario for a HVAC solution which uses Bacnet/IP. I need to setup a .NET client that gets the telemetry and sends it to Azure IoT Hub. My current concern is to understand how can I connect to a Bacnet/IP network.

I don't have that much information about the hardware installed besides the fact that it has sensors for pressure and humidity on the network and a DDC controller (EBCON - Delta Controls). As I was told, I don't need to care about the actually sensors since they are sending the telemetry to the controller, so I only to care about the controller and connect to it.

Yet based on what I have read so far, I have some doubts about this information, but I don't have the technical knowledge to support it. It seems that based on the information that I have read Bacnet communication is done by UDP listening on a port (which seems to go against the above information that I need to connect to a controller), if this is true and I listen on a UDP port, will all devices broadcast the telemetry on the network and I only need to be listening? What is the controller role then? Can I ignore it?

Any explanation or pointers can could help me understand this from a programmer PoV would be appreciated.


Solution

  • BACnet does indeed communicate via UDP. The scenario you describe, while possible, is quite a dangerous approach. Very few BACnet products offer any sort of BACnet protocol security, so to make a secure connection you will need to VPN into your site. Once on the VPN, then the VPN itself will most likely block broadcasts, so you will need to use BACnet "Foreign Device Registration" to connect. However most VPNs do a NAT translation too, so the BACnet server on site will have to supply "BACnet BBMD with FD with NAT" support. Quite rare. An alternative is to get a box on your site supplying connectivity from the site to the Azure IoT site. There are a few companies that offer this type of product, but it seems you want to program your own. This will not be trivial, and then you will have to do the "BACnet Object" to "whatever-data-format-you-need-on-Azure" mapping, which will need a rather deep understanding of the BACnet specification, which, on paper, is about 2.5 inches thick. You could ignore the VPN approach, port forward port 47808 (BACnet default, but it can be different per site config) to the controller. This is how some rather large companies have had their HVAC systems hacked. If you do pursue this approach, you will still need a BACNet Client-to-Azure mapping/transfer agent. You have not chosen a trivial project here. ;) Or you could purchase an off-the-shelf product (box) that does this all already.