Blynk / Electron Data Usage EXTREMELY HIGH

No need for power consumption, bandwidth is generally only consumed through communication, and while my sensors are running they aren’t necessarily calling anyone. The future plans for these will also involve control and not just sensing, so turning them off wouldn’t work anyway.

That link among others was one I used to get to the point I am at with code. Seems like it’s more a problem with how the Blynk libraries have been setup in the Particle Web IDE, someone probably needs to take a look at how the libraries were implemented there because the code seems like it isn’t linking something right.

That would probaly be an issue for ParticleIO, not here.

Have you tested any completely different Blynk sketches to compare bandwidth use? Break things down to very simple steps and compare each one as added.

Tracking bandwidth in an otherwise complex sketch can be like tracking why your power bill is so high… testing all the obvious appliances, but forgetting all the vampire wall warts and forgotten space heater in the crawlspace :wink:

Blynk.run() keeps all the required background functions running.

That would probaly be an issue for ParticleIO,

Good point, I had assumed that someone from Blynk had put that in.

Have you tested any completely different Blynk sketches

The sketch I am running is exceedingly simple and I have verified the output and what data is being sent to Blynk. I think the problems implementing the library is likely the source of the issue.

Once I can better control the keepalive and heartbeat through the defines I have a strong suspicion that the usage will drop significantly.

@jboswell
do you use 3rd party SIM?
if yes, this may be interesting for you:

Here are results of my test:

#define BLYNK_HEARTBEAT 120
#define PARTICLE_KEEPALIVE 60

And (once per minute):
 Blynk.virtualWrite(V2, millis() / 60000L);

After 12 hours, our local cellular provider reports 0.41 Mb of data usage.
It is really dependent on HOW your network provider counts the traffic.
I use 3-rd party sim, which I pay around $1.2 per month, and it includes 10Mb per day + Voice Call and SMS plans.
I consider this kind of charges completely adequate.
If you want to get low traffic, consider connecting to Blynk cloud only periodically to report sensor readings. It can be done either with Blynk library or our HTTP API.

I hope this helps.

1 Like

I don’t, but that being said you are right, this would be a workaround, I use the default SIM’s that I get with the Electron from the Particle people, a 3rd Party one would be substantially cheaper. That being said I do like (and would rather) give money to the Particle folks, just not in the amounts that was costing me. I will take a look at the third party sim as a workaround.

After 12 hours, our local cellular provider reports 0.41 Mb of data usage.

That still seems like a TON of data usage for something that reports a tiny amount of data 1440 times per day (half of that in this case).

Like I was saying, the problem seems to be that the library itself isn’t getting compiled properly from the Particle Web IDE, or the calls in my code aren’t overriding the Libraries default settings for some reason. I tried a connection every 5 minutes but that seems to have broken some widgets in Blynk itself, the historical graphs just stopped working…

I would love to see the libraries get fixed or whatever hierarchical issue with the heartbeat settings adjusted in code fixed, but I have enough to do already so just buying a SIM that will just give me a ton more data for dirt cheap seems like the easiest workaround for the moment. Thanks again for the suggestion!

No,.it may be not that related to how the library sends keepalives (it does this correctly). Ot is how the provider counts small tcp packets.
Keeping tcp is not very convenient for gsm :wink:

No,.it may be not that related to how the library sends keepalives (it does this correctly). Ot is how the provider counts small tcp packets

Not how it sends them, the changes in code on the particle web ide that don’t override the library defaults. So when I set the keepalive in my code I don’t see any difference in data usage between 20s keepalive/heartbeat or 300s. The Electron still uses the same amount of data regardless of significant data, and even, in fact, when not sending any data at all, just connecting to the Blynk cloud… That tells me it’s probably the connection to Blynk and not the data that I am sending AND also since the amount of data sent didn’t change when I changed the keepalive/heartbeat then it must be an issue with the code defined variable not overriding the library defined one.

I’m guessing you have a problem with the Particle IDE.

Stop guessing.you can prove your words by enabling BLYNK_DEBUG. Most probably you made mistake in your code,.if it doesn’t affect anything…

I feel like you might’ve missed the part in this thread where I mentioned that I also have that enabled and nothing is happening… /shrug

I posted my code too, please do show me the mistakes. This code worked fine with Ubidots and didn’t skyrocket my data usage there, almost completely identical code from one platform to the next… This code is a couple years refined at this point.

You are guessing correct, whoever implemented the library in the Particle Web IDE has decidedly not tested it with an Electron and the default SIM card. I took all my code out and just Blynk Run by itself drives tons of data usage (likely because even though the Heartbeat and Keepalives are set tremendously higher than their defaults, the data usage doesn’t change.

What I meant was YOU have a problem with the Particle IDE, not Blynk.

2 Likes

I was happy to find this thread which seems unresolved as yet. I am having the same problem with my GPS code on Electron with Blynk app.
I have tried systematically disabling various functions to find the cause of my extreme data usage which is upward of 1MB per day for publishing a location no more than once per hour. Granted within the app, location data is pushed to a map and lcd widgets, but that turned out to make very little difference. Disabling that push made no difference at all.
The killer turned out to be here:

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

That must be a lot of handshaking going on.
I have not tried messing with the heartbeat but it doesn’t seem to have helped @jboswell.
I have also not gotten any debug prints on Serial just as jboswell with those lines enabled. Perhaps the programmer shield might be a good debugging tool here?
@vshymanskyy would you mind posting your source for the 3rd party SIM? I have not been able to find any reasonable alternative to the Particle SIM.

@Slide it’s covered in the Particle Community forum.
You can also use Blynk.disconnect() and .connect() just when you want to send out the data.

I am pretty sure my BLYNK_WRITE() calls would not work at all if I was only using timed pushes with connect/disconnect.

it’s covered in the Particle Community forum.

Uh, no. They publish a lot of information about how to use 3rd party SIMs, but draw the line at naming providers, because of course, surprise , surprise, they make a fair bit of coin selling data. Nothing wrong with that.
No worries, I found a provider which was well beyond my expectations. $0.99 for activation, $0.01 to mail the SIM, $0 monthly fee, 100MB free every month, $0.02 additional per MB, and rollover data up to 20GB. Seems to be working well at the moment.

2 Likes

Names please :slight_smile:.

1 Like

@Slide I’ll try to post some info on how to use 3rd party SIM soon.

I agree. Name please of the company you found that deal with?