Author Topic: HC-06 version 3.0 detection by the CurrentRanger  (Read 3715 times)

tterho

  • NewMember
  • *
  • Posts: 5
HC-06 version 3.0 detection by the CurrentRanger
« on: May 06, 2019, 07:10:43 AM »
I got finally the HC06 module working (it appeared to be version 3.0 with completely changed AT commands). The module appears as two BT serial ports in my laptop. I got the baud rate changed successfully to 230400 as instructed, and got serial data passed through (from a UART-USB adapter to a BT serial port and vice versa). However, when I connect the HC06 to the CurrentRanger and power it up (and connect to it so that the LED on the HC06 indicates a connection), nothing appears in the terminal of the BT serial port. I assume it should start sending data immediately. What is wrong?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: HC-06 version 3.0 detection by the CurrentRanger
« Reply #1 on: May 06, 2019, 02:05:46 PM »
If you look at the CR firmware, it tries to poll for the BT module with AT commands, and it expects an OK back. If it gets no response it assumes nothing is there.
So assuming the wiring is correct, could the module not be responding?

tterho

  • NewMember
  • *
  • Posts: 5
Re: HC-06 version 3.0 detection by the CurrentRanger
« Reply #2 on: May 07, 2019, 12:25:07 AM »
Ah, now I clearly see the issue. The new firmware of the HC06 (version 3.0) requires AT and CR+LF instead of AT only, and there is no 1 second timeout anymore. So I should update the firmware of the CurrentRanger.

The new requirement of CR+LF was one reason why it got such a long time from me to find out why the HC06 is not responding to AT commands, and later on why it doesn't accept the AT+BAUDn command. After getting the version read (it was 3.0-20170609), some googling got me on the track. It appeared that the AT+BAUD9 command had to be replaced by AT+UART=230400,0,0 (& CR+LF) in order to get the baud rate changed.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: HC-06 version 3.0 detection by the CurrentRanger
« Reply #3 on: May 07, 2019, 09:18:16 AM »
Thanks for the update and the pull request, I wonder if the previous firmware would accept the CR+LF?
The reason is that there will be another 1s wait during startup each time there is nothing found (or no BT module attached) for everyone, which is undesirable.

tterho

  • NewMember
  • *
  • Posts: 5
Re: HC-06 version 3.0 detection by the CurrentRanger
« Reply #4 on: May 08, 2019, 03:59:25 AM »
I agree with you about the timeout length. Unfortunately, I haven't got an old HC-06 module that I could test with. I think the old module will send an error response to the CR/LF, according to the discussion on particular forums.

The 1-second timeout is in fact unnecessary on the HC-06 v3.0 recognition. The response comes from the new module immediately, so 50 ms should be more than enough. Could this be a solution?
« Last Edit: May 08, 2019, 04:13:45 AM by tterho »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: HC-06 version 3.0 detection by the CurrentRanger
« Reply #5 on: May 08, 2019, 09:07:33 AM »
The 1-second timeout is in fact unnecessary on the HC-06 v3.0 recognition. The response comes from the new module immediately, so 50 ms should be more than enough. Could this be a solution?
Possibly. The delays are somewhat undesirable in general. I would like to test the different versions of the module. I have to check what I have, unfortunately these modules do not have a specification of what version they are, unless it can be obtained over AT interface. How did you find out your version?

Do you have a link for the 3.0 version you purchased?

tterho

  • NewMember
  • *
  • Posts: 5
Re: HC-06 version 3.0 detection by the CurrentRanger
« Reply #6 on: May 09, 2019, 12:31:37 AM »
I tested this and found it working with 50 ms delay. Because the previous version check was untouched, I assume that both versions work now without a problem, just adding the extra 50 milliseconds to the startup time without HC-06. Unfortunately with serial communication where the answer is not available "immediately", timeouts are almost unavoidable.

I didn't order the module by myself (my colleague suggested your product and made the order). I suppose that we bought it from this Finnish dealer: http://ihmevekotin.fi/product/257_bluetooth-sarjaporttimoduuli-hc-06.


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: HC-06 version 3.0 detection by the CurrentRanger
« Reply #7 on: May 09, 2019, 09:24:26 AM »
Great, thanks for the update.
Even that link says BT 2.0 and these modules all look very similar so it's impossible to tell what actual version is on them.
I merged your PR, thanks a lot!

tterho

  • NewMember
  • *
  • Posts: 5
Re: HC-06 version 3.0 detection by the CurrentRanger
« Reply #8 on: May 10, 2019, 04:09:04 AM »
You're welcome! And thank you for merging this update.

I think the only way to recognize the version is to use AT commands. One hint is whether the module accepts the command 'AT' with or without CR+LF, and the 'AT+VERSION' reveals the truth.
« Last Edit: May 10, 2019, 04:12:11 AM by tterho »

kwinz

  • NewMember
  • *
  • Posts: 1
Re: HC-06 version 3.0 detection by the CurrentRanger
« Reply #9 on: January 25, 2020, 03:40:26 PM »
I wanted to thank you. I was wondering why my Bluetooth module didn't transmit any data (I probably accidentally bought a clone on Amazon). After reading this I compiled a new firmware with
Code: [Select]
byte BT_found=true;
and after uploading this now it works!