Go Bluetooth

Go BLE libraries, compared

Four ways to reach Bluetooth Low Energy from Go. SimpleBLE runs on Windows, macOS, and Linux from one module, as a central and a peripheral, and builds without cgo or a C compiler.

Kober Engineering
InsuLearn
Meta
Fender
Honeywell
Bionic Labs
Sona
SWT
Moon Smart Focus
Lewitt
Medra
Desko
g.tec
IXI
Innovision
Moonlighting Industries
Kober Engineering
InsuLearn
Meta
Fender
Honeywell
Bionic Labs
Sona
SWT
Moon Smart Focus
Lewitt
Medra
Desko
g.tec
IXI
Innovision
Moonlighting Industries
Kober Engineering
InsuLearn
Meta
Fender
Honeywell
Bionic Labs
Sona
SWT
Moon Smart Focus
Lewitt
Medra
Desko
g.tec
IXI
Innovision
Moonlighting Industries
Comparison

How the Go BLE libraries compare

Platforms, roles, and licensing decide which package fits a commercial Go product. This is where each one stands.

How the Go BLE libraries compare
SimpleBLEsimplegobleWindows, macOS, LinuxCentral and peripheral on every platformC++, Python, Rust, Kotlin, and moreSource-available (BUSL 1.1); one commercial license per company
TinyGo Bluetoothtinygo.org/x/bluetoothWindows, macOS, Linux, browser, and microcontrollers through TinyGoCentral everywhere; peripheral on Linux, Windows, and microcontrollersGo onlyBSD-3-Clause
go-blegithub.com/go-ble/bleLinux, macOSCentral and peripheralGo onlyBSD-3-Clause
go-bluetoothgithub.com/muka/go-bluetoothLinuxCentral and peripheralGo onlyApache 2.0
The options

The Go BLE libraries, one by one

SimpleBLE

SimpleBLE is a Bluetooth Low Energy library for Windows, macOS, Linux, iOS, and Android. Its Go module, SimpleGoBLE, scans and connects as a central and hosts GATT services as a peripheral on every desktop platform. The module carries the native library for each platform and loads it without cgo, so go get and go build are all it takes. The same library runs in C++, Python, Rust, Kotlin, and other languages, and commercial customers work directly with the engineers who build it.

TinyGo Bluetooth

TinyGo Bluetooth, from the TinyGo project, covers Windows, macOS, Linux, the browser, and bare-metal microcontrollers such as Nordic and ESP32 chips. Its README states that macOS works in the central role only and must be built on a Mac with the Xcode tools installed. SimpleBLE hosts GATT services on macOS too, and needs no C compiler on any platform.

go-ble

go-ble is a Go BLE package for Linux and macOS, in the central and peripheral roles, under the BSD-3-Clause license. Its README notes that the macOS portion is not actively maintained, and it does not run on Windows.

go-bluetooth

go-bluetooth wraps the BlueZ D-Bus API for Linux, with an unstable API for exposing GATT services, under the Apache 2.0 license. Its repository is archived, and its README says it is no longer maintained.

Get started

Scan, connect, and host in a few lines

Add it with go get github.com/simpleble/simplegoble. Every call returns an error you can check, and this is the code for each step.

package main

import (
    "fmt"
    "log"
    "time"

    ble "github.com/simpleble/simplegoble"
)

func main() {
    adapters, err := ble.GetAdapters()
    if err != nil {
        log.Fatal(err)
    }
    adapter := adapters[0]

    adapter.SetCallbackOnScanFound(func(peripheral *ble.Peripheral) {
        defer peripheral.Close()
        identifier, _ := peripheral.Identifier()
        address, _ := peripheral.Address()
        fmt.Printf("%s [%s]\n", identifier, address)
    })
    adapter.ScanFor(5 * time.Second)
}
Why SimpleBLE

What SimpleBLE gives your Go product

Platforms

Windows, macOS, and Linux

One module, one API, on every desktop.

Roles

Central and peripheral

Scan and connect, or advertise and serve GATT, on every platform.

Builds

No cgo, no C compiler

go get and go build. The native library comes with the module.

Hardware

Dongl on desktop

Plug in a Dongl for a dedicated radio on Windows, macOS, or Linux. Same code.

Tools

One library, every tool

Your mobile apps and test rigs use the same SimpleBLE in Swift, Kotlin, or Python.

Support

A direct line to the engineers

Commercial customers work directly with the team that builds SimpleBLE.

Try SimpleBLE in your Go product

Evaluation needs no license. For commercial use, one agreement covers your whole company, with no per-seat, per-device, or royalty fees.

Frequently
asked questions

SimpleBLE and TinyGo Bluetooth run on all three. go-ble runs on Linux and macOS, and go-bluetooth runs on Linux.

Yes, with SimpleBLE, which hosts GATT services and advertises on Windows, macOS, and Linux. TinyGo Bluetooth works in the central role on macOS.

No. SimpleGoBLE carries the native SimpleBLE library for each platform and loads it without cgo, so no C compiler is needed to build your program.

Add SimpleGoBLE with go get, then move scanning, connections, and GATT calls one flow at a time. Characteristics are addressed by service and characteristic UUID strings, values are byte slices, and every call returns an error.

Yes. On Windows, macOS, and Linux, SimpleGoBLE drives a Dongl USB adapter with the same code it uses for the computer's built-in Bluetooth.

SimpleBLE is source-available under the Business Source License 1.1 and free for non-commercial use. Evaluation needs no license. Commercial use needs a license, and one agreement covers your whole company, with no per-seat, per-device, or royalty fees.