BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk not sending all data

#1

I have built a simple Temperature data LOGGING system. Concept is that the processor (esp8266) wakes up once a minute - inits data - connects to the WiFi - connects to Blynk Server (local server) - reads the BME280 data - sends 8 lines of data (to Labeled Value Widgets) - then goes into Deep Sleep.

In general this works great - however about every 3 cycles - the last piece of data sent - fails to show up in the application. This one is the Log Entry time - so this is an easy one to know since the “log entry counter” (which is the 1st of the 8 entries) shows I did an update - but the time value (which is the 8th one - last value) is not updated each time.

So my question is - is there some value or function in Blynk that I can check - to be certain the data was “sent”.

Thanks

:

0 Likes

#2

Coding for deep sleep with Blynk is very different to coding normal Blynk sketches.
delay() commands are needed, everything SHOULD go in the void loop to ensure that it executes only once and timers shouldn’t be used.

However, multiple Blynk.run() commands are needed to ensure that all uploads are completed before the ESP goes to sleep.

The sketch in this post is a great example of how to do it:

Pete.

1 Like

#3

Pete,
First thanks for the reply. I looked at the example and basically I was doing the same structure. And it was still not working. Tried multiple Blynk.Run() commands - put in massive (2-5sec delays) and nothing worked.
Also found that it was easy to get the system to fire Exception 28 - which then fired a S/W watchdog because the serial dump was too long.
What a mess.

So playing around i learned a few things - and have lots more questions to research in the SDK and BLYNK libraries.

First - the system_deep_sleep_instant() had to be used the system_deep_sleep() function crashed the system with Illegal Instruction Fetch (who knows - that is for another day).

Second - Serial.Flush is my friend :-).

Third - if I enabled the BLYNK_PRINT it worked !!! Found this by accident attempting to add debug data to the code. So not certain what this is doing in the Blynk Library (again a dive for another time).

If you have any comment as to why this worked - would love to know.

But at this time I am moving forward with the project. But I realize I have a band-aid on the issue - not a solution.

Again thanks for your time.

0 Likes