{"id":36493356,"url":"https://github.com/ulbios/bacnet","last_synced_at":"2026-01-12T01:58:14.509Z","repository":{"id":193084298,"uuid":"666355359","full_name":"ulbios/bacnet","owner":"ulbios","description":"A native Go implementation of the BACnet/IP protocol","archived":false,"fork":false,"pushed_at":"2023-09-10T23:32:33.000Z","size":58,"stargazers_count":18,"open_issues_count":4,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-20T10:31:24.215Z","etag":null,"topics":["bacnet","bacnet-ip","bms"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ulbios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-14T10:01:39.000Z","updated_at":"2025-06-14T07:59:25.000Z","dependencies_parsed_at":"2023-10-11T07:43:17.740Z","dependency_job_id":"892d44d1-1566-4005-a617-952388abcfc4","html_url":"https://github.com/ulbios/bacnet","commit_stats":{"total_commits":26,"total_committers":2,"mean_commits":13.0,"dds":"0.23076923076923073","last_synced_commit":"227d62272ce9cedcfe47c1621a8cb4e0d2470ee0"},"previous_names":["ulbios/bacnet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ulbios/bacnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulbios%2Fbacnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulbios%2Fbacnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulbios%2Fbacnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulbios%2Fbacnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ulbios","download_url":"https://codeload.github.com/ulbios/bacnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulbios%2Fbacnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bacnet","bacnet-ip","bms"],"created_at":"2026-01-12T01:58:14.435Z","updated_at":"2026-01-12T01:58:14.501Z","avatar_url":"https://github.com/ulbios.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BACnet\nBACnet implementation in pure Golang. This work was initially based on [@kazukiigeta's](https://github.com/kazukiigeta)\nwork available on the [kazukiigeta/bacnet](https://github.com/kazukiigeta/bacnet) repository.\n\nPlease bear in mind we **only** support IP as the BACnet transport layer for now.\n\nWe began working with the marshalling and unmarshalling routines defined in the original project and added\na set of new messages. These are exposed through `New*()` functions defined on `encoding.go` and are\nparsed with the `Parse()` function defined on `parsing.go`.\n\nIn order to make adding new messages easier, we restructured the project and broke everything up in several directories:\n\n1. `plumbing/`: Everything related to BVLV, NPDU and APDU marshalling and unmarshalling.\n2. `objects/`: Definition of different BACnet objects so that they can be reused.\n3. `services/`: Implementation of several BACnet services such as *ReadProperty* and *WriteProperty*.\n4. `common/`: Utilities and definitions used across all the above.\n\nOn top of the BACnet implementation, we also offer a CLI-based program offering a way to test every\navailable service. All the sources are contained on `examples/`. The binary can be generated with:\n\n    # Getting to the directory.\n    $ cd examples\n\n    # Time to build it!\n    $ go build\n\nAs always, you can alter the generated binary with environment flags and the like. We also provide a `Taskfile`\nyou can leverage with `task`:\n\n    # Getting to the directory.\n    $ cd examples/\n\n    # Compile for Linux-based distros.\n    $ task\n\n    # Compile for macOS.\n    $ task build-mac\n\nYou can find more information on Task on its [official site](https://taskfile.dev). Once compiled, just invoke the\nbinary with no arguments to get an idea of what it can do. You can also take a look at its implementation: it's a\ngood example of how to use the library on your own project!\n\n## Running the examples\nIn order to check our implementation is compliant, we interact with the server implementation offered by the\n[`bacnet-stack/bacnet-stack`](https://github.com/bacnet-stack/bacnet-stack/tree/master) project. We have added\nit as a submodule to this repo so that you can easily get a copy to then compile the server.\n\nIn order to initialise the submodule you can either clone this repository with the `--recursive` flag or you\ncan run `git submodule update --init --recursive` after you clone it: up to you!\n\nCompiling the example applications is a matter of navigating to the correct directory and then running `make`:\n\n    # Navigate to the apps directory.\n    $ cd bacnet-stack/apps\n\n    # Time to compile!\n    $ make\n\nIf you do not have `make` installed, please refer to your system's package manager: it should be fairly easy to\nget it up and running. Once that's done, we can just run the examples.\n\n### Configuration\nThe `bacnet-stack` project's been written in pure C. In a fairly common C style, some of the configuration is\ndone through environment variables. Please refer to the documentation at `bacnet-stack/doc/README.*` so that\nyou know what to expect: for instance `bacnet-stack/doc/README..utils` contains information on how to configure\nthe network interface the `bacnet-stack` tools will bind to.\n\nThe following examples have been executed leveraging the Vagrant escenario defined in the `Vagrantfile`. We'll\nmake it clear from where (i.e. which machine) we're running things. Also, bear in mind you'll need to find the\nname of the bridge interface providing Vagrant's network backbone. On macOS that can be accomplished with\n`ifconfig -a` and on Linux the same's possible with `ip a`. You can also use [WireShark](https://www.wireshark.org)\nto check what interfaces have traffic... At any rate, the names in our examples may (and very possibly will) differ\nfrom yours. Another easy way to identify the interface is to check its associated IPv4 address belongs to the\n`10.0.123.0/24` subnet, which is defined within the `Vagrantfile`. Bear in mind you **must** change this setting\nif it conflicts with existing subnets on your machine.\n\nThe purpose of running these examples is both making sure our tools work **and** capturing traffic to check\nit's compliant with WireShark's BACnet dissector.\n\n#### Testing bacnet-stack server\nFrom macOS we just need to start the server with Device ID `123` and Device Name `foo` with:\n\n    # Getting to the server directory.\n    $ cd bacnet-stack/apps/server\n\n    # Exporting the interface we want the server to bind to.\n    $ export BACNET_IFACE=bridge100\n\n    # Running it! You can use `--help` for more information.\n    $ ./bacserv 123 foo\n\nFrom the VM we just need to run some clients:\n\n    # Getting to the apps directory.\n    $ cd bacnet-stack/apps\n\n    # The interface name on this machine's different!\n    $ export BACNET_IFACE=enp0s8\n\n    # Writing a property to Device ID 123. The MAC IPv4 address is the one assigned to the\n    # host machine on the Vagrant subnet and the port is BACnet's default one.\n    ./writeprop/bacwp 123 analog-output 0 present-value 16 -1 4 1.1 --mac 10.0.123.1:47808\n\n    # Reading a property from Device ID 123. In this case, just like before, you can use the\n    # --help flag to get some more information on what you can use and what's configurable.\n    ./readprop/bacrp 123 analog-output 1 present-value --mac 10.0.123.1:47808\n\n    # Making a WhoIs request.\n    ./bacwi --mac 10.0.123.1:47808\n\nDo bear in mind you can find the predefined devices and mock data on `bacnet-stack`'s server on\n`bacnet-stack/apps/server/epics_vts3.tpi`.\n\n#### Testing our ReadProperty server\nFrom macOS we can just run:\n\n    # Go to the examples directory\n    $ cd examples\n\n    # Run the example ReadProperty server\n    $ ./bin/bexamples.osx.ex --remote-address 10.0.123.255:47808 rp\n\nFrom the VM we can just query for some data:\n\n    # navigate to the ReadProperty directory\n    $ cd bacnet-stack/apps/readprop\n\n    # Query Device ID 321 for analog-output 2 and point it to the host's\n    # IPv4 address (i.e. 10.0.123.1).\n    $ ./bacrp 321 analog-output 2 present-value --mac 10.0.123.1:47808\n\nOur ReadProperty server will answer requests for `analog-output`s `0` and `1` and will reply\nwith an `Error` otherwise.\n\nWith that, you can get the gist of what's going on: happy tweaking!\n\n## Traffic captures\nIn order to develop parsing and encoding functions we have captured traffic generated by the\n`bacnet-stack` implementation with WireShark. We have stored those capture files on `traffcaps`\nso that you can also leverage them. You should be able to open them up with WireShark without\ntoo much trouble. We will also store traffic captures generated with out examples to showcase\nhow we are also compliant with the dissector.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulbios%2Fbacnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulbios%2Fbacnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulbios%2Fbacnet/lists"}