|
1 | 1 | ## AT commands
|
2 | 2 |
|
3 |
| -> **NOTE** incomplete |
| 3 | +The Bluetooth module and the F3 need to be configured to communicate at the same baud rate. The tutorial code initializes the UART1 serial device to a baud rate of 115200. The HC-05 Bluetooth module is configured at a baud rate of 9600 by default. |
| 4 | + |
| 5 | +The Bluetooth module supports an AT mode that allows you to examine and change its configuration and settings. To utilize the AT mode, connect the Bluetooth module to the F3 and FTDI as shown in the following diagram. |
4 | 6 |
|
5 | 7 | <p align="center">
|
6 | 8 | <img height=640 title="Bluetooth <-> Serial connection" src="assets/bluetooth-serial.png">
|
7 | 9 | </p>
|
8 | 10 |
|
9 |
| -Entering AT mode: |
10 |
| - |
11 |
| -- Power off the Bluetooth module |
12 |
| -- Press and hold the button on the Bluetooth module |
13 |
| -- Power on the Bluetooth module |
14 |
| -- Now, release the button |
| 11 | +Recommended steps to enter AT mode: |
15 | 12 |
|
16 |
| -> **TODO** blinking pattern |
| 13 | +- Disconnect the F3 and FTDI from your laptop. |
| 14 | +- Connect F3's GND pin to the Bluetooth's GND pin using a Female/Female (F/F) wire |
| 15 | + (preferably, a black one). |
| 16 | +- Connect F3's 5V pin to the Bluetooth's VCC pin using a F/F wire (preferably, a |
| 17 | + red one). |
| 18 | +- Connect the FTDI RXI pin to the Bluetooth's TXD pin using a Female/Male (F/M) wire. |
| 19 | +- Connect the FTDI TXO pin to the Bluetooth's RXD pin using a Female/Male (F/M) wire. |
| 20 | +- Now connect the FTDI to your laptop via USB cable. |
| 21 | +- Next connect the F3 to your laptop via USB cable while simultaneously pressing and holding the button on the Bluetooth module (kinda tricky). |
| 22 | +- Now, release the button and the Bluetooth module will enter AT mode. You can confirm this by observing that the red LED on the Bluetooth module is blinking in a slow pattern (approx 1-2 seconds on/off). |
17 | 23 |
|
18 |
| -The AT mode always operates at a baud rate of 38,400. |
| 24 | +The AT mode always operates at a baud rate of 38400, so configure minicom/putty for that baud rate and connect to the FTDI device. |
19 | 25 |
|
20 |
| -Commands (via minicom) |
| 26 | +When your serial connection to the FTDI is established, you may get a bunch of `ERROR: (0)` repeatedly being displayed. If this happens, just hit ENTER to stop the errors. |
21 | 27 |
|
22 |
| -- Sanity check |
| 28 | +### Sanity check |
23 | 29 |
|
24 | 30 | ```
|
25 | 31 | $ at
|
26 | 32 | OK
|
27 | 33 | OK
|
28 |
| -(..) |
| 34 | +(etc...) |
29 | 35 | ```
|
30 | 36 |
|
31 | 37 | Answers `OK` repeatedly until you hit ENTER again.
|
32 | 38 |
|
33 |
| -- Rename |
| 39 | +### Query for the current baud rate of the Bluetooth module |
34 | 40 |
|
35 | 41 | ```
|
36 |
| -$ at+name=ferris |
| 42 | +at+uart? |
| 43 | ++UART:9600,0,0 |
| 44 | +OK |
| 45 | ++UART:9600,0,0 |
37 | 46 | OK
|
| 47 | +(etc ...) |
38 | 48 | ```
|
39 | 49 |
|
40 |
| -- Change the baud rate |
| 50 | +### Change the baud rate |
41 | 51 |
|
42 | 52 | ```
|
43 | 53 | $ at+uart=115200,0,0
|
|
0 commit comments