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

Unable to connect to RFDuino


#1

I am trying to connect to an RFDuino over BLE connection, however I am running into some issues when I try. I have used Blynk in the past to control and monitor a Wifi device, and I would like to use Blynk to monitor a BLE device now that it is supported (even if in beta). I have previously been able to successfully connect to my Rfduino through third party BLE monitoring apps like BleTerm. On the Blynk github page of supported hardware it says RFduino is supported, however it doesn’t appear when I try to choose a board for my new project. I am using the most recently updated Blynk app. I have selected “generic board” instead as I have read on the forum that is the option to select if your board is not listed.

First of all, after uploading my Blynk code, I can no longer connect to my RFduino at all through my phone’s bluetooth settings (it does however display the correct name I set in the code, I named it Sidekik). When I try to connect it says “pairing rejected by sidekik, try again?” and so I try again and it says “cannot pair with this device, try again later” and never works. I am using an LG G3 using android version 6.0. Something with the Blynk code is causing it to be impossible to connect to my RFDuino, as my old codes for RFduino (without Blynk) didn’t cause this issue and I was able to connect to the device. The Rfduino BLE code from the blynk library that I’m basing my code on is available here in Blynk’s Github.

The code I am using is a slightly altered version of the RFDuino sample code available on the Blynk Github. All I’ve changed is added my auth token, changed the local and device names, and added code to have a constantly changing number on Virtual pin 1 to test that it’s working.


#define BLYNK_USE_DIRECT_CONNECT

#define BLYNK_PRINT Serial

#include <BlynkSimpleBLEPeripheral.h>
#include <BLEPeripheral.h>

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

// Create ble serial instance, parameters are ignored for MicroBit
BLESerial SerialBLE(0, 0, 0);

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

  SerialBLE.setLocalName("sidekik");
  SerialBLE.setDeviceName("sidekik");
  SerialBLE.setAppearance(0x0080);
  SerialBLE.begin();

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

  Blynk.begin(SerialBLE, auth);
}

void kickSense(){

  int k = 0;
  
  Blynk.virtualWrite(V1, k);


  k = (k+1);

  if(k > 1000){
    k=0;
  }

  yield();
}

void loop() {
  SerialBLE.poll();

  if (SerialBLE) {    // If BLE is connected...
    Blynk.run();
    kickSense();
  }
}

I am thankful for any advice anyone can give, as Blynk has worked for my wifi projects in the past and I’m excited to use it for BLE, I just can’t get it working currently. If RFduino is a problem I am also open to suggestions for other similarly sized BLE boards if anyone has had success with them.


#2

I realized I didn’t have the BLE widget added to my Blynk app. I’ve since added it, and it can discover my BLE device, but upon trying to connect it stays on “Connecting” even after waiting for a few minutes, after which red text appears that says “can’t connect to this device, please select another device” (or something very similar to that, I don’t remember the precise wording). Any suggestions would be greatly appreciated. Attaching screenshot of the screen it’s stuck on


#3

I have tried using several examples now and I’m still having no success connecting from an RFduino to Blynk on Android 6.0 (LG G3). This time I have used only the exact code from the Github repository RFduino example adding nothing but my auth code from my program (code pasted below). My blynk app can find the device (it sees the display name set in the code, I’ve changed the name before and the name changes correctly). However, upon clicking “connect” I am stuck on “Connecting…” for several minutes until it says “Can’t connect, please retry or choose another device”. I have removed all widgets from my app except the BLE connect widget just in case they were causing any problems. I have my board set to “generic board” as that was suggested by Vhymaskkyy at the end of one of the few other RFduino forum topics I’ve seen Here

I have connected successfully to this RFduino with non-Blynk projects using BleTerm so I know my phone is capable of connecting to it, but there is something going on with the Blynk code or app making it unable to connect.

I previously posted my initial errors in the “project help” part of the forum but this seems like a more fitting place for it, as even the simple Github code isn’t working as it should. My lDE, libraries, app, and phone firmware are all up to date.

I realize that BLE is in beta, but I’m wondering if anyone has had success with this code before or if it’s been changed without testing on the RFduino hardware, it is listed as a supported device on github here

Thank you.

/*************************************************************
  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
    Social networks:            http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app
  Blynk library is licensed under MIT license
  This example code is in public domain.
 *************************************************************
  This example shows how to use RFduino BLE
  to connect your project to Blynk.
  Note: This requires RFduino support package:
    https://github.com/RFduino/RFduino
  And BLEPeripheral library
    from http://librarymanager/all#BLEPeripheral
    or https://github.com/sandeepmistry/arduino-BLEPeripheral
  NOTE: BLE support is in beta!
 *************************************************************/

#define BLYNK_USE_DIRECT_CONNECT

#define BLYNK_PRINT Serial

#include <BlynkSimpleBLEPeripheral.h>
#include <BLEPeripheral.h>

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

// Create ble serial instance, parameters are ignored for MicroBit
BLESerial SerialBLE(0, 0, 0);

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

  SerialBLE.setLocalName("Blynk");
  SerialBLE.setDeviceName("Blynk");
  SerialBLE.setAppearance(0x0080);
  SerialBLE.begin();

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

  Blynk.begin(SerialBLE, auth);
}

void loop() {
  SerialBLE.poll();

  if (SerialBLE) {    // If BLE is connected...
    Blynk.run();
  }
}


#4

@Loxodon Please stop spamming with your messages. Why do you need to create 2 different topics for the same issue?


Point #3


#5

Merged the new topic back into the original.


#6

I apologize for duplicating the topic. I am wondering that since you have read the topic, do you have a response for me as far as my concerns about RFduino support? I do not want to annoy you if my problem isn’t easy to solve I would just like to know if it’s been looked into in the past as I haven’t found much else on the forum about RFduino.


#7

Sorry I currently do not have RFDuino hardware to test with. Maybe someone from the community will help


#8

The same problem, have no idea to fix it.


#9

Is there any further progress on getting the RFduino supported or did someone find a solution? I am currently working on a project and I am using an RFduino since I had it available. I get the same “not able to connect” message as everyone else. I will use another small BLE device if some can confirm Blynk supports it and it is working.


#10

I was never able to find a way to get RFduino to work with Blynk. I also tried 2 other BLE devices that were supposed to supported (Redbearlabs BLE Nano which didn’t work because the libraries for the newest versions of the device are different from the outdated versions Blynk expects them to be, and lilypad Simblee BLE which didn’t connect, just like RFduino.

After trying 3 BLE devices which were listed as supported and ended up not working with Blynk, I just ended up writing my own Simblee app instead of Blynk as it didn’t seem they were working on testing and verifying that BLE actually worked with the devices they listed in their dropdown menu(I know it’s still in an experimental phase but it’s been quite a long time)

Blynk worked well for me when it came to using wifi connected arduino boards, but in my experience, and spending weeks testing and troubleshooting 3 different BLE boards with Blynk, it just doesn’t work as it should.

If you do want to try other BLE boards with Blynk, try ones other than the 3 I tested, there might be one out there that works. I’d love to give Blynk another chance if someone could confirm reliable BLE functionality.


#11

Thanks Loxodon for the response. I like Blynks flexible app but I need to use a BLE for my project. I was also looking at Simblee if RFduino didn’t work but I understand that RFduino is stable. I will move on to trying the RFduino on the Evothings platform solution.