SparkFun Forums 

Where electronics enthusiasts find answers.

By sanjay.thorat
#194037
I have recently purchased a HC-08 Bluetooth module. When I connect to it via Arduino Mega, the blue light on it blinks and HC-08 device appears on my phone and computer while searching for bluetooth devices, but I am not able to pair with it. On PC, it says unable to pair and on phone it says password/pin is incorrect. When I send AT commands to the module, I do not get any response. Can you please help with this?
By hc08nopair
#195041
I'm having the same problem. My setup is the same as yours, HC-08 on an arduino mega. It is attached to Serial1.

I did however get AT commands to work. With Serial <=> Serial1 passthrough:

AT
OK

AT+RX
Name:HC-08
Role:Slave
Baud:9600,NONE
Addr:50,65,83,9C,A4,52
PIN :000000

AT+VERSION
HC-08 V2.2,2015-07-30

So far I've tried to pair with it using three different android phones and a laptop, to no avail. I enabled experimental features (NOPLUGIN_OPTION="-E"), set the device as trusted, but whenever I try to connect it gives me "Failed to connect: org.bluez.Error.NotAvailable" and then after timeout "Failed to pair: org.bluez.Error.AuthenticationCanceled". Without setting trust, it gives "Failed to pair: org.bluez.Error.AuthenticationFailed" immediately.
By brit_bodger
#195727
I have had the same problem, it's been driving me mad.
I'm using the Uno and have been able to use AT commands (@sanjay.thorat maybe try swooping the the RX and TX wires)

AT+RX

Name:HC-08
Role:Slave
Baud:9600,NONE
Addr:C8,FD,19,4E,67,2F
PIN :000000

AT+VERSION
HC-08 V2.2,2015-07-30

My HC 08 came part of a kit and the supplier has made an app that dose connect (so they clearly know something we don't). I have tried connecting it to my laptop and multiple other apps to no successes.
The app that came with it is called Elegoo BLE Tool if thats enough for you, but I want to use my laptop or an app with support for more pre-set buttons.

If anyone has found out a way round this please share. Thanks
By jerxx94
#196973
Hi,

Upload this code and you'll be able to send AT commands.
void setup() {
// initialize both serial ports:
Serial.begin(9600);
Serial1.begin(9600);
}

void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}

// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
Serial1.write(inByte);

}
}
Then use the AT command AT+TYPE1 to be able to pair. Once you do that, use AT+PASS123456 to change the pairing pin to 123456. Then, you'll be able to pair using that pin.

Hope this helps
By muntabirc
#200079
Hey G Reno,
Could you share how did you connect the HC-08? I got a Elegoo Robotics Car Kit. It came with built in Bluetooth Application that does connect with the HC-08, however, I made my own android application wanted to more with this car kit, but I was failed to connect with my custom build app. Not only that, when I was trying to pair the HC08 bluetooth module with my android phone, it was showing me a message that the bluetooth is unable to pair.

Can you or anyone please help me out in this regard. Your help would be much appreciated
By gawe
#201588
Dear muntabirc,

do you have solve your issue with the elegoo car robot HC-08? I have the same issue.
- The HC-08 can be paired with my smartphone
- but I cannot use the HC08 to connect with my PC, in order to use the bluetooth connectivity for programming and debugging my software.

If I understand the previous messages, I should change the HC08 mode from slave to master (AT+TYPE1).
Up to now, I'm not able to send any AT message to the HC08.
- I have try with different sources using the serial monitor command line,
- I have also try to write the command directly in the arduino software (BTserial.write("AT+TYPE1\r\n");
But nothing works.

Any hint?

Thank you for your help.
By Keith Schaub
#202134
I have the same problem.
I have the Elegoo robot car and I want to use PC Bluetooth.
My computer sees "HC-08", but I am unable to add it. It always says unsuccessful when attempting to add.

??????????????????????????
By Keith Schaub
#202135
I tried your code below, but the code doesn't upload to Elegoo - I get error about "serial1 not defined"
jerxx94 wrote: Thu Nov 16, 2017 4:43 pm Hi,

Upload this code and you'll be able to send AT commands.
void setup() {
// initialize both serial ports:
Serial.begin(9600);
Serial1.begin(9600);
}

void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}

// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
Serial1.write(inByte);

}
}
Then use the AT command AT+TYPE1 to be able to pair. Once you do that, use AT+PASS123456 to change the pairing pin to 123456. Then, you'll be able to pair using that pin.

Hope this helps