Patchy connection to the Blynk cloud

Hi All,

I just upgrded my library to 0.2.2 and I am still getting issues with a spark core and a simple BMP180 breakout.

The serial monitor reports “[87100] connecting to :8442”, as well as some other data to show the breakout is working.

Sometimes it connects and I get fast responses in the iphone app to changes at the sensors. However most of the time the ios app just say’s “core offline”

Any ideas how I can firm this connection up?



Could you please send us the sketch + the log?

@vhymanskyy Thank you for your super quick response.

What do you want? my .ino code is as follows,

/ This #include statement was automatically added by the Spark IDE.
#include "Adafruit_BMP085.h"
#define BLYNK_PRINT Serial
#include "BlynkSimpleSparkCore.h"

 * 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:
 *   Blynk community:  
 *   Social groups:    
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
//#define BLYNK_DEBUG // Uncomment this to see debug prints

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

	BMP085 Vcc to 3.3V
	BMP085 GND to GND
	BMP085 SCL to D1
	BMP085 SDA to D0

Adafruit_BMP085 bmp;

// Initialize BMP085

void InitializeBMP085(){
	if (!bmp.begin()) {
		Serial.println("Could not find a valid BMP085 sensor, check wiring!");
		while (1) {}

// Publish Pressure, Altitude
void PublishBMP085Info(){
    Serial.print("Temperature = ");
    Serial.println(" *C");
		Blynk.virtualWrite(0, bmp.readTemperature());

    Serial.print("Pressure = ");
		//Blynk.virtualWrite(1, bmp.readPressure());
    Serial.println(" Pa");

    // Calculate altitude assuming 'standard' barometric
    // pressure of 1013.25 millibar = 101325 Pascal
    Serial.print("Altitude = ");
		//Blynk.virtualWrite(2, bmp.readAltitude());
    Serial.println(" meters");

  // you can get a more precise measurement of altitude
  // if you know the current sea level pressure which will
  // vary with weather and such. If it is 1015 millibars
  // that is equal to 101500 Pascals.
    Serial.print("Real altitude = ");
    Serial.println(" meters");

    char szEventInfo[64];

    sprintf(szEventInfo, "Temperature=%.2f °C, Pressure=%.2f hPa", bmp.readTemperature(), bmp.readPressure()/100.0);

    Spark.publish("bmpo85info", szEventInfo);

// Initialize applicaiton
void InitializeApplication(){
	pinMode(D7, OUTPUT);

// Blink LED and wait for some time
void BlinkLED(){
    digitalWrite(D7, HIGH);
    digitalWrite(D7, LOW);

void setup() {
		delay(10000); // Allow board to settle

void loop() {
    // Publish events. Wait for 2 second between publishes
//		BLYNK_WRITE(10) {
  //  if (param.asInt()) {
  //      Spark.connect();
  //  } else {
  //      Spark.disconnect();
//    }

By log what do you mean??


This is generally a bad idea. Try rewriting your periodic actions using the timer library, like this one:

Does Blynk work fine with the default example?

1 Like

So I removed the delay (1000) and re-compiled. It started working straight away. Looks good so far. I will test it for robustness.

Thank you very much.



Hi… trying to learn one thing or another while going through the posts… could you elaborate shortly why this is a bad idea? As for the link: it would be great, if the sources are available without the need to sign in (thus having to create accounts just to follow a link). Is this something similiar to the SimpleTimer-library?



Sorry this is a third-party library so we don’t have any control about how the sources are published.
I’m sure it can be found on github.
Yes you’re right - this is similar to SimpleTimer.

Why is that bad: it usually prevents the controller from doing anything useful (like polling events, etc).