Blynk Using All My Program Storage Space

Hi,

I am using a TinyDuino and a TinyShield WIFI CC3000. The problem I am having is that just the basic Blynk libraries and functions are taking practically all my program storage space of 30k bytes of flash and 2K dynamic.

Take an example the minimum blynk code sample below takes me to:

  1. Commenting everything in the setup and loop functions: 12,328b (40%) - (29% dynamic)
  2. Enabling Blynk.begin at setup: 16,722b (54%) - (44% dynamic)
  3. Enabling Blynk.run at the loop: 20,634 (67%) - (46% dynamic)

And this is with BlynkPrint disabled or that would push me at almost 80% of program storage consumed.

I am not even doing any write or read actions or have any other code and my Arduino is practically full. My intended project consists of using 4 different TinyShield sensors along with Blynk but just adding one sensor and its related library plus logic is filling my memory completely. Before adding Blynk I could have all the code of the project for all the sensors a TinyScreen and libraries and not go over 70% of space.

Are there any plans around optimizing space consumption? Any ideas on how I can lower the flash footprint of the Blynk libraries or the CC3000?

// Pin definitions for the TinyCircuits WiFi TinyShield
#define ADAFRUIT_CC3000_IRQ  2
#define ADAFRUIT_CC3000_VBAT A3
#define ADAFRUIT_CC3000_CS   8

//#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <SPI.h>
#include <Adafruit_CC3000.h>
#include <BlynkSimpleCC3000.h>

//char auth[] = "************";

void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, "SSID", "PASS", WLAN_SEC_UNSEC);
}

void loop()
{
  Blynk.run();
}

+1 Im also interested in this. Ive had to remove some features of my project due to lack of free space. My code is bare bones right now.

Hello guys.

According to my calculations, Blynk consumes:

  bytes   functionality
----------------------
  2066    Blynk Protocol + Virtual Pins
+ 1132    Built-in functionality(digilal/analog operations)
+ 1976    Blynk Prints

You should add also size of other libraries you use:

+ 1720    Hardware Serial
+ 2602    Software Serial
+ 13218   Ethernet
+ 17096   CC3000

Again, it is everything an approximation.

We will make it possible to disable “Built-in functionality”.
I’ll post some sketch size measurements in the documentation a little bit later.

Question - within the Blynk libraries, I see SofwareSerial included amongst others. I could be wrong, but it does not look like your Blynk numbers include this? Am I missing something?

Yes, I just didn’t calculate the memory needed for SofwareSerial yet.
But it is used only in some sketches. I think it’s also about 2K.

Sure… However the issue I found was I had a sketch that did not need it, and it was required as part of the Blynk library itself. I could not comment out the include in the Blynk library without it failing - I also set Blynk debugging to false.

@TinyDude TinyDude sorry to hijack your thread. I can take this up in another thread if you like.

No, Software Serial is non needed by the library at all, unless you select it as the main transport, which is a valid configuration actually.
So basically, you can start a thread if there are any questions. Thanks!