Problems with Bluetooth

I have a larger project that I am trying to integrate with Blynk. I haven’t had any luck, so I decided to scale back and try a simple example.

I am using an Arduino Uno, HC-05 Bluetooth module, a buzzer, and a Samsung tracfone.
I am attempting to use the Blynk Blink example code to make a buzzer buzz…

Here is the code:

#define BLYNK_PRINT Serial
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>
char auth[] = "MyToken";
SoftwareSerial SerialBLE(10, 11); // RX, TX
void setup()
{
  Serial.begin(9600);
  SerialBLE.begin(9600);
  Blynk.begin(SerialBLE, auth);
  Serial.println("Waiting for connections...");
}
void loop()
{
  Blynk.run();
}

I am connecting the Tracfone to a mobile hotspot, then connecting to bluetooth. Both the App and the LED on the HC-05 module confirm my connection.

Pin setup is as follows, for Bluetooth: RX-10, TX-11, GND-GND, +5v-5v. For buzzer: positive-Pin3, negative-GND.

Inside the Blynk app, my buzzer is a slider on Digital Pin 3.

My serial monitor shows: Connecting…Connecting…Connecting…Login Timeout, and repeat.

What am I doing wrong? Is there a problem with using the tracfone? It doesn’t have any minutes, which is why it is being connected to a mobile hotspot.

Please let me know if you need any more information. Thank you.

Edit: It’s been a few days, no response. No ideas? I’m open to anything

Edit2: Can anyone recreate this environment? I have loaded the Tracfone with minutes, so this isn’t the problem.

Edit3: I have ruled out problems with the Arduino Uno or data/power cord. I ran the same steps with a different set.

Had you started the project? Bluetooth (not BLE) project will connect to the device only on it’s start and will disconnect on stop.

1 Like

The project is started. The Bluetooth (not BLE) module LED stops blinking(showing connection successful), and it shows the project is connected. Once I stop the project, the LED returns to its normal blinking state.

Thanks for your reply.

Edit and bump for visibility:

I have tried a completely different environment, allowing a peer to follow the steps listed online instead of me… The same results were achieved.

1 Like

Update: I have tested a new bluetooth board. Once again, I am using the HC-05 model. This is listed as a supported piece of hardware on the Blynk GitHub. My serial monitor constantly shows connecting… connecting… login timeout… and so on. I have ruled out all hardware problems. This is a Blynk Bluetooth problem. Is there any solution for this, any help?

Anything other than someone asking me if my project is turned on??

I will create for you a logging build to check what is going on in the Bluetooth connection layer, so we could have more details.

Please install the logging build by next link:

  1. Reproduce your issue (reselect your Bluetooth board, start your project, do something with widgets, stop it)
  2. Go to the projects list screen, click on the info button in the top right corner, on the about screen select ‘send logs’ option via Gmail or your mail application.
1 Like

Hopefully I don’t get chastised for this comment :grimacing:, but if you’re simply trying to talk between android and arduino directly over Bluetooth, I’ve personally found that Blynk isn’t necessarily the best option. It’s kind of pointless to have to have an internet connection and talk to the Blynk cloud. What I’ve done in the past is just use MIT App Inventor 2 to make my own android app that talks over Bluetooth directly to an HC-06. You can find examples of custom app inventor 2 apps that use Bluetooth online. All I’m saying is might be worth considering another method.

That was a very important question :wink:

Here is another… After pairing with your phone, have you also successfully connected to the BT module from within the required Bluetooth Widget, before starting the project in the App?

image

Thanks for everyone’s response. I was trying the following exercise as a debugging experiment. I am trying to recreate the cooler project shown here.

I have fixed my bluetooth problems. It was a faulty/knock off bluetooth board. Now back to my larger project. Thank you all for your suggestions!

2 Likes

Hi Asdedmon,

Were you successful in getting all of your all of your BT functions to work with your cooler project?

A post was split to a new topic: I am also doing same project “ Cooler”