NewLife.BACnet
1.1.2026.1024
dotnet add package NewLife.BACnet --version 1.1.2026.1024
NuGet\Install-Package NewLife.BACnet -Version 1.1.2026.1024
<PackageReference Include="NewLife.BACnet" Version="1.1.2026.1024" />
<PackageVersion Include="NewLife.BACnet" Version="1.1.2026.1024" />
<PackageReference Include="NewLife.BACnet" />
paket add NewLife.BACnet --version 1.1.2026.1024
#r "nuget: NewLife.BACnet, 1.1.2026.1024"
#:package NewLife.BACnet@1.1.2026.1024
#addin nuget:?package=NewLife.BACnet&version=1.1.2026.1024
#tool nuget:?package=NewLife.BACnet&version=1.1.2026.1024
NewLife.BACnet — BACnet Protocol
🌐 简体中文 | 繁體中文 | Español | Deutsch | 日本語 | Français | Português | Русский | 한국어 | العربية
A pure-managed BACnet protocol stack for .NET, built for building automation (HVAC, lighting, security and energy management). It implements complete BACnet/IP communication and integrates deeply with the NewLife IoT ecosystem.
BACnet (Building Automation and Control Networks) is the building automation network protocol defined by ASHRAE/ANSI 135 and ISO 16484-5. It is widely used in products from Johnson Controls, Honeywell, Siemens Building Technologies, Schneider Electric and other major vendors.
Source: https://github.com/NewLifeX/NewLife.BACnet
NuGet: NewLife.BACnet | Target frameworks: netstandard2.0 + net45
Highlights
| Capability | Description |
|---|---|
| Transport | BACnet/IP (IPv4/IPv6) UDP transport, BBMD broadcast management and foreign-device registration |
| Protocol codec | Complete ASN.1 BER / APDU / NPDU / BVLC encoding and decoding |
| Device discovery | Automatic Who-Is broadcast discovery, directed unicast discovery, periodic rescans to detect online/offline changes |
| Property access | Single and batch property read/write, Priority Array write priority (1-16), per-device invoke-id isolation |
| COV notifications | Real-time property-change push instead of polling, with automatic subscription renewal |
| Events & alarms | End-to-end event notification, alarm summary and alarm acknowledgement |
| File services | AtomicReadFile / AtomicWriteFile for device configuration backup and restore |
| Object management | CreateObject / DeleteObject / AddListElement / RemoveListElement |
| BACnet server | Simulation server driven by an XML device description, accessible to third-party building systems |
| High-level client API | BacClient, a business-oriented API with string point addresses in "instance_type" form |
| Async API | Complete ReadPropertyAsync/WritePropertyAsync and other Async/Await methods |
| Secure transport | BACnet/SC (WebSocket + TLS) secure transport with Hub/Node and direct modes |
| Standard services | Who-Has/I-Have, time synchronization, device communication control and other standard BACnet services |
| Schedules | Schedule/Calendar data type codec (DailySchedule/SpecialEvent) |
| IoT driver integration | Implements the NewLife.IoT driver contracts and shares management with Modbus/Siemens drivers |
| Observability | ITracer APM tracing + ILog logging for end-to-end visibility |
| Pure managed | Zero native dependencies; runs on Windows / Linux / macOS / ARM |
Documentation
- Requirements — vision, core goals and functional requirements
- Feature list — implementation/test/comment status tracking (currently 90% complete)
- Architecture — five-layer architecture, components and key flows
- Competitive analysis — comparison matrix, gap analysis and strategic recommendations
Quick start
Install
dotnet add package NewLife.BACnet
Client: discover devices and read properties
using NewLife.BACnet.Protocols;
using NewLife.Log;
var client = new BacClient
{
Port = 0xBAC0, // default 47808
WaitingTime = 3000, // device response timeout (ms)
Log = XTrace.Log,
};
client.Open(); // broadcast Who-Is and block until the first device responds
foreach (var node in client.Nodes)
{
// Point address format "instance_type": "0_2" = AV[0]
var value = client.ReadProperty(node.Address, "0_2");
Console.WriteLine($"[{node.DeviceId}] AV[0] = {value}");
var results = client.ReadProperties(node.Address, new[] { "0_0", "0_2" });
foreach (var kv in results)
Console.WriteLine($" {kv.Key}: {kv.Value}");
}
client.Close();
Server: expose a BACnet device
using NewLife.BACnet.Protocols;
var server = new BacServer
{
DeviceId = 666,
StorageFile = "DeviceDescriptor.xml",
Port = 0xBAC0,
Log = XTrace.Log,
};
server.Open(); // start listening and broadcast I-Am to announce itself
IoT driver integration
using NewLife.BACnet.Drivers;
var driver = new BACnetDriver { Log = XTrace.Log };
var node = driver.Open(device, new BACnetParameter
{
Port = 0xBAC0,
DeviceId = 666,
TargetAddress = "192.168.1.100:47808",
});
var values = driver.Read(node, new[] {
new PointModel { Name = "Temperature", Address = "0_2" },
new PointModel { Name = "Humidity", Address = "1_2" },
});
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
Port |
Int32 | 47808 (0xBAC0) | BACnet/IP UDP port |
DeviceId |
Int32 | 0 | Target device ID; 0 accepts all devices |
WaitingTime |
Int32 | 3000 ms | Timeout for Open() to wait for device responses |
BatchSize |
Int32 | 20 | Number of properties read per batch |
Timeout |
Int32 | 1000 ms | Single-request timeout (BacnetClient) |
Retries |
Int32 | 3 | Number of retries after a failed request |
WritePriority |
UInt32 | 0 | Write priority (1-16; 0 = default) |
TargetAddress |
String | null | Unicast Who-Is target (IP:Port); broadcast when empty |
Known limitations
| Issue | Description | Status |
|---|---|---|
| Very large devices | With 100+ objects a packet may exceed the APDU limit; control BatchSize manually | To optimize |
| MS/TP / PTP transport | Serial transport code exists but is excluded from compilation; cross-platform compatibility is unresolved | Disabled |
| BBMD broadcast management tests | TRN-3/TRN-4 are implemented but lack unit tests | Tests needed |
| IPv6 transport tests | TRN-2 is implemented but lacks IPv6 integration tests | Tests needed |
Recommended tools
YABE (Yet Another BACnet Explorer) — a free BACnet network explorer that shows devices, objects and properties. It is the preferred peer for validating NewLife.BACnet during debugging.
Ecosystem Map
NewLife is a layered ecosystem of independently versioned open-source projects. The map below is shared verbatim by every NewLife repository; each project links to its repository and its primary NuGet package.
| Project | What it does | Downloads |
|---|---|---|
| Foundation | ||
| NewLife.Core | Logging, configuration, caching, networking, serialization, scheduling and APM tracing. | |
| NewLife.XCode | Data middleware: single tables at the tens-of-billions scale, automatic sharding, read-write splitting, 10+ databases. | |
| NewLife.Net | High-performance network library: 1.77M pps / 14.5 Gbps on a single machine (TCP 1KB, 2026-10), 4M long-lived TCP connections. | |
| NewLife.Remoting | Protocol communication and RPC framework for client/server applications and IoT devices. | |
| NewLife.Agent | Installs .NET applications as OS daemons: Windows services and Linux systemd. | |
| NewLife.Templates | dotnet new project templates for console, web, API, service, data and IoT projects. |
|
| Data & Messaging | ||
| NewLife.Redis | Redis client with microsecond latency, millions of ops/s and built-in message queues. | |
| NewLife.RocketMQ | Pure managed RocketMQ client for Apache RocketMQ and Alibaba Cloud Message Queue. | |
| NewLife.MQTT | MQTT client and server, including Alibaba Cloud IoT connectivity. | |
| NewLife.NovaDb | Hybrid database in C#: embedded or networked, relational, time-series, message queue and KV in one. | |
| NewLife.MySql | MySql driver and helper layer built on the NewLife data stack. | |
| Web, AI & Distributed | ||
| NewLife.Cube | Rapid admin-platform framework: permissions, SSO, OAuth server and CRUD scaffolding. | |
| Stardust | Distributed service platform: node management, APM, configuration center, registry and release center. | |
| AntJob | Distributed task and real-time data scheduling platform with sharding, retries and backfill. | |
| NewLife.AI | Unified client for 46 LLM providers plus ChatAI, a ready-to-run web chat application. | |
| Industrial & IoT | ||
| NewLife.IoT | IoT standard library defining protocol contracts and device abstractions. | |
| NewLife.Modbus | Modbus TCP/RTU/ASCII implementation on top of NewLife.IoT. | |
| NewLife.Siemens | Siemens PLC protocol on top of NewLife.IoT. | |
| NewLife.Omron | Omron PLC protocol on top of NewLife.IoT. | |
| NewLife.Melsec | Mitsubishi Melsec PLC protocol on top of NewLife.IoT. | |
| NewLife.OPC | OPC client for industrial data access. | — |
| NewLife.BACnet | BACnet building-automation protocol stack. | |
| ZeroIoT | Lightweight open-source IoT platform with gateway and device management. | — |
| Vehicle Telematics | ||
| NewLife.JT808 | JT/T 808 vehicle positioning protocol: 70+ message bodies, 2011/2013/2019. | |
| NewLife.JT809 | JT/T 809 platform-to-platform protocol for transport authorities. | |
| NewLife.JT1078 | JT/T 1078 in-vehicle video: RTP parsing, FLV/fMP4 remuxing and live streaming. | |
| Domain Components | ||
| NewLife.Office | One package for Excel, Word, PPT, PDF and 15+ document formats. | |
| NewLife.Audio | Cross-platform audio: codecs, device I/O, DSP, containers and streaming. | |
| NewLife.Video | Video codecs, container formats, frame processing and streaming. | |
| NewLife.Map | Unified interface over Baidu, AMap, Tencent and Tianditu with geocoding and coordinate conversion. | |
| NewLife.IP | IPv4 geolocation with an offline memory-mapped database and an online API fallback. | |
| Tools & Products | ||
| CrazyCoder | Developer toolbox: network, serial port, crypto, regex, Modbus and MQTT. | |
| GitCandy | Self-hosted Git source code management system. | — |
| LuckyClover | Installs the matching .NET runtime automatically when launched from an older host. | — |
Badges show the primary package of each project; theme, extension and satellite packages are listed on their NuGet pages. The 30+ packages not listed here (FTP, LoRa, Office extensions, protocol drivers and more) are available under the NewLifeX organization and on newlifex.com.
Team
<img src="/_dp/https://newlifex.com/logo.png" width="48" align="right" alt="NewLife" />
Founded in 2002, the NewLife team has spent more than two decades on the .NET and IoT ecosystem, maintains nearly 100 open-source projects (34 of them core to this map), and delivers integrated software and hardware solutions for power, logistics, healthcare, industrial control and internet industries. We live by the motto "learning has no seniority — mastery earns respect".
Open-source components have been downloaded 6.48M times from NuGet (ecosystem-wide, as of 2026-10).
Website: https://newlifex.com · Open source organization: https://github.com/NewLifeX
<details> <summary>WeChat Official Account: 智能大石头 (scan to follow)</summary>
</details>
License
MIT License — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5
- NewLife.Core (>= 12.0.2026.1024)
- NewLife.IoT (>= 3.2.2026.1024)
-
.NETStandard 2.0
- Microsoft.CSharp (>= 4.7.0)
- NewLife.Core (>= 12.0.2026.1024)
- NewLife.IoT (>= 3.2.2026.1024)
- System.IO.Ports (>= 4.5.0)
- System.Net.WebSockets.Client (>= 4.3.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.2026.1024 | 139 | 10/24/2026 |
| 1.1.2026.1024-beta1530 | 97 | 10/24/2026 |
| 1.1.2026.901 | 162 | 9/1/2026 |
| 1.1.2026.901-beta1700 | 116 | 9/1/2026 |
| 1.0.2026.722-beta1217 | 143 | 7/22/2026 |
| 1.0.2025.1019-beta0144 | 215 | 10/19/2025 |
| 1.0.2025.914-beta1446 | 297 | 9/14/2025 |
| 1.0.2025.802-beta0026 | 187 | 8/2/2025 |
| 1.0.2025.801-beta0630 | 172 | 8/1/2025 |
| 1.0.2025.723-beta1719 | 631 | 7/23/2025 |
| 1.0.2025.704-beta1807 | 202 | 7/4/2025 |
| 1.0.2025.622-beta0305 | 233 | 6/22/2025 |
| 1.0.2025.513-beta0833 | 367 | 5/13/2025 |
| 1.0.2025.426-beta0340 | 190 | 4/26/2025 |
| 1.0.2025.311-beta0016 | 276 | 3/11/2025 |
| 1.0.2025.203-beta1319 | 217 | 2/3/2025 |
| 1.0.2025.201-beta1636 | 220 | 2/1/2025 |
| 1.0.2025.101-beta2348 | 226 | 1/1/2025 |
| 1.0.2025.101-beta0615 | 220 | 1/1/2025 |
| 1.0.2024.1213-beta1009 | 235 | 12/13/2024 |
升级 NewLife.Core 12.0 与 NewLife.IoT 3.2,适配新版网络与消息契约;解决方案迁移为 .slnx,支持 .NET 10 工具链;CI 统一在 Ubuntu 上同时发布 GitHub Packages 与 NuGet.org,并在 tag 推送时自动创建 GitHub Release;同步 NewLife 生态版图与团队介绍,README 提供 11 种语言版本;全量单元测试通过