Stock Bluetooth module
The stock BT module answer with AT command AT+VERSION
+VERSION=+BOLUTEK Firmware V2.2, Bluetooth V2.1
Chip: BK3231
It looks like BOLUTEK BC-04
JDY-31 from aliexpress answer the same, looks the same, works the same.
Also I tryed module with chip BK3432. PCB was marked as BC-04. It responced as +VERSION=V2.0.1
Command | Description |
---|---|
AT | Check if the command terminal work normally |
AT+VERSION | Get firmware, bluetooth, HCI and LMP version |
AT+NAME | Get/Set local device name |
AT+PIN | Get/Set pin code for pairing |
AT+BAUD | Get/Set baud rate |
AT+ENABLEIND | Enable/Disable Indication print |
AT+UARTMODE | Get/Set uart stop bits and parity |
What about HC-05 / HC-06
You can use HC-05 and HC-06 with DPS. It works rather well except “Communication” menu. As the default configuration suits our application, then we can use HC-05/06 immediately. Notice about supply voltage as DPS UART socket has 3.3V outlet.
Defaul settings for НС-05/06:
- Baud rate = 9600
- Role = Slave
Difference between HC-05 and HC-06:
HC-05 can work as a master or as a slave. There is a pin (key) to enter AT command mode. There is the led indication for AT command mode. Default baud rate for AT command mode 38400.
HC-05 most useful AT commands are
AT : Ceck the connection.
AT+NAME : Default name
AT+ADDR : Default address
AT+VERSION : Get version
AT+UART : Set\Get baudrate
AT+ROLE: Set\Get role (1=master/0=slave)
AT+RESET : Reset and exit AT mode
AT+ORGL : Restore factory settings
AT+PSWD: Set\Get password
Entering HC-05 Command Mode
HC-05 is put in Command Mode by setting the CMD pin to logic High. There is one important point the user should be aware of when setting the device in Command Mode – the baud rate may assume a different value depending on the instance the CMD pin is switched to high:
- If HC-05 is powered ON with CMD pin to +Vcc, the UART is set to 38400bps, 8 data bits, 1 stop bit, no parity, no handshake.
- If the HC-05 is powered ON with the CMD pin at logic low (or open circuit), and then pulled High a moment later, the UART parameters assumes a set of values that was previously fixed using the AT+UART command, with 9600bps, 8 data bits, 1 stop bit, no parity, and no handshake as default parameter values.
HC-06 can work only as a slave. There is no a pin (key) to enter AT command mode, no led indication. It accepts a short list of AT command. Default baud rate for AT command mode allways 9600. Unlike HC05, you can’t see the default name or baud rate. You can only change them. To change name type AT+NAMEnewname, notice that there should be no space between the command and name. The module will reply OKnewname.
HC 06 AT command list is limited:
AT : check the connection
AT+NAME: Change name. No space between name and command.
AT+BAUD: change baud rate, x is baud rate code, no space between command and code.
AT+PIN: change pin, xxxx is the pin, again, no space.
AT+VERSION
The HC-06 is permanently configured as a slave Bluetooth device. It works under the following default configuration:
Baud Rate: 9600 bps
Data : 8 bits
Stop Bits: 1 bit
Parity : None
Handshake: None
Passkey: 1234
As the default configuration suits our application, then we can use HC-06 immediately. Once it is paired to a master Bluetooth device, its operation becomes transparent to the user. No user code specific to the Bluetooth module is needed at all in
the user microcontroller program.
The HC-06 automatically sets itself up in Command Mode when it is not remotely connected (paired) to any other Bluetooth device. You can change the Passkey, Device Name, and Baud Rate while the HC-06 is in Command Mode by entering a small subset of AT style commands. Any changes made will be retained even after power is removed from the HC-06, hence device configuration setup must not be repeated unless new
changes need to be made.
You can do configuration setup using a PC running a terminal software using a serial to TTL (or USB to Serial TTL) converter. It is important to note that HC-06 does not wait for any termination character for each AT command entry. Instead, it acts to whatever character you entered after one second. Hence, if you are not able to complete a command entry within a second,
it will be ignored. Because of this behavior, it may be extremely difficult to do manual entry configuration using Windows Hyperterminal software. Terminal software that allows batch sending of multiple characters must be used.