Tuesday, September 27, 2011

HC05 Firmware


Hello,

Let's take a look to the HC05 firmware.
This one offers a wider range of AT command set.
With these AT commands you can set the module to master or slave devices.
I will not describe all the AT command since you can refer to online documentation.

Before going on, you had to know that entering in the AT mode is a bit more difficult with HC05 firmware.

This firmware provides 2 ways to activate AT mode :
The first way is described as below :
    • set low level on PIN34
    • Supply power to the module
    • set high level on PIN34
Then the module will enter on AT mode without your configured baud rate (default : 9600 8N1)

The second way :
    • set high level on PIN34,
    • Supply power to the module
The module will ALWAYS enter in AT mode with a 38400 baud rate (8N1).

The second way is kind useful if you don't remember your configured baud rate.

As you probably notice, AT mode can be reached only when PIN34 is high.

Moreover sending AT commands is different from the HC06 firmware (Linvor). In HC05 firmware you have to send CR and LF after each command.

For your information, here comes some useful AT commands :
    • AT\r\n AT test command should respond OK\r\n
    • AT+ROLE=1\r\n Set master mode
    • AT+ROLE=0\r\n Set slave mode
    • AT+VERSION?\r\n Get the firmware version
    • AT+UART=115200,1,2\r\n Set the baud rate to 115200 (8E2)
    • AT+PIO=10,1\r\n Set PIO10 to high level

Further information can be found in this documentation.

That's it for now...

The next article will answer this question : Can I upload a HC05 onto a linvor module ?



50 comments:

  1. Do you know if hc05 fw have more serialpins connected/programmed as tx and rx ?

    ReplyDelete
  2. there's only one UART port connection... it's due to the CSR chip not the firmware version.

    Why do you want more serial pins ?

    ReplyDelete
  3. well i mean DSR, DCD and DTR serialport signals,

    ReplyDelete
  4. Where can I find the HC05 FW to download?

    ReplyDelete
  5. Ay the end of the following post :
    http://byron76.blogspot.com/2011/09/i-hope-you-have-good-time-soldering.html

    ReplyDelete
  6. in the "Flashing a new firmware" post

    ReplyDelete
  7. Sorry for the last answer, but the has been extract on board from suntek, website. See my second post

    ReplyDelete
  8. Byron would like a help!

    I upgraded the firmware hc05, I think we've succeeded! But now I'm able to send any AT command! When I turn on the module, the LED blinks, detect the bluetooth module for the PC! I'm sending the command AT \ r \ n, it returns nothing!
    I noticed something when I turn on the module with the pin 34 high LED flashes more slowly! Can you help me?
    Thank you!

    ReplyDelete
    Replies
    1. If you want to enable AT mode, your module must not be paired with another Bluetooth device.

      Delete
  9. Hi Byron,

    Thank you for your great work with this Bluetooth module.

    I have a (maybe silly) question:

    - Is it possible to pair with PC via Bluetooth and use AT commands to control GPIO (PIO pins) remotely?

    I'm asking it because I don't want to use it just like a BT/Serial interface, if I have remote GPIO access I can control external things directly from an Android phone without using a microcontroller in the other end to control devices.

    In fact the CSR chip is already an uC, then I can use its GPIO to control anything, but I don't know if the firmware allow me to do it remotely. I think these AT commands to control PIO pins needs to be executed locally (over serial), but maybe I can control it over BT connection as well.

    Could you please confirm or not if it is feasible?

    Best Regards,

    Alan

    ReplyDelete
    Replies
    1. hai..... i am using this module for my BE final year project...

      i need to use GPIO pins or CTS,RTS pin with matlab....how can i read or put a bit(high/low) through this pins......Tx, Rx fine no problem.

      why i am asking this because,when GPIO pin is set high/low, i need to start data acquisition from my ADC.Please need idea.

      Thanks & Regards

      Ikram khan
      ikramkhan11692@gmail.com

      Delete
  10. Nop !

    Since AT mode could not be enable when your module is paired it is not possible !

    But... you can make your own firmware if you have some basic C/C++ skills ... This is the subject of the next post... don't expect it soon !

    ReplyDelete
    Replies
    1. hai..... i am using this module for my BE final year project...

      i need to use GPIO pins or CTS,RTS pin with matlab....how can i read or put a bit(high/low) through this pins......Tx, Rx fine no problem.

      why i am asking this because,when GPIO pin is set high/low, i need to start data acquisition from my ADC.
      please Tell me how to activate this pin to read with matlab?
      Thanks & Regards

      Ikram khan
      ikramkhan11692@gmail.com

      Delete
  11. Hi Byron,

    Thank you very much.

    I'm also an embedded system developer with Linux (uClinux) background and a little bit of RTOS (mainly NuttX). I just received my Bluetooth module (from dealextreme) yesterday night.
    I read the manual but didn't see nothing about remote AT commands.

    Did you already compile some code and put it in our flash device?

    Best Regards,

    Alan

    ReplyDelete
  12. Do you really need to fiddle with pin 34 to change the Radio name? I've got one from DX with male headerpins with heatshrink around it.

    ReplyDelete
  13. Hi!

    This link is no longer working:
    http://dl.free.fr/d8j4i42Wi
    Can you upload the HC05 firmware somewhere else? or send it via email ... you can send to: spam at croler net
    Thanks!

    ReplyDelete
  14. the link seems to work for me !!
    could you try this one and upload it somewhere for me ? http://dl.free.fr/dfcnuH9Wn

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Hi Byron, thanks for your blog, I was able to flash HC05/linvor firmware to the module.

    SPI link over LPT works all right. Settings for UART is 38.4/1806 (default) [im]https://lh6.googleusercontent.com/-qwGVHOkG5uI/T2tU1PW-TYI/AAAAAAAADdI/gLrtQ43o_TY/s800/terminal.jpg[/im]

    Module pulls TX down for 500ms from time to time not accepting AT+ROLE=1 etc. TX does not react on RX whatsoever.

    I've using RS232 communication accordingly to datasheet.
    That's the signal on RX pin [im]https://lh3.googleusercontent.com/-xf2HtrwsUSw/T2tVGt1l-VI/AAAAAAAADdY/nG5wkqxCKdk/s800/RX-Bluetooth.jpg[/im]

    RX pin gets valid UART 3.3v incoming signal from MAX3232 chip.


    What can be wrong, why it does not answer UART connection?

    ReplyDelete
    Replies
    1. Short links for images - Blogspot does not allow to include it in comments
      http://goo.gl/eOOXp
      http://goo.gl/o57uy

      Delete
  17. Hi Byron, great work. Just a question. You say: "Then the module will enter on AT mode without your configured baud rate" (regarding the first way to get into AT mode)
    I understand from the datasheet however that if you choose that option you actually get in on AT mode WITH the configured baudrate.
    Am I wrong or is it just a type?

    ReplyDelete
    Replies
    1. it seems to be a typo, I've noticed it too

      Delete
  18. hi Byron
    i have a module blue tooth, when i power it, it automatic into work mode, pin32 high level before paired, after paired, it get low level. i can't force it into AT command mode although i did 2 way u decribed. i don't receive "OK" when i send AT\r\n command
    Thanks

    ReplyDelete
  19. Hello,
    kinda new to this, not sure what you mean by "set low level and high level" ? Is that GND and the 3.3V cables ?
    So i touch pin34 with ground cable, keep it there, bring power to the chip, then touch pin34 with a 3.3 V ?
    Won't that make an electric short circuit?
    thanks

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  20. Hi Byron,

    How can I know if the module is HC-06 or HC-05? Because I couldn´t enter in the Master Mode ever.

    I am affraid my module is not HC-05.

    Thank you!

    Alexandre.

    ReplyDelete
    Replies
    1. Use AT+VERSION the response OKlinvor1.5 means it's HC-06
      The other difference is that the HC-06 dosen't need \r\n in the end of AT commands.

      Delete
  21. 1) at some point in the communication process the HC-05 is "INQUIRING". I thought I could stop this mode with the command "AT+INQC" but when I check the state, I am still inquiring. 2) the only way I can leave that mode is to "pair" the HC-05 with my PC. I am able to "pair" the HC-05 with my PC (running window 8)I check the state and it confirms they are paired. I belive I need to connect next. So I issue the command "AT+LINK=". I get FAIL. I can't get past this point. Can you help? provide some step by instructions (along with when I should or should not key the HC-05) to help me get connected? Is there a potential problem Windows 8? Thoughts on why I continue to receive the "FAIL" message? Thanks...

    ReplyDelete
    Replies
    1. Try to reset to factory settings perhaps or check this http://goo.gl/5tZr1 may help

      Delete
  22. Hi, Byron,

    I looks as if you are not following this blog very closely, but just in case you come back or another reader has info:

    Is there any way to send commands or serial data to and from the module using the SPI port rather than the UART? The reason is that in some applications it is not possible to match higher async baud rate, eg: for ATMega chip at 16 MHz the highest standard UART rate which works may be 115,200 bps, tho the module is capable of much more. So if I could send/receive serial data via the SPI port, it would be very helpful.

    ReplyDelete
    Replies
    1. For that you have to change the firmware

      Delete
    2. This tiny thing has a USB Interface... but still as stated, need a custom firmware (BlueLab / XIDE)

      Delete
    3. Hi Hillel,

      I think you aware of https://github.com/pfalcon/blutunode since I can see your comments at author blog: http://pfalcon-oe.blogspot.com.br/2012/04/opensource-sensor-node-firmware-for.html

      This is an open-source firmware for BlueCore4-Ext chip.

      I think original author has not more interest/time to keep working on this REALLY NICE project.

      Delete
  23. Developing a wireless Audio or Data accessory can become a tedious, expensive and risky project. By offering a fully integrated solution with certifiedBluetooth Module the associated development kits and Smart Phone Apps

    ReplyDelete
  24. hi guys i have HC-05 bluetooth. i wanted to control device. i check HC-05 that connect to PC by USB serial converter. i can send AT in command mode and return ok and i did the set. it is okey. BUT i can't return to DATA mode. i did disable key pin and reset power. did things i could . spent many time over that. pls help me

    ReplyDelete
  25. hi, can i can make module bluetooth for standart printer with HC-05?

    ReplyDelete
  26. I want to send the RSSI value continuously from the HC-05 to the connected phone over the SPP. Can anyone help???

    ReplyDelete
  27. Hi, Does anyone know how to get the 'connected' LED to go on? I don't need to communicate at all - all I want to do is to detect that someone has connected to the HC-03, and turn a light on. I can do that with the 'connected' light, but it never goes on. I've got it upgraded, and can see the 'paired' LED go on when I pair with it. My android also never goes into 'connected' mode either. Do I need to put a ucontroller on the serial line? And/or what does it need to do?

    ReplyDelete
  28. i want to set up 3 HC-05 module as picconet connection..please guide me hwo to do it?

    ReplyDelete
  29. thank u very much it really helped

    ReplyDelete
  30. Hi Byron,

    Thanks for the extremely informative pages. My question, though not related to the module's firmware, is somewhat related.

    Is there any way to increase the range of these modules? For example, would soldering a piece of wire as an antenna onto the trace antenna on the pcb help?

    I've tried to find an answer to this all over the net, with no success. I'm hoping either you, or someone reading this would have some information to share in this regard.

    ReplyDelete
    Replies
    1. I also need answer....Is there any way to increase the range of these modules?

      Delete
  31. Hello Everyone,
    Can someone tell me, if i can control a led without using any external microcontroller and only with hc 05, as this also has CC2540.

    ReplyDelete
  32. how to set the pin 34 low or high?

    ReplyDelete
  33. I have purchased some inexpensive hc-06 modules from Aliexpress. They are advertised as hc-06, and the PC detects it as the name hc-06. I can pair and connect to the module over bluetooth (using the default 1234 pin). I can the send data in both directions, at 38400 baud. While it is connected, the red led goes off for 2 seconds, then does 2 quick flashes, then off for 2 seconds, and this repeats.

    When not connected over bluetooth, the red flashes rapidly. My problem is that I cannot get any of the AT commands to respond. I type AT and I never get the OK response. I have tried different baud rates. I'm not sure what else to try. Has anyone gotten a module with firmware like this, that blinks the red led while in bluetooth connection? I need to figure out how to configure these modules.

    ReplyDelete
  34. This comment has been removed by the author.

    ReplyDelete
  35. hi, do u have any adapter/base/station/breakout board schematic / pcb diagram for hc05. because I bought one of hc05 that dose not have any one of that board, whatever they call it.

    ReplyDelete
  36. WHEN I AM ENTERING AT COMMAND AT+INQ AND GETTING ERROR 1F

    ReplyDelete

Note: Only a member of this blog may post a comment.