BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Arduino BLE HC-08 Module - Connecting... Can't connect. Please retry or choose another device

#1

Hello,
I have an Arduino Mega 2560 board connected to an SH-HC-08 Bluetooth Low Energy Module.
I’m trying connect the module to Blynk through the BLE Widget inside the Blynk app, but it just gets stuck on “Connecting…”, and sometimes displays the message “Connecting… Can’t connect. Please retry or choose another device.”
The devices that I have tried this on: iPhone 7+, Google Nexus 6, and HTC One M8. All 3 have BLE capabilities as far as I know.
I have tried connecting to the SH-HC-08 with AND without pairing it before directly to the phone through the Settings app.

The sketch uploaded to the arduino is blank (just an empty setup and loop), but the Bluetooth module should still connect to the app?!

As a reference, this is the Data Sheet for the SH-HC-08: https://drive.google.com/file/d/0B4urklB65vaCcEVyMm5haVVpMUk/view

What should I do?

0 Likes

#2

Have you confirmed that your module is setup properly for connection with any other BLE app or device?

Have you properly created a project using BLE and passed the auth code onto your sketch?

http://help.blynk.cc/hardware-and-libraries/arduino/bluetooth-20-spp-40-le

No. You still need a proper sketch to make the connection work.

https://examples.blynk.cc/?board=Arduino%20Mega%202560&shield=HM10%20or%20HC08&example=GettingStarted%2FBlynkBlink

0 Likes

#3

also, you should know that in the past there were some ble / bluetooth issues.

0 Likes

#4

I will try that in a second. Just to make sure the config on my HC-08 module is fine:
Baud rate is 9600 (Module DEFAULT)
There are 3 types that I can choose:
0. Not need PIN Code (Module DEFAULT)

  1. Auth no PIN
  2. Auth with PIN

Is the baud rate okay and does the type influence anything?
I’m assuming they should all work with the iPhone?

0 Likes

#5

Also, from the example, can I use the other Serial Pins on the Arduino Mega?
For example: using pin 19(which is labeled RX1) and pin 18(which is labeled TX1)?

0 Likes

#6

This should be fine.

You can use the hardware serial ports that are on the Mega, but then you need comment out:

// SoftwareSerial SerialBLE(10, 11); // RX, TX

And use:

Serial1.begin(9600);  // Use Mega Hard Serial1 wired appropriately to your serial device.
Blynk.begin(Serial1, auth);

https://www.arduino.cc/en/Reference/Serial

The Arduino Mega has three additional serial ports: Serial1 on pins 19 (RX) and 18 (TX), Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX).

0 Likes

#7

Thank you!
I got it to work.

This is unrelated to the above topic, but how would I be able to still run code even while Blynk is not connected? Right now if I don’t connect it just sits in setup at the line Blynk.begin(SerialBLE, auth); trying to connect and does not keep going

0 Likes

#8

That is normal… Blynk usually requires a connection to server for most WiFi applications, and connection to the phone/app for BT/BLE connection.

There are alternative connection commands, that will allow “unconnected” sketches to keep running… but I don’t know if they work the same for a BT/BLE application.

https://www.arduino.cc/en/Reference/Serial

0 Likes

#9

I have another question. What’s special about pins 10 and 11? I tried to use other pins such as 2 and 3 on the Mega and Blynk fails to connect when using those

All has worked well so far. Thanks for the help

0 Likes

#10

When using SoftwareSerial, the supported pins vary with the Arduino board types.

https://www.arduino.cc/en/Reference/SoftwareSerial

When using the MEGA, use one of the auxiliary hardware serial options (Serial1, Serial2, Serial3) instead of the Software Serial library, for better reliability.

0 Likes

#12

You should use the latest library version (i.e. v0.6.1). Please do not append new questions to the old topics - create a new one.

0 Likes

closed #13
0 Likes