RUTX11 Bluetooth: Difference between revisions

From Teltonika Networks Wiki
(Created page with "== Summary ==")
 
No edit summary
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Summary ==
{{Template: Networking_rutos_manual_bluetooth
<!------------------------DEVICE----------------------->
| name  = RUTX11
| series = RUTX
}}

Latest revision as of 12:19, 2 September 2020

Main Page > RUTX Routers > RUTX11 > RUTX11 Manual > RUTX11 WebUI > RUTX11 Services section > RUTX11 Bluetooth

The information in this page is updated in accordance with firmware version RUTX_R_00.07.10.2.

Summary

The Bluetooth page contains information and settings related to the connected BT accessories. This chapter is an overview of the Bluetooth window in RUTX11 devices working with confirmed accessories and sensors, performance and displayed data may differ using other Bluetooth devices.

If you're having trouble finding this page or some of the parameters described here on your device's WebUI, you should turn on "Advanced WebUI" mode. You can do that by clicking the "Advanced" button, located at the top of the WebUI.

General Settings

The General Settings section is used to turn RUTX11's Bluetooth on or off and scan for other nearby Bluetooth devices. Before you can scan and pair devices, you must first turn Bluetooth on (it is disabled by default):

Available Devices

The Available Devices section displays a list of Bluetooth devices that are within range of the RUTX11. In order to see available devices, please make sure that Bluetooth is enabled and click the 'Scan' button.

In order to pair RUTX11 with another Bluetooth device, place a checkmark under the 'Pair' column next to that device and click 'Pair'.

If the pairing was successful, you should see the Bluetooth device appear under Paired Devices.

Paired Devices

The Paired Devices section displays a list of Bluetooth that have been paired with this RUTX11.

To view the information of a paired Bluetooth device, click the 'Details' button.

The Data page for a device may look similar to this, but the contents depend on the type of the Bluetooth device:


If you wish to unpair a Bluetooth device, place a checkmark under the 'Unpair' column next to that device and click 'Unpair'. If you have more than one device you should press 'Unpair all' option it works without checking checkmarks.

ubus commands

This section contains instructions on how to use ubus commands in order scan and pair with Bluetooth devices.

The ubus command line tool provides the possibility to interact with the ubusd server (with all currently registered services). It uses the JSON format for calling procedures with parameters and returning responses.

Before you start using ubus commands to control Bluetooth, make sure that Bluetooth is turned on in the General Settings section.


You must first initialize blesemd. You can do that by executing blesemd -D command. The output should look similar to this:

...
root@Teltonika-RUTX11:~# blesemd -D
Initializing blesemd...
Warning: debug messages will be shown!
Preparing bluetooth interface...
Reading config...
Devices loaded: 0
Creating database...
modbus_data table already exists
SENT_ID_TABLE already exists
Create DB done
Initializing uloop...
Connecting to ubus...
Initializing BLE device...
Initializing BLE ubus interface...
Adding ubus object...
...

Run scan.start to start Bluetooth scan:

...
ubus call blesem scan.start
...

To see scan results, use command scan.result:

...
ubus call blesem scan.result
...

The scan process takes about 30 seconds. If you see "scanning": 1 in the output it means that scanning is still in progress. Once the scanning has finished, the scan.result output should look similar to this:

...
{ 
      "scanning": 0, 
      "devices": [ 
              { 
                      "name": "RT_T", 
                      "rssi": -72, 
                      "address": "FF:CB:FF:6F:23:FB" 
              } 
      ] 
}
...

The list of device parameters will always contain"rssi" and "address", while the existence of "name" will depend on whether the paired Bluetooth supports it or not.

...
{ 
      "scanning": 0, 
      "devices": [ 
              {  
                      "rssi": -42, 
                      "address": "2F:2A:0A:0A:7A:AA" 
              },
              { 
                      "name": "RT_T", 
                      "rssi": -77, 
                      "address": "CF:0A:52:5E:35:D7" 
              } 
      ] 
}
...

In order to pair devices use the pair command and specify the device's MAC address:

...
ubus call blesem pair '{"address":"FF:CC:FF:6A:23:CB"}'
...

If the pairing process was successful you should see an output similar to this:

...
{ 
      "success": "device successfully paired" 
}
...

--- To get the statistics from paired devices, use the stat command and specify the device's MAC address:

...
ubus call blesem stat '{"address":"FF:CB:FA:6A:23:CB"}'
...

The output should look similar to this:

...
{ 
      "success": "successfully requested status",
      "model": "3901",
      "battery": 98,
      "temperature": "20.34",
      "humidity": 20,
      "firmware": "23",
.
}
...