BLE Problem

The Bluetooth isn’t connecting to the app. Every time I click connect it says unable to connect.

http://docs.blynk.cc/#widgets-other-ble

That doesn’t help It used to work and connect perfectly but then it randomly stopped connecting and I even tried a new Bluetooth piece

Then you need to give us more details… App version, Phone type, show your code, etc… BLE/BT is still in beta and much can change.

I have the most updated app for the iphone 6S.
Code:

#include <Blynk.h>
#define BLYNK_PRINT Serial 
#include <BlynkSimpleSerialBLE.h> 
#include <SoftwareSerial.h>
// You should get Auth Token in the Blynk App. Go to the Project Settings (nut icon).
char auth[] = "d7101319e24d4c61af2429ec19ce35d6"; 
const int groundpin = 18;             // analog input pin 4 -- ground
const int powerpin = 19;              // analog input pin 5 -- voltage
const int xpin = A4;                  // x-axis of the accelerometer
const int ypin = A2;                  // y-axis
const int zpin = A0;                  // z-axis (only on 3-axis models)
SoftwareSerial SerialBLE(10, 11); // RX, TX
int maximum = 0;
int maxmax = 0;
int xValue = 0;
int yValue = 0;
int zValue = 0;
void setup() 
{
    // initialize the serial communications:
  Serial.begin(9600);

  // Provide ground and power by using the analog inputs as normal
  // digital pins.  This makes it possible to directly connect the
  // breakout board to the Arduino.  If you use the normal 5V and
  // GND pins on the Arduino, you can remove these lines.
  pinMode(groundpin, OUTPUT);
  pinMode(powerpin, OUTPUT);
  digitalWrite(groundpin, LOW);
  digitalWrite(powerpin, HIGH);

Serial.begin(9600);
SerialBLE.begin(9600); 
Blynk.begin(SerialBLE, auth); 
Serial.println("Waiting for connections...");
}
void loop() {
  xValue = analogRead(xpin);
  // print a tab between values:
  //Serial.print("\t");
  yValue = analogRead(ypin);
  // print a tab between values:
  //Serial.print("\t");
  zValue = analogRead(zpin);
  //Serial.println();
  // delay before next reading:
  delay(500);
  maximum = max (xValue,yValue);
 maxmax = max(maximum,zValue);
 Serial.print ("maximum Final");
  Serial.println ( maximum);

Blynk.run();
// You can inject your own code here. 
// Remember to avoid delay() function!
}

Then as stated in the document link I showed you, it is currently only (fully) supported by Android… According to the developers, it is still a work in progress.

@Eugene can you confirm if this is still the case? Thank you.

@Benjamin You have a busy main void loop() and a delay… this will be the most likely issue in your disconnection. Please try to keep the main loop clear and use BlynkTimer routines.

Blynk iOS app should work fine with BLE devices (not classic BT). What device you’re trying to connect to?
Anyway, I would recommend to upload minimally working sketch to the device and test BLE connectivity. Please refer to this post: A classic one : Arduino + Iphone + nrf8001

1 Like