Adafruit ESP 8266
Samsung Note 8
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 is a real head scratcher since the repeating lines appear and then magically disappear, but I can assure you that it is totally reproducible and has virtually nothing to do with the Arduino code and everything to do with the widget itself on my Note 8. Can’t say anything about other Androids or IoS.
The code doesn’t matter so I just built a sample using the standard Blynk terminal example from Arduino IDE. Only change was from standard was the switch from ethernet to WiFi, since the card only supports WiFi. Here is the code, my auth is included since I built that app with one object only…a Terminal.
I added the millis() time hacks to convince myself that I wasn’t crazy since you need to do this test carefully. Look once and the problem is there…look again and it isn’t!
Here is what happens. When you start the 8266 and the app on the note, all text lines are repeated.
My test code:
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
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: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
You can send/receive any data using WidgetTerminal object.
App project setup:
Terminal widget attached to Virtual Pin V1
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <BlynkSimpleEsp8266.h>
//Auth token
char auth[] = "3eeb292da21f4b448625ec7cd81c7b5a";
// Attach virtual serial terminal to Virtual Pin V1
WidgetTerminal terminal(V1);
BLYNK_WRITE(V1)
{
terminal.print("[");
terminal.print(millis());
terminal.println("] ");
// if you type "Marco" into Terminal Widget - it will respond: "Polo:"
if (String("Marco") == param.asStr()) {
terminal.print("[");
terminal.print(millis());
terminal.print("] ");
terminal.println("You said: 'Marco'") ;
terminal.print("[");
terminal.print(millis());
terminal.print("] ");
terminal.println("I said: 'Polo'") ;
} else {
// Send it back
terminal.print("[");
terminal.print(millis());
terminal.print("] ");
terminal.print("You said:");
terminal.write(param.getBuffer(), param.getLength());
terminal.println();
}
// Ensure everything is sent
terminal.flush();
}
void setup()
{
// Debug console
Serial.begin(9600);
//reconnect to previous ESP WiFi connection
Blynk.begin(auth, "","");
// Clear the terminal content
terminal.clear();
// This will print Blynk Software version to the Terminal Widget when
// your hardware gets connected to Blynk Server
terminal.println(F("Blynk v" BLYNK_VERSION ": Device started"));
terminal.println(F("-------------"));
terminal.println(F("Type 'Marco' and get a reply, or type"));
terminal.println(F("anything else and get it printed back."));
terminal.flush();
}
void loop()
{
Blynk.run();
}
To reproduce the problem, follow these steps:
When the app first runs, and you enter some text, the terminal widget looks like this:
Then press the “minimize” or whatever the left hand button is officially called that shows all running apps:
Then re-maximize the Blynk app and magically, all is as it should be and the repeats are gone:
You can continue the action and the first round still looks good, but the second round again has repeating lines:
Minimize again and re-maximize…and again the duplicates disappear!!!:
This seems to have nothing to do with the ESP code since it happens on my custom code as well as with the Blynk terminal sample in the Arduino IDE.
Of course you can switch to another app or stop and start the app and the duplicate lines also disappear. It appears to have something to do with screen paint on MY ANDROID. Don’t know about any others. I am new to Blynk, but not to software development.