Arduino UNO with HM-10 Doesn't Work; S9

trying to connect Samsung S9 to Blynk app over bluetooth with HM-10. Does not connect. Here is a list of the serial monitor:

and code

#define BLYNK_USE_DIRECT_CONNECT

#define BLYNK_PRINT Serial
#include <BlynkSimpleSerialBLE.h>

char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

WidgetLED led1(V1);

BLYNK_WRITE(V0) {
  //(param.asInt()) ? led1.on() : led1.off();
  (param.asInt()) ? Blynk.virtualWrite(V1, 255) : Blynk.virtualWrite(V1, 0);
}

void setup()
{
  Serial.begin(115200);

  Serial1.begin(9600);
  Blynk.begin(Serial1, auth);
}

void loop()
{
  Blynk.run();
}

UNO doesn’t have a Serial1 UART option, only SoftSerial

I apologize, I don’t know where I got that code. The code I meant to had trouble with is below, with the serial monitor following. The issue is that I upload this code to an arduino UNO connected to an HM-10, and when I try and connect it to my Samsung S9, HMSoft appears as an option, I select it, and then my phone, in the Blynk app, displays “Connecting…” indefinitely. It is possible that I did not download the libraries correctly, but I am fairly certain this is not the issue.

#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[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

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!
}
[0] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.0 on Arduino Uno

[89] Connecting...
[3229] Login timeout
[5229] Connecting...
[5348] Packet too big: 17231
[10349] Connecting...
[10468] Packet too big: 25394
[10469] Packet too big: 12646
[10470] Packet too big: 13367
[10499] Packet too big: 12390
[10530] Packet too big: 25904
[10563] Packet too big: 14434
[15469] Connecting...
[15588] Packet too big: 19535
[20589] Connecting...
[23709] Login timeout

BT/BLE is in Beta… use the Beta version of the App and install the latest library 0.6.1.

If still having issues, send log reports from the App to the developers. Thank you.

it works now - I also added the libraries to arduino through “add.zip library”

1 Like

what library

I think @Arduinio was saying that he installed the Blynk v6.0.1 library, as reccomended by @Gunner, to the Arduino IDE; but be did it using the “add .zip library” option, which isn’t the recommended way to install the Blynk libraries.

Pete.

what is the recommended way then ?

i download zip file and extracted.
copy pasted it to file location in “ide preference”

“Add .zip library” is the IDE automated routine, manually installing the library is the preferred method…

How to install Blynk library.

:point_up: Blynk library should be installed manually

Follow the instructions:

Download Blynk_Release_vXX.zip (scroll down to the Downloads section)
Unzip the archive. You will notice that archive contains several folders and several libraries.
Copy all of these libraries to your_sketchbook_folder of Arduino IDE. To find the location of your_sketchbook_folder, go to top menu in Arduino IDE:
Windows: File → Preferences
Mac OS: Arduino → Preferences
The structure of your your_sketchbook_folder should now look like this, (along with your other sketches if you have them):

your_sketchbook_folder/libraries/Blynk
your_sketchbook_folder/libraries/BlynkESP8266_Lib
…
your_sketchbook_folder/tools/BlynkUpdater
your_sketchbook_folder/tools/BlynkUsbScript
…
:point_up: Note that:

all libraries should go to libraries folder
all tools should go to tools folder

1 Like