So, on top of the latest library simply not compiling out of the box (var “r” in the peak method was undefined), the app on Android cannot connect to the Arduino with the BLE device block. (I set the proper Auth Token, just to make sure that it is in fact not a factor)
Here’s the code
#define BLYNK_PRINT Serial
#include <BlynkSimpleCurieBLE.h>
#include <CurieBLE.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "AuthToken";
BLEPeripheral blePeripheral;
BLYNK_WRITE(V1) {
GpsParam gps(param);
// Print 6 decimal places for Lat, Lon
Serial.print("Lat: ");
Serial.println(gps.getLat(), 7);
Serial.print("Lon: ");
Serial.println(gps.getLon(), 7);
// Print 2 decimal places for Alt, Speed
Serial.print("Altitute: ");
Serial.println(gps.getAltitude(), 2);
Serial.print("Speed: ");
Serial.println(gps.getSpeed(), 2);
Serial.println();
}
void setup()
{
// Debug console
Serial.begin(9600);
while(!Serial);
blePeripheral.setLocalName("Blynk");
blePeripheral.setDeviceName("Blynk");
blePeripheral.setAppearance(384);
Blynk.begin(blePeripheral, auth);
blePeripheral.begin();
Serial.println("Waiting for connections...");
}
void loop()
{
blePeripheral.poll();
Blynk.run();
}
It’s the GPS Stream one from the code generator, wanted to test stuff out before doing the stuff I wanted to.
The device appears in the list, but if I manage to get the app connecting (also takes a lot of tries), I get
[35283]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.4.10 on Arduino 101
Waiting for connections...
[120727] Disconnected
In the serial monitor. (Only the Disconnected part appears after the attempted connection, everything else appears the moment I open Serial Monitor)