Lately i use Blynk for my embedded system project. For the user interface, i’m using HC05 bluetooth module, but i get the problem in connecting the blynk app into HC05. Everytime i’m trying to connecting it, it would say “can’t connect, please check the auth…”
But i had paste the auth code from the mail that has been sent.
Here’s the code i’ve been used:
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
Note: This only works on Android!
iOS does not support Bluetooth 2.0 Serial Port Profile
You may need to pair the module with your smartphone
via Bluetooth settings. Default pairing password is 1234
Feel free to apply it to any other example. It's simple!
NOTE: Bluetooth support is in beta!
You’ll need:
- Blynk App (download from AppStore or Google Play)
- Arduino Uno board
- Decide how to connect to Blynk
(USB, Ethernet, Wi-Fi, Bluetooth, ...)
There is a bunch of great example sketches included to show you how to get
started. Think of them as LEGO bricks and combine them as you wish.
For example, take the Ethernet Shield sketch and combine it with the
Servo example, or choose a USB sketch and add a code from SendData
example.
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "3M2qyu4yJgyzuhxnbtt3PJLqi5u1EG43";
SoftwareSerial SerialBLE(10, 11); // RX, TX
void setup()
{
// Debug console
Serial.begin(9600);
SerialBLE.begin(9600);
Blynk.begin(SerialBLE, auth);
Serial.println("Waiting for connections...");
}
void loop()
{
Blynk.run();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
}
@Zahira please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
Done sir, I already used 2 devices to connect Blynk to HC05 however, both of them didn’t work properly. Then I change into the other hc05 Bluetooth module, but it’s still didn’t works.
Please let me know if you can help in this matter. Looking forward to receiving your reply.
Thank you.
I connected the RX pin in HC05 to digital pin 10 in Arduino Uno. Then the TX pin in HC05 to digital pin 11 in Arduino Uno. I used a 5V pin in Arduino for the VCC pin of HC05.
No, I don’t put any other devices.
I already used 2 phones, and both of them give the same result.
Yes, sir, I restarted it, turn on the location mode and Bluetooth mode.
Pin 10 is the pin that the Uno is expecting to receive data on, it needs to be connected to the pin that the HC-05 is transmitting data on (Tx).
Pin 11 is the pin that the Uno is transmitting data on, the HC-05 will accept this data on its Rx pin.
So, it needs to be…
Uno pin 10 (Tx) to HC-05 Rx
Uno pin 11 (Rx) to HC-05 Tx
I mean, my arduino isn’t support for internet things.
And I choose HC05 bluetooth instead of wifi module.
I really don’t know what to do right now.
I already do all the things that have been told in youtube tutorial for connect Blynk to HC05.