This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
bluetooth:notes_on_hc-05_module [2018/03/03 08:31] ko4bb |
bluetooth:notes_on_hc-05_module [2018/03/03 08:37] ko4bb |
||
---|---|---|---|
Line 3: | Line 3: | ||
The HC-05 Bluetooth module is widely available and inexpensive. | The HC-05 Bluetooth module is widely available and inexpensive. | ||
- | A lot of information is available on the Internet so I am not going to repeat everything here, just some notes and observations that may not be obvious even after plenty of Googling. One of the better pages is [[https://arduino-info.wikispaces.com/BlueTooth-HC05-HC06-Modules-How-To|arduino-info.wikispaces.com/BlueTooth-HC05-HC06-Modules-How-To]] | + | A lot of information is available on the Internet so I am not going to repeat everything here, just some notes and observations that may not be obvious even after plenty of Googling. \\ |
+ | One of the better pages is [[https://arduino-info.wikispaces.com/BlueTooth-HC05-HC06-Modules-How-To|arduino-info.wikispaces.com/BlueTooth-HC05-HC06-Modules-How-To]] | ||
* There are 2 ways to put the module in command mode (so that it responds to AT commands): | * There are 2 ways to put the module in command mode (so that it responds to AT commands): | ||
Line 9: | Line 10: | ||
- Hold pin 11 at any time after having applied power. If so, pin 11 must be held high until you are done with AT commands. In this case, the baud rate is the rate defined by command AT+UART | - Hold pin 11 at any time after having applied power. If so, pin 11 must be held high until you are done with AT commands. In this case, the baud rate is the rate defined by command AT+UART | ||
* There are many firmware versions, there may be very significant differences between the versions. | * There are many firmware versions, there may be very significant differences between the versions. | ||
- | - Some will not let you go to command mode, or will severely limit the kind of commands available. | + | - Some will not let you go to command mode, or will severely limit the kind of commands available. Stay away from modules sold as HC-06 as they are very limited and cost the same, but even some HC-05 have limitations. |
- If you can, make sure to buy modules that can be put in Master mode, they tend to have better firmware. | - If you can, make sure to buy modules that can be put in Master mode, they tend to have better firmware. | ||
* When you change a setting, it is automatically saved. Some settings take effect immediately, some wait until you reboot | * When you change a setting, it is automatically saved. Some settings take effect immediately, some wait until you reboot | ||
Line 22: | Line 23: | ||
You can query the MAC address of an HC-05 module with command "AT+ADDR?\r\n" It will return a string like this"+ADDR:2017:5:152449. This represents MAC address 20:17:05:15:24:49 in conventional dot (or colon) notation. So in this example, I would rename the module HC05-2449 using command "AT+NAME=HC05-2449\r\n" | You can query the MAC address of an HC-05 module with command "AT+ADDR?\r\n" It will return a string like this"+ADDR:2017:5:152449. This represents MAC address 20:17:05:15:24:49 in conventional dot (or colon) notation. So in this example, I would rename the module HC05-2449 using command "AT+NAME=HC05-2449\r\n" | ||
+ | |||
+ | A quirk: even though the "AT+NAME=XXXX" command works fine on my modules (with version of "hc01.comV2.1"), the AT+NAME? command is totally ignored and returns nothing (no OK, no ERROR). This may be due to the particular firmware in my modules. | ||
When you pair a Bluetooth device with an Android device, Android remembers the Bluetooth device by its name and its MAC address but it only displays the name when you are in the Bluetooth settings page. Even if you tell Android to forget the device, it will remember the name-MAC address as a set (at least for a while). So if you previously paired a module to your phone as HC-05, change the name of the module to, say, HC05-2449 and try to pair it again, Android will show it under the old name HC-05, even if you have told Android to forget the device (at least on Android 5.1). Once you pair with it again however, the name will then change to the new name. | When you pair a Bluetooth device with an Android device, Android remembers the Bluetooth device by its name and its MAC address but it only displays the name when you are in the Bluetooth settings page. Even if you tell Android to forget the device, it will remember the name-MAC address as a set (at least for a while). So if you previously paired a module to your phone as HC-05, change the name of the module to, say, HC05-2449 and try to pair it again, Android will show it under the old name HC-05, even if you have told Android to forget the device (at least on Android 5.1). Once you pair with it again however, the name will then change to the new name. |