I just could not get a clean ASCII transfer from Debug to the terminal… and I had too much going on (in the app) to keep dumping my Debug back to the app, but I still wanted something to start the terminal off with… so I improvised (cheated? )
Are you ever going to show how you did it?
Blynk.virtualWrite(V1, "\n\n");
Blynk.virtualWrite(V1, " ___ __ __ \n");
Blynk.virtualWrite(V1, " / _ )/ /_ _____ / /__ \n");
Blynk.virtualWrite(V1, " / _ / / // / _ \\/ '_/ \n"); // to display a backslash, print it twice
Blynk.virtualWrite(V1, " /____/_/\\_, /_//_/_/\\_\\ \n"); // to display a backslash, print it twice
Blynk.virtualWrite(V1, " /___/ v");
Blynk.virtualWrite(V1, BLYNK_VERSION" on "BLYNK_INFO_DEVICE"\n\n");
Blynk.virtualWrite(V1, " Project By Gunner -\n");
Blynk.virtualWrite(V1, "Here to Kick ASCII and Chew Bubblegum\n");
Blynk.virtualWrite(V1, "... and I am all out of Bubblegum!\n");
terminal.flush();
And yes, I haven’t gotten around to properly outputting RTC to the display… just a lazy code monkey
My display output is straight from the example in the Sketch Builder… you should request your code be substituted in
Now this code monkey is activating copy/paste mode Although, in my defense, I was actualy reading up on something simular in the Time library examples:
After much complicated coding, involving detecting “\n”, buffering strings and inputString += inChar bla bla bla; I realised that keeping it stupid simple worked just as well…
This assumes #define BLYNK_PRINT Serial1 running on a MEGA’s 2nd hardware serial port:
//===== Terminal Widget - Debug Redirect =====
void serialEvent1() { // Check for data on 2nd serial port
while (Serial1.available()) {
terminal.print((char)Serial1.read()); // Fires data back out to terminal
}terminal.flush();
} // END serialEvent1 loop
As for getting the logo to fully display… I have given up on that with my current USB link setup, as I think that just adds another layer of serial conversion and lag, resulting in only a partial logo, while basic messages are usually clear.
But as I mentioned waaaayyy back… having device debug errors redirected to an app that probably can’t receive the debug errors, due to broken connection, is really a catch 22 situation. But it was fun to play around with.
PS, in case anyone else wants a nice Blynk Logo on their terminal at bootup, I cleaned up my origional (based on copy/paste of the image on my PC terminal) into this (using the proper way Blynk uses in their library files):
Each “line” is separated by the enter/return key, and auto format makes it look this way.
Old code I guess… The free RAM part was pulled directly from one of the Blynk library files… and I guess it worked that way?? (as evidenced by the screenshot), but eventually I apparently changed it
In file included from C:\Users\wanek\AppData\Local\Temp\arduino_build_504181\sketch\header.h:24:0,
from C:\ARDUINO\PROJECTS\sonoff core\sonoff_core_02\sonoff_core_02.ino:9:
C:\ARDUINO\libraries\Sonoff/SonoffCore.h: In function 'void checkFirstRun()':
C:\ARDUINO\libraries\Sonoff/SonoffCore.h:641:49: error: call of overloaded 'println(const char [11], size_t)' is ambiguous
terminal.println("free RAM: ", BlynkFreeRam());
^
C:\ARDUINO\libraries\Sonoff/SonoffCore.h:641:49: note: candidates are:
In file included from C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Stream.h:26:0,
from C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/HardwareSerial.h:31,
from C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Arduino.h:245,
from C:\Users\wanek\AppData\Local\Temp\arduino_build_504181\sketch\sonoff_core_02.ino.cpp:1:
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:84:16: note: size_t Print::println(unsigned char, int) <near match>
size_t println(unsigned char, int = DEC);
^
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:84:16: note: no known conversion for argument 1 from 'const char [11]' to 'unsigned char'
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:85:16: note: size_t Print::println(int, int) <near match>
size_t println(int, int = DEC);
^
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:85:16: note: no known conversion for argument 1 from 'const char [11]' to 'int'
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:86:16: note: size_t Print::println(unsigned int, int) <near match>
size_t println(unsigned int, int = DEC);
^
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:86:16: note: no known conversion for argument 1 from 'const char [11]' to 'unsigned int'
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:87:16: note: size_t Print::println(long int, int) <near match>
size_t println(long, int = DEC);
^
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:87:16: note: no known conversion for argument 1 from 'const char [11]' to 'long int'
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:88:16: note: size_t Print::println(long unsigned int, int) <near match>
size_t println(unsigned long, int = DEC);
^
C:\Users\wanek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0-rc2\cores\esp8266/Print.h:88:16: note: no known conversion for argument 1 from 'const char [11]' to 'long unsigned int'
Using library Sonoff at version 2.4.0-rc2-51 in folder: C:\ARDUINO\libraries\Sonoff
size_t Unsigned integral type Alias of one of the fundamental unsigned integer types.
It is a type able to represent the size of any object in bytes: size_t is the type returned by the sizeof operator and is widely used in the standard library to represent sizes and counts.
In , it is used as the type of the parameter num in the functions memchr, memcmp, memcpy, memmove, memset, strncat, strncmp, strncpy and strxfrm, which in all cases it is used to specify the maximum number of bytes or characters the function has to affect.
It is also used as the return type for strcspn, strlen, strspn and strxfrm to return sizes and lengths.
Yup… totally clear now… not
But I think it basically runs that get RAM function and fits the resulting number into that variable
I pulled the logo and whatnot from the BlynkProtocol.h file in my IDE Libraries folder. A few different options are available, like a pseudo 3D version.
have this function set in the blynk timer with a 800 ms interval:
void serialEvent() // terminal widget - debug redirect
{
while (Serial.available()) { // check for data on serial port
terminal.print((char)Serial.read()); // fires data back out to terminal
}
terminal.flush();
}
all i got are constant resets after startup… it resets for 4-5 times, after that it remains connected, but no debug data.
Well, a lot of what I was experimenting with was on a Arduino MEGA with multiple Serial ports…
But my next direction to take this will be based on my more recent post and vhymanskyy’s reference to the console object and class redirections, etc… I just haven’t been clearheaded enough to pursue it yet.