BLE nRF8001 Can't Connect

Hello:
BLE is what I have been waiting for. I am very excited. I know it is in Beta but want to be sure I’m not missing something.

I have a RedBear BLE Shield:
http://redbearlab.com/bleshield/

It runs the nRF8001 BLE Chip so I used that example sketch to try to connect.

I changed the REQ, RDY, RST to 9, 8, and 7 respectively. I believe the RST pin could also be set to 4. (I have tried both with no luck).

I am unable to connect. Could anyone tell me if I am doing something wrong or if it just not quite ready to use yet?

Here is the sketch I am using. As a test…just trying to light one LED on A0 but again…cant even connect.

For the record, the shield does work using a RedBear Controller sketch and iPhone app. So I don’t think its the shield. Thanks.

//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial

#define BLYNK_USE_DIRECT_CONNECT

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

char auth[] = "...";

#define BLE_REQ   9
#define BLE_RDY   8
#define BLE_RST   7
BLESerial SerialBLE(BLE_REQ, BLE_RDY, BLE_RST);

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

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

  Blynk.begin(auth, SerialBLE);
}

void loop() {
  SerialBLE.poll();

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

Do you see any serial debug in the output?

If not you should check that the BLEPeripheral library is working with the redbear board. I found this app very helpful - Use the same initialisation you have here but write a simple loop that periodically writes to SerialBLE, Check in the UART app that your message appear. If you don’t see any data in this app then you’ve probably not setup your board correctly. If the UART app works as expected then you’ve probably got an issue with Blynk (Most likely the auth code, but check your app is up to date too).

I dont have an Android so I cant use that app. I have an iphone.
But I have installed the RedBear Control app and can connect to and use the board just fine.

As far as Auth code. I generated, emailed and copy and pasted. Have also verified letter for letter that it is correct.

My app is up to date.
The code is a cleaned up version of the example code.

Looking for some concrete suggestions…

I think this is the same app on iphone: https://itunes.apple.com/gb/app/nrf-uart/id614594903?mt=8 - if not there’s bound to be a similar one.

The other option is to take the BLE library that the redbear app uses and make it fulfil the Serial interface. Once you’ve done that you should be able to a known good library in place of BLEPeripheral. This isn’t too tricky if you’re familiar with a little bit of software engineering / c++, depends what your skill level is.

Like I said…I’ve have made connection to the board with the Redbear Controller App where I controlled pins. I’ve also used Serial Chat that let me write and send text to and from the board via console. All with success. I’m 100% sure its not the board.

I’ve tried replacing the BLEPeripheral library with the nRF8001 Library with no success so far…I’ll continue to test.

I’m not suggesting it’s the board! I think you’re on the right lines to try switching the BLE libraries - but debugging these things can be tricky. I found that a BLE UART terminal app to be very helpful to work out where the problems were.

Could you please try commenting this out?
I know this sounds crazy, but it actually helped me :wink:

1 Like

With SPI.h NOT commented out:
When connecting to the board, the board would disappear from the devices list after the first failed attempt.

With SPI.h commented out:
When connecting to the board, the board still doesn’t connect, but takes longer trying and lets you chose it from the list again.

Am I supposed to see a Bluetooth connection in the iPhone settings once connected?

While trying to connect the BLE Shield appears to connect. Then drops down to available. Then disappears. Note that there is no info button on the connection to forget the device.

nickcornaglia in my opinion your doing good work trying to get your Microcontroller to connect. I have an Red Bear Labs Blend Microcontroller and when I asked Blynk about how to connect to my board they referred me to your post. I don’t have much knowledge in computer programming but if you are able to get your microcontroller to connect to Blynk could you please post the code. I would greatly appreciate it.

Also nickcornaglia have you tried using your baud rate at 57600 so instead of Serial.begin(9600); it would be Serial.begin(57600); I noticed on the BLEcontrollerSketch code that allows my board to connect to the Red Bear Labs app the baud rate is set to 57600.

Still no luck. Can’t get past the connection problem. Any other advice? I really am hoping to get this working.

@nickcornaglia: please try commenting-out the #define BLYNK_USE_DIRECT_CONNECT
And tell me if it helps.

Unfortunately, that did not help.
I tried different combinations of commenting out…
SPI.h
BLYNK_USE_DIRECT_CONNECT
and BLEPeripheral.h

No luck.
Short of getting tis device to work…which device do you recommend that I buy. I want to control an 8 channel relay connected to my Uno in my Jeep.

Could you enable #define BLYNK_DEBUG and send us your serial monitor output?
As for another hardware options - HM-10/HC-08, RedBearLab BLE Mini are cheap and functional.
RedBear Duo and Arduino 101 are also nice options :wink:

Thanks for sticking with this!

Nothing commented out

[281] Blynk v0.3.7 on Arduino Uno
[�
(doesnt even try to connect)
=========================================

SPI.h commented out

[281] Blynk v0.3.7 on Arduino Uno
[14977] Connecting...
(tries but no connection)
=========================================

SPI.h  &  BLEPeripheral.h commented out

[281] Blynk v0.3.7 on Arduino Uno
[16445] Connecting...
(tries but no connection)
=========================================

SPI.h  &  #define BLYNK_USE_DIRECT_CONNECT commented out

[281] Blynk v0.3.7 on Arduino Uno
[5001] Connecting...
[5001] <[02|00|01|00] b4b7116fa7c0459
[5042] <e94a891b13c0f5f87
[7083] Login timeout
[10083] Connecting...
[10083] <[02|00|01|00] b4b7116fa7c0459
[10124] <e94a891b13c0f5f87
(fails to connect)
=========================================

SPI.h  &  BLEPeripheral.h  &  #define BLYNK_USE_DIRECT_CONNECT commented out

[281] Blynk v0.3.7 on Arduino Uno
[5001] Connecting...
[5001] <[02|00|01|00] b4b7116fa7c0459
[5042] <e94a891b13c0f5f87
[7083] Login timeout
[10083] Connecting...
[10083] <[02|00|01|00] b4b7116fa7c0459
[10124] <e94a891b13c0f5f87
[12165] Login timeout
(fails to connect)

Any feedback on my feedback?

Over a week now with no response. Is there a (LED) light at the end of the tunnel? Or am I wasting my time trying to get this to work and provide feedback.

Sorry, as we said, Bluetooth is in the beta now.
I re-checked with my hardware, and it works.
Community is also not responding - maybe nobody just tried it yet.
We’ll have to wait for more feedbacks…

I understand its in Beta and dont hold any expectations.
In what I am doing…I’m hoping to help you get this board working (for me and for others).
After all it is a nRF8001 board.

You asked for feedback…and I went out of my way to provide it…but you didnt respond to what that debug feedback means to you. I wont keep trying if its not going to be a back and forth discussion…that would just be a waste of my time.