You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* ESP-Hosted related BR/EDR 4.2 and BLE 4.2 functionalities are tested with `bluez` 5.43+.
120
+
* ESP-Hosted related BR/EDR 4.2 and BLE 4.2 functionalities are tested with `bluez` 5.50+.
121
121
Whereas BLE 5.0 functionalities are tested with `bluez` 5.45+.
122
122
* We suggest latest stable `bluez` version to be used. Any other bluetooth stack instead of `bluez` also could be used.
123
123
* To upgrade `bluez` for particular version, follow this [link](https://scribles.net/updating-bluez-on-raspberry-pi-from-5-43-to-5-50/). Replace bluez `older version` to `expected version` while following mentioned link.
124
124
125
125
#### 2.1.1 GATT server
126
-
127
-
1. Go to `bluez-5.xx` folder. Run `./test/example-gatt-server`. This will start GATT server on Raspberry-Pi.
128
-
129
-
2. Now start advertising. Run `sudo hciconfig hci0 leadv`.
130
-
131
-
3. Now ESP peripheral's mac address should be listed in scan list of mobile app.
132
-
133
-
4. Connect to ESP peripheral's mac address with mobile as GATT client.
134
-
135
-
5. Check read/write characteristics fields in `Heart Rate` service.
126
+
Steps:
127
+
1. Run `sudo bluetoothctl`.
128
+
2. Run `list` to get MAC address of ESP32.
129
+
3. To set device name, run `menu advertise`. Then `name <enter_any_name>`.
130
+
4. To come back to main menu, run `back`.
131
+
5. To start advertising, run `advertise on`.
132
+
Perform below steps on Mobile Phone:
133
+
6. Turn on mobile phone's bluetooth. Open nRF connect application, ESP32's MAC address will be displayed under `SCANNER` tab as a result of scan.
134
+
7. Click on connect. Client tab will be open. Click on `Generic Attribute` option.
135
+
8. Perform read/write on listed characteristics fields in `Generic Attribute` service.
136
+
To disconnet:
137
+
9. Run `disconnect <MAC_ADDRESS_of_gatt_client>` on linux host's `bluetoothctrl` OR click on `DISCONNECT` in nRF connect application's `GATT client` screen.
136
138
137
139
#### 2.1.2 GATT Client
138
140
139
-
1. Run `./test/example-gatt-client` on Raspberry Pi. This will start GATT client on Raspberry Pi.
140
-
141
-
2. You should see a `Heart Rate Measurement` field in Raspberry Pi console.
141
+
1. Run `sudo bluetoothctl`.
142
+
2. To Turn on power, run `power on`.
143
+
3. Make device discoverable, run `discoverable on`.
144
+
4. Make device pairable, run `pairable on`.
145
+
5. Set current agent to default, run `default-agent`.
146
+
6. Turn on bluetooth support, run `agent on`.
147
+
7. Turn on mobile phone's bluetooth so that linux host can detect it.
148
+
8. Start scanning, run `scan on`.
149
+
9. Once mobile phone's MAC address is listed in scan list, stop scanning, run `scan off`.
150
+
10. Start btmon to collect log in separate terminal window, run `sudo btmon &`.
151
+
11. To trust, run `trust <MAC address of mobile phone>`.
152
+
12. To pair, run `pair <MAC address of mobile phone>`.
153
+
13. To connect, run `connect <MAC address of mobile phone>`.
154
+
14. Once connected, please run `discoverable off`.
155
+
15. Go to gatt menu, run `menu gatt`.
156
+
16. list available attributes, run `list-attributes`.
157
+
17. select characteristic of service, run `select-attribute <characteristic_of_service>`.
158
+
18. perform read/write operation on selected characteristic.
159
+
19. To disconnect, run `disconnect <MAC_ADDRESS_of_gatt_server>`.
142
160
143
161
#### 2.1.3 BT scan
144
162
@@ -191,46 +209,14 @@ Steps:
191
209
BLE 5.0 has backword compability. It can connect with BLE4.2 devices.
192
210
Below example demonstrate linux host as GATT server and mobile phone as GATT client. We are using `nRF connect` application for GATT client operartion.
193
211
194
-
Execute following steps on linux host.
195
-
Steps:
196
-
1. Run `sudo bluetoothctl`.
197
-
2. Run `list` to get MAC address of ESP32.
198
-
3. To set device name, run `menu advertise`. Then `name <enter_any_name>`.
199
-
4. To come back to main menu, run `back`.
200
-
5. To start advertising, run `advertise on`.
201
-
Perform below steps on Mobile Phone:
202
-
6. Turn on mobile phone's bluetooth. Open nRF connect application, ESP32's MAC address will be displayed under `SCANNER` tab as a result of scan.
203
-
7. Click on connect. Client tab will be open. Click on `Generic Attribute` option.
204
-
8. Perform read/write on listed characteristics fields in `Generic Attribute` service.
205
-
To disconnet:
206
-
9. Run `disconnect <MAC_ADDRESS_of_gatt_client>` on linux host's `bluetoothctrl` OR click on `DISCONNECT` in nRF connect application's `GATT client` screen.
212
+
Follow section [2.1.1](#211-gatt-server) for GATT server connections.
207
213
208
214
#### 2.2.3 GATT client
209
215
210
216
BLE 5.0 has backword compability. It can connect with BLE4.2 devices.
211
217
Below example demonstrate linux host as GATT client and mobile phone as GATT server. We are using `nRF connect` application for GATT server operartion.
212
218
213
-
Execute following steps on linux host.
214
-
Steps:
215
-
1. Run `sudo bluetoothctl`.
216
-
2. To Turn on power, run `power on`.
217
-
3. Make device discoverable, run `discoverable on`.
218
-
4. Make device pairable, run `pairable on`.
219
-
5. Set current agent to default, run `default-agent`.
220
-
6. Turn on bluetooth support, run `agent on`.
221
-
7. Turn on mobile phone's bluetooth so that linux host can detect it.
222
-
8. Start scanning, run `scan on`.
223
-
9. Once mobile phone's MAC address is listed in scan list, stop scanning, run `scan off`.
224
-
10. Start btmon to collect log in separate terminal window, run `sudo btmon &`.
225
-
11. To trust, run `trust <MAC address of mobile phone>`.
226
-
12. To pair, run `pair <MAC address of mobile phone>`.
227
-
13. To connect, run `connect <MAC address of mobile phone>`.
228
-
14. Once connected, please run `discoverable off`.
229
-
15. Go to gatt menu, run `menu gatt`.
230
-
16. list available attributes, run `list-attributes`.
231
-
17. select characteristic of service, run `select-attribute <characteristic_of_service>`.
232
-
18. perform read/write operation on selected characteristic.
233
-
19. To disconnect, run `disconnect <MAC_ADDRESS_of_gatt_server>`.
219
+
Follow section [2.1.2](#212-gatt-client) for GATT client connections.
234
220
235
221
#### 2.2.4 1M, 2M, CODED phy for LE
236
222
@@ -256,8 +242,9 @@ Steps:
256
242
3. Connect to BLE5.0 device using above mentioned steps in section 2.2.1.
257
243
4. while executing connect command, there is `LE Enhanced Connection Complete` event in `btmon` log. Note down `handle` value.
258
244
5. After connection, exit form bluetoothctl. Run `exit` in bluetoothctl.
259
-
6. Now configure phy into 2M. Run `sudo hcitool cmd 08 32 <handle_value> 03 02 02 00`.
260
-
7. Follow gatt read/write from `gatt menu` in bluetoothctl.
245
+
6. Now configure phy into 2M. Run `sudo hcitool cmd 08 32 <handle value in two bytes in little endian format > 03 02 02 00 00`.
0 commit comments