Skip to main content
FFont.1
Associate II
March 9, 2021
Solved

How to get 'gatttool' command to work

  • March 9, 2021
  • 2 replies
  • 3315 views

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

This topic has been closed for replies.
Best answer by Jean-Marc B

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

2 replies

Olivier GALLIEN
ST Technical Moderator
March 15, 2021

Hi @FFont.1​ ,

I understand Gattool is provided by gattlib module.

Is it the one you tried to app-get ?

Olivier

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
Jean-Marc BBest answer
ST Employee
March 31, 2021

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