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

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

#1

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();
}

0 Likes

#2

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

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

0 Likes

#3

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
0 Likes

#4

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.

0 Likes

#5

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

0 Likes