{"id":19094751,"url":"https://github.com/vapourismo/knx-go","last_synced_at":"2025-05-14T18:06:24.838Z","repository":{"id":20876138,"uuid":"89713685","full_name":"vapourismo/knx-go","owner":"vapourismo","description":"KNX clients and protocol implementation in Go","archived":false,"fork":false,"pushed_at":"2025-03-13T00:26:23.000Z","size":436,"stargazers_count":97,"open_issues_count":2,"forks_count":62,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-13T13:17:56.867Z","etag":null,"topics":["bridge","gateway","go","knx","protocol","router","tunnel"],"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/vapourismo.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-28T14:25:58.000Z","updated_at":"2025-04-08T16:58:13.000Z","dependencies_parsed_at":"2024-04-23T21:30:58.904Z","dependency_job_id":"69915e15-7c9b-4f67-8641-5e82d9af99db","html_url":"https://github.com/vapourismo/knx-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vapourismo%2Fknx-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vapourismo%2Fknx-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vapourismo%2Fknx-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vapourismo%2Fknx-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vapourismo","download_url":"https://codeload.github.com/vapourismo/knx-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198514,"owners_count":22030965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bridge","gateway","go","knx","protocol","router","tunnel"],"created_at":"2024-11-09T03:31:15.522Z","updated_at":"2025-05-14T18:06:19.824Z","avatar_url":"https://github.com/vapourismo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Check](https://github.com/vapourismo/knx-go/actions/workflows/check.yaml/badge.svg?branch=master)](https://github.com/vapourismo/knx-go/actions/workflows/check.yaml)\n[![GoDoc](https://godoc.org/github.com/vapourismo/knx-go?status.svg)](https://godoc.org/github.com/vapourismo/knx-go)\n\n# knx-go\n\nThis repository contains a collection of Go packages that provide the means to communicate with KNX\nnetworks.\n\n## Packages\n\n Package           | Description\n-------------------|--------------------------------------------------------------------\n **knx**           | Abstractions to communicate with KNXnet/IP servers\n **knx/knxnet**    | KNXnet/IP protocol services\n **knx/dpt**       | Datapoint types\n **knx/cemi**      | CEMI-encoded frames\n **cmd/knxbridge** | Tool to bridge KNX networks between a KNXnet/IP router and gateway\n\n## Installation\n\nSimply run the following command.\n\n\t$ go get -u github.com/vapourismo/knx-go/...\n\n## Examples\n\n### KNXnet/IP Group Client\n\nIf you simply want to send and receive group communication, the\n[GroupTunnel](https://godoc.org/github.com/vapourismo/knx-go/knx#GroupTunnel) or\n[GroupRouter](https://godoc.org/github.com/vapourismo/knx-go/knx#GroupRouter)\nmight be sufficient to you.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/vapourismo/knx-go/knx\"\n\t\"github.com/vapourismo/knx-go/knx/cemi\"\n\t\"github.com/vapourismo/knx-go/knx/dpt\"\n\t\"github.com/vapourismo/knx-go/knx/util\"\n)\n\nfunc main() {\n\t// Setup logger for auxiliary logging. This enables us to see log messages from internal\n\t// routines.\n\tutil.Logger = log.New(os.Stdout, \"\", log.LstdFlags)\n\n\t// Connect to the gateway.\n\tclient, err := knx.NewGroupTunnel(\"10.0.0.7:3671\", knx.DefaultTunnelConfig)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Close upon exiting. Even if the gateway closes the connection, we still have to clean up.\n\tdefer client.Close()\n\n\t// Send 20.5°C to group 1/2/3.\n\terr = client.Send(knx.GroupEvent{\n\t\tCommand:     knx.GroupWrite,\n\t\tDestination: cemi.NewGroupAddr3(1, 2, 3),\n\t\tData:        dpt.DPT_9001(20.5).Pack(),\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Receive messages from the gateway. The inbound channel is closed with the connection.\n\tfor msg := range client.Inbound() {\n\t\tvar temp dpt.DPT_9001\n\n\t\terr := temp.Unpack(msg.Data)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tutil.Logger.Printf(\"%+v: %v\", msg, temp)\n\t}\n}\n```\n\nIn case you want to access a KNXnet/IP router instead of a gateway, simply replace\n\n```go\nclient, err := knx.NewGroupTunnel(\"10.0.0.7:3671\", knx.DefaultTunnelConfig)\n```\n\nwith\n\n```go\nclient, err := knx.NewGroupRouter(\"224.0.23.12:3671\", knx.DefaultRouterConfig)\n```\n\n### KNXnet/IP CEMI Client\n\nUse [Tunnel](https://godoc.org/github.com/vapourismo/knx-go/knx#Tunnel) or\n[Router](https://godoc.org/github.com/vapourismo/knx-go/knx#Router) for finer control over the\ncommunication with a gateway or router.\n\n### KNX Bridge\n\nThe **knxbridge** tool (in package `cmd/knxbridge`) has multiple use cases.\n\nExpose a KNX network behind a gateway at `10.0.0.2:3671` on the multicast group `224.0.23.12:3671`.\nThis allows routers and router clients to access the network.\n\n\t$ knxbridge 10.0.0.2:3671 224.0.23.12:3671\n\nConnect two KNX networks through gateways. In this example one gateway is at `10.0.0.2:3671`, the\nother is at `10.0.0.3:3671`.\n\n\t$ knxbridge 10.0.0.2:3671 10.0.0.3:3671\n\n### Discover all KNXnet/IP Servers\n\nThe following example shows how to discover all routers/gateways on a network.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/kr/pretty\"\n\n\t\"github.com/vapourismo/knx-go/knx\"\n\t\"github.com/vapourismo/knx-go/knx/util\"\n)\n\nfunc main() {\n\t// Setup logger for auxiliary logging. This enables us to see log messages from internal\n\t// routines.\n\tutil.Logger = log.New(os.Stdout, \"\", log.LstdFlags)\n\n\tservers, err := knx.Discover(\"224.0.23.12:3671\", time.Millisecond*750)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tutil.Logger.Printf(\"%# v\", pretty.Formatter(servers))\n}\n```\n\n### Describe a Single KNXnet/IP Server\n\nThe following example shows how to get a description from a single server.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/kr/pretty\"\n\n\t\"github.com/vapourismo/knx-go/knx\"\n\t\"github.com/vapourismo/knx-go/knx/util\"\n)\n\nfunc main() {\n\tutil.Logger = log.New(os.Stdout, \"\", log.LstdFlags)\n\n\t// Describe KNXnet/IP server at given address and default port\n\tservers, err := knx.DescribeTunnel(\"192.168.1.254:3671\", time.Millisecond*750)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tutil.Logger.Printf(\"%# v\", pretty.Formatter(servers))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvapourismo%2Fknx-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvapourismo%2Fknx-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvapourismo%2Fknx-go/lists"}