Unable to get first sketch running on Uno with Bluefruit LE

I’m trying to get my first sketch running with Blynk. I’m using an Arduino UNO with the Adafruit Bluefruit LE SPI friend (not the UART version) I’ve successfully run one of the examples from Adafruit, so I know the board is wired properly and working. I’m using the Blynk example code builder with the options: selected Board:“UNO”, Connection:“Adafruit Bluefruit BLE,” Example:”Terminal”. When I tried to compile it, I get a compiler error that BLESerial.h was not found. I then moved the files BLESerial.h and BLESerial.cpp from BLEPeripheral/examples/serial to BLEPeripheral/src and the code compiles. However when I run the sketch, I see nothing on the Serial monitor. I added some print statements - I can see “begin” but not “back from begin”, which tells me the code is getting stuck in the statement: “SerialBLE.begin()” Can someone help me getting going with Blynk? Thanks!

  For this example you need BLEPeripheral library
    from http://librarymanager/all#BLEPeripheral

  Warning: Bluetooth support is in beta!

  You can send/receive any data using WidgetTerminal object.

  App project setup:
    Terminal widget attached to Virtual Pin V1

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

#include <BlynkSimpleSerialBLE.h>
#include <BLEPeripheral.h>
#include "BLESerial.h"
#include <SPI.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "SzmdVHp0W1ESp5vEx302h0x1NpHDql08";

// define pins (varies per shield/board)
#define BLE_REQ   10
#define BLE_RDY   2
#define BLE_RST   9

// create ble serial instance, see pinouts above

// Attach virtual serial terminal to Virtual Pin V1
WidgetTerminal terminal(V1);

// You can send commands from Terminal to your hardware. Just use
// the same Virtual Pin as your Terminal Widget

  // if you type "Marco" into Terminal Widget - it will respond: "Polo:"
  if (String("Marco") == param.asStr()) {
    terminal.println("You said: 'Marco'") ;
    terminal.println("I said: 'Polo'") ;
  } else {

    // Send it back
    terminal.print("You said:");
    terminal.write(param.getBuffer(), param.getLength());

  // Ensure everything is sent

void setup()
  // Debug console

  Serial.println(F("back from begin"));

  Blynk.begin(SerialBLE, auth);

  Serial.println("Waiting for connections...");

  // Clear the terminal content

  // This will print Blynk Software version to the Terminal Widget when
  // your hardware gets connected to Blynk Server
  terminal.println(F("Blynk v" BLYNK_VERSION ": Device started"));
  terminal.println(F("Type 'Marco' and get a reply, or type"));
  terminal.println(F("anything else and get it printed back."));

void loop()

With a little more poking around I decided that these pin assignments were more appropriate:

#define BLE_REQ   8
#define BLE_RDY   7
#define BLE_RST   4

Made no difference :frowning:

You need to have the BLE widget in your app, and use this to initialise a connection between the Uno and the app/server.


Thanks, Pete. Can you point me to a sample app that might work for me?

I have an idea of what the problem is. In the list of supported hardware here: I see the entry: “nRF8001-based boards (Adafruit Bluefruit LE, etc.)” My Adafruit board is nRF51822-based. Is there support for this, or am I simply out of luck?

You don’t need any additional app, you need to add the BLE widget into your Blynk app and use it to connect to your hardware.

Your Blynk app currently has three widgets, Vertical Slider, Terminal and LCD - no BLE widget, so no BLE connection.


Thanks very much, Pete! That was, indeed, a key missing piece. Also, I needed to use the sketch “Adafruit_Feather_32u4_BLE” which is set up for my BLE board, rather than the example sketch I was using. I’m up and running now! Whee! I can also see from your reply that in general I shouldn’t share auth tokens; I’ll delete my app and start over :laughing: Thanks again for your help with this

Just generate a fresh auth token in the app project.