5.4. Bluetooth (SUJ Si)
Warning
This section is specific to the dESSJ used for the Si SUJ
You first need to make sure you have a Bluetooth adapter on your PC
and said adapter is turned on. You can use GUI tools for this or the
command line tool hciconfig. For the Si SUJ, you will need to
place your Bluetooth adapter really close to the SUJ, so we recommend
using a USB3 extension cable and a USB Bluetooth dongle.
To test the dESSJ communication itself, you can use the
bluetoothctl command line tool. These tools are also useful to
find the MAC address of each dESSJ board. We recommend powering the
controllers one by one, so you can clearly identify with dESSJ BLE MAC
address correspond to which arm. Then write down each MAC address and
stick a label with the last 4 characters of the MAC address on each
SUJ arm.
5.4.1. hciconfig
hciconfiglist all Bluetooth adapters. In the examples below,hci0identifies the Bluetooth adapter foundsudo hciconfig hci0 downto stop Bluetoothsudo hciconfig hci0 upto start Bluetooth
5.4.2. bluetoothctl
5.4.2.1. Command line examples
bluetoothctl listto figure out if the computer has a Bluetooth adapterbluetoothctl devicesto list devices found. For Si SUJ,bluetoothctl devices| grep -i suj. Then note the MAC Address (Media Access Control Address) for the Arduino board on the dESSJbluetoothctl info 68:7E:57:32:FD:631to get info. UUID info is defined in ino (Arduino program)bluetoothctl connect 68:7E:57:32:FD:63
5.4.2.2. Interactive shell
Start bluetoothctl. When using bluetoothctl shell, note that
auto-complete works very well.
devicesto list available BT devices and find UUIDconnect 68:7E:57:32:FD:63, the MAC address will differ (but auto-complete helps)info 68:7E:57:32:FD:63, not required but will provide more data re. the Arduino BLEmenu gattto get access to attributeslist-attributesto see all attributesselect-attribute /org/bluez/hci0/dev_68_7E_57_32_FD_63/service000a/char000b, the service name will differ based on the MAC addressreadshould return the binary result as well as the human-readable string. You can repeat this command multiple times, or you can usenotify onandnotify offto get new values automaticallybackto get back to previous menudisconnect 68:7E:57:32:FD:63to disconnect