Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c9e5f27
build: move to btleplug 0.13.5, the first release with the fixes for …
cameronrye Oct 11, 2026
8b04ec3
fix: read a device's name through `peripheral_name`, so that a BlueZ …
cameronrye Oct 11, 2026
0e7c352
refactor: remove the matching of either half of a macOS combined name…
cameronrye Oct 11, 2026
6e6667c
test: make the BlueZ test double wait 30 s, as bluez-async 0.9.0 does
cameronrye Oct 11, 2026
1ec34ad
test: cover the BlueZ connect paths that a 30 s library wait makes th…
cameronrye Oct 11, 2026
b7142e4
docs: say in the Linux connect comments that bluez-async waits 30 s, …
cameronrye Oct 11, 2026
ec9a3a6
test: pin what the zero-services retry does when its reconnect is ref…
cameronrye Oct 12, 2026
24e3e01
docs: describe the CoreBluetooth backend as btleplug 0.13.5 implement…
cameronrye Oct 12, 2026
3c8e075
fix: hide the error line btleplug 0.13.5 logs after every successful …
cameronrye Oct 12, 2026
6838c45
docs: correct the test comments about making a PeripheralId
cameronrye Oct 12, 2026
52b0c48
docs: reword the dependency version rule and name btleplug 0.13 in AR…
cameronrye Oct 12, 2026
064a3c1
docs: record the btleplug 0.13 upgrade in the changelog
cameronrye Oct 12, 2026
a6be5df
docs: correct what the Linux connect comments say about re-dials and …
cameronrye Oct 12, 2026
629a73e
docs: say what the name comments and the name guard's doc left out
cameronrye Oct 12, 2026
bd1999f
test: check both halves of a bracketed name in the soak example
cameronrye Oct 12, 2026
6709a49
docs: say that --quiet uses the default log directives too
cameronrye Oct 12, 2026
ae6c013
test: pin what the GUI's log filter does with a RUST_LOG that holds n…
cameronrye Oct 12, 2026
c11c27e
docs: correct the changelog's entries on Linux adapters and macOS errors
cameronrye Oct 12, 2026
3b2b4de
docs: let the dependency rule ask for a later release that fixed some…
cameronrye Oct 12, 2026
25d9b0e
docs: narrow two changelog sentences to what the code does
cameronrye Oct 12, 2026
72ae11e
docs: say what btleplug 0.13.5 does with a sensor reported as a scan …
cameronrye Oct 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **`DeviceNotFoundReason::Ambiguous` and `DeviceNotFoundReason::NoExactMatch`**, returned for a name that two nearby devices share and for a partial name (see Changed)
- **`Device::connect_with_scan_options`**, to choose how long a connect searches for the device
- **`aranet_core::peripheral_name`**, the name aranet uses for a device, read from btleplug's `PeripheralProperties`: the name the device advertises, or on macOS, for a device that hasn't advertised one, the name macOS has stored for it. A program that reads `local_name` itself should call it instead (see Changed)
- **Optional data retention** — `[storage.retention] readings_days` and `history_days` make the service delete older rows at startup and then hourly, in small batches. Off by default. `history_days` also prunes the history cache that `aranet sync` fills, which the next sync may download again. Both limits apply to everything in the database, including readings that the `aranet` CLI, TUI and GUI stored there when they share it (the default, except under the systemd system service and Docker)
- **Setting `security.api_key_enabled = true` without `security.api_key`** now generates a key and saves it to `server.toml`
- **The API key is also accepted as `Authorization: Bearer <key>`**, so Prometheus can scrape an authenticated service with `authorization: { type: Bearer, credentials: … }`. A repeated `X-API-Key` or `Authorization` header, or an `X-API-Key` that isn't plain text, is never read as a key, so a request that sends its key that way is refused
Expand All @@ -30,6 +31,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **`ReconnectingDevice` retries** — it reconnects only after connection errors (not connected, timeouts, connection failures and Bluetooth link errors); other errors, such as a characteristic the device doesn't have, are returned at once. Operations that fail together share one reconnect; `cancel_reconnect()` and `disconnect()` stop a reconnect wait at once, and a reconnect already in progress no longer undoes `disconnect()`. A `with_device` closure can run a second time, but only after a connection error. `reconnect()`, and so `AranetDevice::connect()`, called while another reconnect is running waits for it instead of starting its own, and returns `Error::NotConnected` if that one gave up or `disconnect()` stopped it, or `Error::Cancelled` after `cancel_reconnect()`; operations waiting for a reconnect do the same. The old connection is closed when a reconnect starts, so while it runs, and after it fails, `ReconnectingDevice::name()` returns `None` and `address()` returns the identifier
- **`DeviceManager`** — devices that were disconnected, evicted or removed stay that way until `connect()` is called; automatic reconnects back off per device using its `ReconnectOptions` and stop after `max_attempts` with one `DeviceEvent::Error`; `ManagerConfig::default().default_reconnect_options` is now `ReconnectOptions::unlimited()`; health checks run concurrently, a failed reconnect shortens the adaptive check interval even when other devices are healthy, and the monitor stops as soon as it is cancelled; a second `connect()` of a device waits for the first and returns its real result; a `connect()` that hasn't connected yet when `disconnect()`, `disconnect_all()`, `evict_lowest_priority()` or `remove_device()` is called for the same device returns `Error::Cancelled` and releases the sensor, instead of `Ok` or adding the device back; these four send `Disconnected`, and `remove_device()` removes the device, even when closing the connection fails or the call is cancelled, and still return a failed close's error; `max_concurrent_connections` counts connects in progress, so `connect_all` respects it; `connect()` on a device whose connection has dropped reconnects instead of returning `Ok`; `add_device`, `add_device_with_options` and `add_device_with_priority` reject invalid `ReconnectOptions`; passive readings from the hybrid monitor no longer reset a device's reconnect backoff
- **`ConnectionConfig::discovery_timeout` on Linux** — while BlueZ is still discovering the services of a device it has just connected, a connect waits at least 20 s for it, even when `discovery_timeout` is shorter (`ConnectionConfig::fast()` sets 5 s)
- **`ConnectionConfig::discovery_timeout` on macOS** — by btleplug's source code, version 0.13 reports a macOS connection as made as soon as the link is up and discovers the services in a step of its own, so `discovery_timeout` (10 s by default, 8 s in the TUI) now limits that discovery, where the link and the discovery shared the connect timeout before; a connect has more time in all (25 s where it had 15 s by default, 40 s where it had 30 s in `aranet watch`, 18 s where it had 10 s in the TUI), and a discovery that alone takes longer than `discovery_timeout` fails with "Operation 'discover services' timed out". No `aranet` option or config key sets `discovery_timeout`: in a connect made by `aranet watch`, `--timeout` (or the `timeout` config key) now limits only the time the link takes to come up
- **Bluetooth errors on macOS** — by btleplug's source code, an error that macOS reports for a read, a write or a subscribe is now returned as a "Bluetooth error". In 0.2.1 a read or a write ran into its time limit and failed as a timeout. A read that needs pairing can still time out while macOS shows its pairing window
- **Two new failures on macOS** — by btleplug's source code, once macOS reports that a sensor's services changed, reads and writes of those services fail with "Service no longer available" until the next connect, and one that is in progress at that moment fails with "Service invalidated; rediscovery required"; and when the characteristics of a service can't be discovered, the connect still succeeds and reads then fail with "Characteristic not found", which `ReconnectingDevice` returns without reconnecting (`aranet watch` and the service connect again at their next poll)
- **Device names on macOS** — a sensor whose name stored by macOS differs from the name it advertises was listed as `<stored name> [<advertised name>]`, for example `Kitchen [Aranet4 1A2B3]`. btleplug 0.13 no longer builds that form: the sensor is listed under its advertised name alone, `Aranet4 1A2B3`, and `-d Kitchen` or `-d "Kitchen [Aranet4 1A2B3]"` no longer finds it. Use the advertised name or the identifier that `aranet scan` prints. The rule for names on Linux and Windows is unchanged
- **Linux: Bluetooth adapters** — by btleplug's source code and that of its BlueZ library, bluez-async 0.9, adapters that BlueZ reports with a `bluetooth:` modalias are now listed, where only those with a `usb:` modalias were before. BlueZ (5.82, by its source code) gives every adapter of a host the same modalias, built from `DeviceID` in `/etc/bluetooth/main.conf` (`usb:…` unless that is changed), so this matters only on a host that sets `DeviceID = bluetooth:…`: there 0.2.1 found no adapter and failed with "no Bluetooth adapter available", and its adapters are now found. On every other host the adapters listed are the same as before
- **Breaking (library):** `aranet-core` now builds on btleplug 0.13 (0.13.5 or a later 0.13 release; 0.2.1 used 0.11) and so, on Linux, on bluez-async 0.9 (was 0.8). btleplug is a public dependency of `aranet-core` through `Error::Bluetooth`, `DiscoveredDevice::id`, `scan::get_adapter`, `scan::scan_with_adapter`, the `scan::find_device…` functions, `Device::connect_with_adapter`, `Device::from_peripheral…`, `format_peripheral_id`, `create_identifier` and the new `peripheral_name`, so a program that uses these with its own btleplug dependency must move to btleplug 0.13 too, and bumping it is a breaking change. `btleplug::Error`, which `Error::Bluetooth` carries, has a new variant, `NoAdapterAvailable`. Code that reads `PeripheralProperties::local_name` itself gets a different value on every platform: BlueZ's alias on Linux, the system's name for the device after a connect on Windows, and on macOS no longer the combined form (see "Device names on macOS"); `aranet_core::peripheral_name` returns the name aranet uses. On macOS, btleplug 0.13.5 logs `Shouldn't get anything but Ok!` at error level after every disconnect that macOS confirms, under the log target `btleplug::corebluetooth::peripheral`; the disconnect has succeeded, and the line can be ignored. `aranet`, `aranet-service` and the GUI leave that target out of their default log output: `aranet --verbose`, and a `RUST_LOG` of your own in `aranet` and the GUI, can still show the line, while `aranet-service` and `aranet server` keep the target off whatever `RUST_LOG` says. A program with its own logger must filter it out itself
- **Breaking (library):** `aranet-service`'s Rust API changed for 0.3.0:
- **`Collector::stop`** returns `CollectorStopResult`, and **`CollectorError`** is `#[non_exhaustive]` with a new `Timeout(Duration)` variant
- **`PrometheusPusher::start`** returns `Option<JoinHandle<()>>`
Expand Down
190 changes: 116 additions & 74 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ aranet-service = { version = "0.2.1", path = "crates/aranet-service" }
# workspace entry already does, so it is set here.
aranet-cli = { version = "0.2.1", path = "crates/aranet-cli", default-features = false }

btleplug = "0.11"
# At least 0.13.5: the first release with the fixes for btleplug's issues #494 (macOS memory
# growth while scanning) and #496 (the 5 s BlueZ service-discovery wait). 0.13.0 is yanked.
btleplug = "0.13.5"
tokio = { version = "1", features = ["full"] }
thiserror = "2"
bytes = "1"
Expand Down
Loading
Loading