BLUETOOTHCTL-MONITOR(1)
π
bluetoothctl-monitor, aka the Monitor Submenu of bluetoothctl
okay so bestie, welcome to bluetoothctl-monitor β the monitor submenu page out of the Linux System Administration crowd. Buckle up, this one's all about setting up advertisement monitors, and it's honestly lowkey iconic once you get the vibe. π¦
β¨ NAME β¨
bluetoothctl-monitor β Monitor Submenu. that's it, that's the name, periodt. π
πΈ SYNOPSIS πΈ
bluetoothctl [--options] [monitor.commands]
so this submenu is where you configure advertisement monitors, and it does that through the org.bluez.AdvertisementMonitor(5) and org.bluez.AdvertisementMonitorManager(5) interfaces. two interfaces, one slay little submenu. π
π MONITOR COMMANDS π
set-rssi-threshold
sets the RSSI threshold parameter, i.e. the signal-strength window you care about. πΆ
Usage:
> set-rssi-threshold <low_threshold> <high_threshold>
<low_threshold>β the lower RSSI threshold value, in dBm, for monitoring.<high_threshold>β the higher RSSI threshold value, in dBm, for monitoring.
ok now the examples, because seeing it is believing:
Example β set low threshold to -80 dBm and high threshold to -40 dBm:
> set-rssi-threshold -80 -40
Example β set low threshold to -70 dBm and high threshold to -30 dBm:
> set-rssi-threshold -70 -30
Example β set a very sensitive low threshold and a moderate high threshold:
> set-rssi-threshold -90 -50
Example β set less sensitive thresholds for close range monitoring:
> set-rssi-threshold -60 -20
set-rssi-timeout
sets the RSSI timeout parameter. basically how long the monitor waits on each side of the threshold window. β³
Usage:
> set-rssi-timeout <low_timeout> <high_timeout>
<low_timeout>β timeout value, in seconds, for the low RSSI threshold.<high_timeout>β timeout value, in seconds, for the high RSSI threshold.
Examples, say it with me:
Example β set low timeout to 5 seconds, high timeout to 10 seconds:
> set-rssi-timeout 5 10
Example β set a quick timeout response for both thresholds:
> set-rssi-timeout 1 5
Example β set longer timeout periods for stable monitoring:
> set-rssi-timeout 10 30
Example β set asymmetric timeout values:
> set-rssi-timeout 3 15
set-rssi-sampling-period
sets the RSSI sampling period parameter. it's giving "how often do we even bother reporting". π§
Usage:
> set-rssi-sampling-period <sampling_period>
<sampling_period>β sampling period in 100ms units (0-255, where0means report all, and255means report only first).
bestie pls note the range: it's0to255, and those two endpoints are special little creatures, not just regular numbers. π«Ά
Examples:
Example β set sampling period to 100ms (1 unit):
> set-rssi-sampling-period 1
Example β set sampling period to 500ms (5 units):
> set-rssi-sampling-period 5
Example β set sampling period to 1 second (10 units):
> set-rssi-sampling-period 10
Example β report all advertisements (no sampling):
> set-rssi-sampling-period 0
Example β report only first advertisement:
> set-rssi-sampling-period 255
add-or-pattern
registers an 'or pattern' type monitor with the RSSI parameters you specify. this is the main character of the submenu, honestly. π₯
each pattern requires 3 arguments: <start_position> <ad_data_type> <content_of_pattern>. and yes, you can specify multiple patterns to create an OR condition β hence the name, iykyk.
Usage:
> add-or-pattern <start_pos> <ad_type> <content> [start_pos ad_type content ...]
Uses the org.bluez.AdvertisementMonitorManager(5) method RegisterMonitor.
<start_pos>β byte position in advertisement data where pattern matching starts (0-based, so don't come at it with 1).<ad_type>β advertisement data type (e.g.,9for Complete Local Name,1for Flags).<content>β hexadecimal pattern content to match.
Examples, one per vibe:
Example β monitor for Samsung in Complete Local Name (type 9):
> add-or-pattern 0 9 53616d73756e67
Example β monitor for devices with Flags type (type 1) containing 0x06:
> add-or-pattern 0 1 06
Example β monitor for two different patterns (OR condition):
> add-or-pattern 0 9 53616d73756e67 0 9 4170706c65
Example β monitor for specific manufacturer data (type 255):
> add-or-pattern 0 255 4c000215
get-pattern
gets an advertisement monitor. the "wait, what did I actually set up?" command. π
Usage:
> get-pattern <monitor-id/all>
<monitor-id/all>β the monitor ID number to retrieve details for, orallfor all active monitors.
Examples:
Example β get details of monitor ID 0:
> get-pattern 0
Example β get details of monitor ID 1:
> get-pattern 1
Example β get details of monitor ID 5:
> get-pattern 5
Example β get details of all active monitors:
> get-pattern all
remove-pattern
removes an advertisement monitor. the breakup command, and it's clean. π
Usage:
> remove-pattern <monitor-id/all>
Uses the org.bluez.AdvertisementMonitorManager(5) method UnregisterMonitor.
<monitor-id/all>β the monitor ID number to remove, orallto remove all active monitors.
Examples:
Example β remove monitor with ID 0:
> remove-pattern 0
Example β remove monitor with ID 1:
> remove-pattern 1
Example β remove monitor with ID 3:
> remove-pattern 3
Example β remove all active advertisement monitors:
> remove-pattern all
get-supported-info
gets the advertisement manager's supported features and supported monitor types. a little vibe check on what your setup can actually do. β
Usage:
> get-supported-info
Uses the org.bluez.AdvertisementMonitorManager(5) properties.
Example β display supported monitor features and types:
> get-supported-info
print-usage
prints the command usage. yes, a command for getting usage, we love self-awareness. π
Usage:
> print-usage <add-or-pattern>
<add-or-pattern>β command name to display detailed usage information for.
Example β show detailed usage for the add-or-pattern command:
> print-usage add-or-pattern
π RESOURCES π
go touch grass on the official site, bestie. πΈ
π«Ά REPORTING BUGS π«Ά
- linux-bluetooth@vger.kernel.org
found something cursed? tell the mailing list, not me. π
π COPYRIGHT π
Free use of this software is granted under the terms of the GNU Lesser General Public Licenses (LGPL). slay, legally. π
and that's the whole page! this cutie is brought to you by BlueZ, dated July 2023 β go forth and monitor those advertisements, you absolute icon. ππ¦
π¦ where this page comes from
- centos-stream 9: bluez 5.87+2.git8750129efca8-1.el9 Β· GPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms