Summary
Bluetooth is a short-range wireless technology that allows broadcasting the data over specific Bluetooth channels. There are 40 unique Bluetooth bands (channels) and each band has a 2 MHz separation. 37, 38, and 39 channels are used for advertising, and 0-36 are used for data transmission.
The main application for the Bluetooth interface in RouterOS is to monitor Bluetooth advertising packets that are broadcasted by other devices (like for example, Bluetooth tags) on channels 37, 38, and 39.
Configuration
Sub-menu: /iot bluetooth
note: iot package is required.
note: Check the device specifications page to make sure that the Bluetooth is supported by the unit.
IoT package is available with RouterOS version 6.48.3. You can get it from our download page - under "Extra packages".
Devices
In this menu you can check and set general Bluetooth chip parameters:
[admin@device] > iot bluetooth print Columns: NAME, PUBLIC-ADDRESS, RANDOM-STATIC-ADDRESS, ANTENNA # NAM PUBLIC-ADDRESS RANDOM-STATIC-ADD ANTENNA 0 bt1 00:00:00:00:00:00 F4:4E:E8:04:77:3A internal [admin@device] /iot bluetooth set
note: Public address is the IEEE registered, permanent address. This address can not be changed.
Configurable settings are shown below:
Property | Description |
---|---|
antenna (string; Default: internal) | Choose whether to use an internal or an external Bluetooth antenna |
name (string; Default: ) | Descriptive name of Bluetooth chip/interface |
random-static-address (MAC address; Default: ) | A unique static user-configurable address for the Bluetooth chip |
You can monitor chip stats with the command:
[admin@device] /iot bluetooth print stats Columns: NAME, RX-BYTES, TX-BYTES, RX-ERRORS, TX-ERRORS, RX-EVT, TX-CMD, RX-ACL, TX-ACL # NAM RX-BYTE TX- R T RX-EV TX R T 0 bt1 1857835 235 0 0 46677 45 0 0
Advertisers
In this menu, it is possible to set up the Bluetooth chip to broadcast advertising packets. You can check and set advertiser settings with the commands:
[admin@device] > iot bluetooth advertisers print Flags: X - DISABLED Columns: DEVICE, MIN-INTERVAL, MAX-INTERVAL, OWN-ADDRESS-TYPE, CHANNEL-MAP, AD-SIZE # DEVICE MIN-INTERVAL MAX-INTERVAL OWN-ADDRESS-TYPE CHANNEL-MAP AD-SIZE 0 X bt1 1280ms 2560ms random-static 37 0 38 39 [admin@device] /iot bluetooth advertisers set
Configurable settings are shown below:
Property | Description |
---|---|
ad-structures (string; Default: ) | Choose a pre-configured structure for the advertisement packets. For more information see the "AD structures" section. |
channel-map (37 | 38 | 39; Default: 37, 38, 39) | Channels used for advertising. |
disabled (yes | no; Default: yes) | An option to disable or enable the Bluetooth chip to broadcast advertising packets. |
max-interval (integer:20..10240; Default: 1280 ms) | The maximal interval for broadcasting advertising packets. |
min-interval (integer:20..10240; Default: 2560 ms) | The minimal interval for broadcasting advertising packets. |
own-address-type (public | random-static | rpa-fallback-to-public | rpa-fallback-to-random) | The MAC address that is going to be used in the advertising packet's payload:
|
note: Advertising packets will be broadcasted each min-interval > X < max interval milliseconds.
AD structures
This section allows you to define the payload for the advertising packets that are going to be broadcasted by the Bluetooth chip.
Currently, only 3 types are supported: 0x08 "Shortened Local Name"; 0x09 "Complete Local Name"; 0xFF "Manufacturer Specific Data".
You can check and set "AD structures" settings with the commands:
[admin@device] > iot bluetooth advertisers ad-structures print Columns: NAME, TYPE, DATA # NAME TYPE DATA 0 test short-local-name test [admin@device] > iot bluetooth advertisers ad-structures set
Configurable properties are shown below:
Property | Description |
---|---|
data (string; Default: ) | Define advertising packet's AdvData part of the payload |
name (string; Default: ) | Descriptive name of AD structure |
type (complete-local-name | manufacturer-data | short-local-name; Default: ) | An option to set AD structure's type:
|
If, for example, the "Shortened Local Name" type is chosen and the "data" field is configured with "test" → AdvData part of the payload is going to look like this:
05 08 54 45 53 54 (hexadecimal format)
, where the first octet (05) shows the length (5 bits) and the second octet (08) shows the type (Shortened Local Name). 3d, 4th, 5th and 6th (and etc) octets are the "data" [54 (hex)=T (ASCII), 45 (hex)=E (ASCII), 53 (hex)=S (ASCII), 54 (hex)=T (ASCII)].
The same applies to the "Complete Local Name" type. Only the second octet in the AdvData payload is going to differ and will be set to 09.
For the "Manufacturer Specific Data" type, you will need to configure the "data" field in the hexadecimal format. The second octet for this type is going to be set to FF.