cancel
Showing results for 
Search instead for 
Did you mean: 

How to get 'gatttool' command to work

FFont.1
Associate II

Hi,

I'm working with the stm32mp157f-dk2 and with OpenSTLinux and I'm trying to create a GATT service for provisioning the wifi credentials.

The problem is, according to https://wiki.st.com/stm32mpu/wiki/How_to_scan_BLE_devices I should be able to run the gatttool command. Unfurntently I'm not.

I have already re-flashed the OpenSTLinux and I also have reprogrammed the kernel.

I'm running the OpenSTLinux 5-4 20-11-12.

What should I do? I have also tried the apt-get install command..

Thanks,

Fernando Fontes

1 ACCEPTED SOLUTION

Accepted Solutions
Jean-Marc B
ST Employee

Hi @FFont.1​ 

The gatttool is available after installing the package bluez5-noinst-tools :

root@stm32mp1:~# apt-get install bluez5-noinst-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  bluez5-noinst-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
...
root@stm32mp1:~# which gatttool
/usr/bin/gatttool
root@stm32mp1:~# gatttool -h
Usage:
  gatttool [OPTION?]
 
Help Options:
  -h, --help                                Show help options
  --help-all                                Show all help options
  --help-gatt                               Show all GATT commands
  --help-params                             Show all Primary Services/Characteristics arguments
  --help-char-read-write                    Show all Characteristics Value/Descriptor Read/Write arguments
 
Application Options:
  -i, --adapter=hciX                        Specify local adapter interface
  -b, --device=MAC                          Specify remote Bluetooth address
  -t, --addr-type=[public | random]         Set LE address type. Default: public
  -m, --mtu=MTU                             Specify the MTU size
  -p, --psm=PSM                             Specify the PSM for GATT/ATT over BR/EDR
  -l, --sec-level=[low | medium | high]     Set security level. Default: low
  -I, --interactive                         Use interactive mode

Best regards

JM

View solution in original post

2 REPLIES 2
Olivier GALLIEN
ST Employee

Hi @FFont.1​ ,

I understand Gattool is provided by gattlib module.

Is it the one you tried to app-get ?

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Jean-Marc B
ST Employee

Hi @FFont.1​ 

The gatttool is available after installing the package bluez5-noinst-tools :

root@stm32mp1:~# apt-get install bluez5-noinst-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  bluez5-noinst-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
...
root@stm32mp1:~# which gatttool
/usr/bin/gatttool
root@stm32mp1:~# gatttool -h
Usage:
  gatttool [OPTION?]
 
Help Options:
  -h, --help                                Show help options
  --help-all                                Show all help options
  --help-gatt                               Show all GATT commands
  --help-params                             Show all Primary Services/Characteristics arguments
  --help-char-read-write                    Show all Characteristics Value/Descriptor Read/Write arguments
 
Application Options:
  -i, --adapter=hciX                        Specify local adapter interface
  -b, --device=MAC                          Specify remote Bluetooth address
  -t, --addr-type=[public | random]         Set LE address type. Default: public
  -m, --mtu=MTU                             Specify the MTU size
  -p, --psm=PSM                             Specify the PSM for GATT/ATT over BR/EDR
  -l, --sec-level=[low | medium | high]     Set security level. Default: low
  -I, --interactive                         Use interactive mode

Best regards

JM