[MyHosting.com]   [KO4BB Home Page]   [Manuals Home Page]   [KO4BB Wiki]
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bluetooth:notes_on_hc-05_module [2018/03/03 08:22]
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.+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):
-    - Hold pin 11 high while applying power (once power is applied, pin 11 may return to open/​ground) +    - Hold pin 11 high while applying power (once power is applied, pin 11 may return to open/​ground). In this case, the baud rate is fixed at 38,400 bauds. 
-    - 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. +    - 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 casethe baud rate is the rate defined by command AT+UART
-  * When the module is in command modeit always talks at 38400 bauds, regardless of baud rate setting.+
   * 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 20: Line 20:
 This is compounded by the fact that the HC-05 can only be paired with one master at a time. Once you pair an HC-05 with a device, it will forget whatever device it may have been paired with previously. However, the device it was paired with previously may remember it yet it will not be able to reconnect unless you "​forget"​ it and pair again. This can get aggravating,​ even more so if you try to explain that to a non-technical person. This is compounded by the fact that the HC-05 can only be paired with one master at a time. Once you pair an HC-05 with a device, it will forget whatever device it may have been paired with previously. However, the device it was paired with previously may remember it yet it will not be able to reconnect unless you "​forget"​ it and pair again. This can get aggravating,​ even more so if you try to explain that to a non-technical person.
  
-To alleviate this problem, I rename my modules HC05-XXXX where XXXX are the last 4 digits of the MAC address.+To alleviate this problem, I rename my modules HC05-XXXX where XXXX are the last 4 digits of the MAC address. This makes it very unlikely that any 2 modules I am working with have the same name. I put a sticker on the HC-05 module with the last 4 of the MAC address and I know exactly which module I am connected to.
  
-You can query the MAC address of an HC-05 module with command AT+ADDR? It will return a string like this"​+ADDR:​2017:​5:​152449. This represents MAC address 20:​17:​05:​15:​24:​49 in conventional notation. ​ So in this example, I would rename the module HC05-2449 using command "​AT+NAME=HC05-2449"​+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"
  
-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. Even if you tell Android to forget the device, it will remember the name-MAC address as a set. 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.+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.
  
  
  
 
bluetooth/notes_on_hc-05_module.txt · Last modified: 2018/03/03 08:37 by ko4bb
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Except as noted, this entire site Copyright © 2002-2017. KO4BB All rights reserved.