Blynk stuck in Login timeout on Arduino 101 BLE

I need some help with my project to visualize CAN-Bus data from a car via Blynk.

After some time the App will loose contact to the server (Android 6.0, WLAN, with latest App 1.14 from today), so I get a Heartbeat failure and then a Login timeout from which Blynk will not recover:

[25182] Ready [440416] Heartbeat timeout [445420] Login timeout [450420] Login timeout [455421] Login timeout [460423] Login timeout [465424] Login timeout [470425] Login timeout [475426] Login timeout
The sketch is still running and is responsive, but the Arduino 101 can’t be reconnected through BLE - it is no more “visible” (even to other BLE scan tools on other devices!).

Do you have a suggestion?


@odyssey can you please provide the minimum sketch that demonstrates the problem?

Here is the main-sketch with the Blynk connectivity (BLE) - have a look:

//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial

#include <BlynkSimpleCurieBLE.h>
#include <CurieBLE.h>
#include "canDiag.h"

#define CS     10                //!< chip select pin of MCP2515 CAN-Controller
#define CS_SD  8                 //!< CS for SD card, if you plan to use a logger...
MCP_CAN CAN0(CS);                //!< Set CS pin

canDiag DiagCAN;
BatteryDiag_t BMS;
ChargerDiag_t NLG6;
CoolingSub_t CLS;
DriveStats_t DRV;

CTimeout CAN_Timeout(1000);        //!< Timeout value for CAN response in millis
CTimeout DEVstatus_Timeout(2000);

WidgetLED LEDcon(V0);

unsigned long time = millis();
unsigned int delta = 0;

char auth[] = "auth token";

int state = 0;

BLEPeripheral  blePeripheral;

void setup() {

  //LED CAN-Bus active
  pinMode(8, OUTPUT);
  //LED BLE connected
  pinMode(7, OUTPUT);

  // MCP2515 read buffer: setting pin 2 for input, LOW if CAN messages are received
  pinMode(2, INPUT);

  // Initialize MCP2515 and clear filters
  DiagCAN.begin(&CAN0, &CAN_Timeout);


  Blynk.begin(auth, blePeripheral);


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

//Default handler for Blynk read requests (timing set in App-Widget)
  int pin =;
  switch (pin) {
    case V1:
      if(state = DiagCAN.ReadSOC(&BMS)) Blynk.virtualWrite(pin, BMS.SOC);
    case V2:
      if(state = DiagCAN.ReadSOCinternal(&BMS)) Blynk.virtualWrite(pin, BMS.realSOC / 10.0);
    case V3:
      if(state = DiagCAN.ReadHV(&BMS)) Blynk.virtualWrite(pin, BMS.HV);
    case V4:
      if(state = DiagCAN.ReadPower(&BMS)) Blynk.virtualWrite(pin, ((BMS.Power / 8192.0) -1) * 300);
    case V6:
      if(state = DiagCAN.ReadLV(&BMS)) Blynk.virtualWrite(pin, BMS.LV);
    case V7:
      if(state = DiagCAN.ReadODO(&BMS)) Blynk.virtualWrite(pin, BMS.ODO);
    case V20:
      if(state = DiagCAN.ReadVelocity(&DRV)) Blynk.virtualWrite(pin, DRV.velocity);
    case V21:
      if(state = DiagCAN.ReadECO(&DRV)) Blynk.virtualWrite(pin, DRV.ECO_total);
    case V22:
      Blynk.virtualWrite(pin, DRV.ECO_accel);
    case V23:
      Blynk.virtualWrite(pin, DRV.ECO_const);
    case V24:
      Blynk.virtualWrite(pin, DRV.ECO_coast);
    case V25:
      if(state = DiagCAN.ReadRange(&DRV)) Blynk.virtualWrite(pin, DRV.range);
    case V26:
      Blynk.virtualWrite(pin, DRV.HVactive);
    case V27:
      Blynk.virtualWrite(pin, DRV.usablePower);
    case V28:
      if(state = DiagCAN.ReadEnergyConsumption(&DRV)) Blynk.virtualWrite(pin, DRV.energyStart / 100.0);
    case V29:
      Blynk.virtualWrite(pin, DRV.energyReset / 100.0);
    case V30:
      if(state = DiagCAN.ReadUserCounter(&DRV)) Blynk.virtualWrite(pin, DRV.odoStart / 10.0);
    case V31:
      Blynk.virtualWrite(pin, DRV.odoReset / 10.0);

//Show status of CAN-Bus and Blynk connect
void DEVstatus() {
  boolean fConnected = Blynk.connected();
  if (!state || !fConnected) {
    state = DiagCAN.ClearReadBuffer();
  digitalWrite(8, state);
  //Serial.print("CANstatus: "); Serial.println(state);
  if (fConnected = Blynk.connected()) LEDcon.setValue(state * 255);  
  digitalWrite(7, fConnected);

void loop() {;
  if (DEVstatus_Timeout.Expired(true)) {
    DEVstatus();                                  //Poll CAN and connectivity status

When I get the Login timeout the DEVstatus() will still report the CAN-Bus traffic as expected!

It seems I found a solution, but maybe someone give further advice - THX!

  1. I optimized the calling time for the CAN query to < 100ms (timeout set to 200ms as max.)
  2. The MCP2515 lib now uses SPI.beginTransaction() and SP.endTransaction(). These functions are better in interrupt context.
  3. I needed to move away from the BLYNK_READ_DEFAULT() and now use the dedicated BLYNK_READ(pin):
  if(state = DiagCAN.ReadSOC(&BMS)) Blynk.virtualWrite(V1, BMS.SOC);


  if(state) Blynk.virtualWrite(V31, DRV.odoReset / 10.0);

  Blynk.virtualWrite(V40, IOcount++);

Now I can monitor and log my Smart ED during driving :wink: Here is a screenshot:

1 Like

Hello, newbie here. I failed to connect to Arduino 101 through BLE.

I tried with Samsung and Pixel phone (both with Bluetooth 4.2). I used the Blynk app on my iPad too but no luck. I use Inter Curie Library 1.0.7.

I used the Arduino_101_BLE example sketch. The serial monitor would say:

Waiting for connection…
[8053] Login timeout
[16284] Login timeout
[18999] Disconnected

My Blynk app can search the 101 but can’t connect to it.

I tried multiple days still can’t get it working. Can anyone help pls?

Please try 2.27.2 beta version for Android - it has some fixes and support for latest blynk library (which has changes for ble/bluetooth login flow)

1 Like

thanks it works!

Please switch to library v0.6.1, that also contains a fix for Bluetooth connectivity:

Does anyone know how to get this working for IOS I’m having the same problem with an UNO and just keep getting told to search the forum. And yes everything is up to date.

There’s an iOS beta program, delivered via Testflight, that has some Bluetooth improvements. You gave to contact @Eugene to get on the beta program.