First offā¦Environment
Adafruit ESP 8266
Samsung Note 8 (fails)
Apple iPhone 7+ (does not fail)
Android Version 8.0.0
Kernel Version: 4.4.78-14375742
Build Number:R16NW.N950USQS5CRJ3
Carrier: T-Mobile
Connection: Local WiFi Router
Blynk Server v0.5.4
This has been dogging me for a while. There are repeating lines in my terminal widget on my note 8. At first I thought that it wasnāt there, and then it was, and then it was gone. Searches indicate that others have complained about something like this back a couple of years. It fails reliably on the Note 8, but doesnāt appear at all on iOS.
Once I figured out how to find it, the behavior is totally reproducible and appears to have virtually nothing to do with the local code and everything to do with the widget itself on my Note 8.
The code really doesnāt matter so I built a bare bones sample using the terminal and a timer. Since this is currently running on an esp8266, it uses WiFi.
My test code:
//*************************************************************
#define BLYNK_PRINT Serial
#include <BlynkSimpleEsp8266.h>
//Auth token
char auth[] = "xxxxxxxx";
BlynkTimer timer;
// Attach serial terminal to Virtual Pin V1
WidgetTerminal terminal(V1);
void sendUptime(){
//millis to Serial monitor
Serial.print("[");
Serial.print(millis());
Serial.println("]");
//millis to Blynk terminal widget
terminal.print("[");
terminal.print(millis());
terminal.println("]");
terminal.flush();
}
void setup()
{
// Debug console
Serial.begin(9600);
delay(5000);
//reconnect to cached valid WiFi connection
Blynk.begin(auth, "","");
// Clear the terminal content
terminal.clear();
// Print Blynk Software version to the Terminal Widget when
terminal.print("Blynk v" BLYNK_VERSION);
terminal.print(": Device started\n");
terminal.print("-------------\n");
terminal.flush();
timer.setInterval(4000, sendUptime);
}
void loop()
{
Blynk.run();
timer.run();
}
Serial Terminal printout is as one would imagine:
Connect indication and then time hacks in milliseconds every 4 seconds
[5040] Connected to WiFi
[5040] IP: 10.0.1.16
[5040]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
///_, /////_
/__/ v0.5.4 on ESP-12
[5135] Connecting to blynk-cloud.com:80
[5328] Ready (ping: 58ms).
[9529]
[13529]
[17529]
[21529]
[25529]
[29529]
[33529]
Blynk on the Note 8 is a little different
Startup message is duplicated, as are the time hack lines.
What makes this hard to find is that if you then minimize the Blynk app on the phone and then re-maximize, the duplicatesā¦simply disappear when the app is re-painted to the screen.
However, if you stop the app in the Blynk UI, the duplicates re-appear, but this time reordered as two complete sets of data:
If you again start the app in the UI, generally the duplicates will disappear again, although cycling back and forth between stop and start often looks good in the run mode, but sometime the two sets of duplicates re-appear even in the run mode.
Once the duplicates are eliminated and the run continues, subsequent data will again be duplicated and minimizing and maximizing the UI will eliminate them each time.
This seems to have something to do with the Terminal data buffer on the phone app, but without knowing the architecture I really cannot comment further. It is, however, totally reproducible on the Note 8, but again, never on iOS, at least on the iPhone 7+.