BLYNK_DEBUG print to terminal

I can’t get this code working on an ESP-12F…

Nothing comes up in the terminal that I havn’t specified in the code.

I have it running on a MEGA 2560 with Serial1 as the 2nd hardware serial port. So you would have to adjust accordingly to your setup.

And it doesn’t really work anyhow :stuck_out_tongue: I am working on something a bit more elegant… with less LED’s :wink: But right now this is becoming an exercise in knowledge as I fail to see how practical it could be, since during a connection failure, all the important data would never get to the terminal anyhow.

Yeh I changed Serial1 to Serial etc… but still nothing showed up… and dont have a Mega to test myself.

I think its time for @Costas to come to the rescue :stuck_out_tongue:

Do you have any USB 2 TTL adaptors to hook up to your ESP?

No, none :expressionless:

You shouldn’t need one… Set your programming port as the BLYNK_PRINT, IDE Monitor and link to pass the data to the widget terminal.

Wait… you are using this?? Where do you plug anything in? You must have a full breakout board or something to go with this.

Or check with @Costas whether it is even worth trying… my code may be crap :stuck_out_tongue:

I can’t explain it… somewhere between getting the screenshots and pasting my code in this post… I was trying so many things, that I must have dropped a decimal or something… because I can’t get it (what is pasted above) to work either?

And thanks to a mishap here (i.e. I forgot to save and said yes to an update reboot), I lost my “working” copy. :unamused:

Arrggg

Got it mostly working but never posted my results… at least here :wink: so for finality, here it is:

#define BLYNK_PRINT Serial1

String inputString = "";
void serialEvent1() {  // Check for data on 2nd serial port
  while (Serial1.available()) {
    char inChar = (char)Serial1.read();
    inputString += inChar;
    if (inChar == '\n') {
    Blynk.virtualWrite (V1, inputString);
    inputString = "";
    }
  }
}
BLYNK_LOG("Gunner has Ser>Term too ;) ");  // Called every second via timer for RTC display

2 Likes

Lol. So huge LEDs :joy:

Ah… I hadn’t noticed… even with both apps being 2.8.3 the LED’s on my tablet are actually bigger in scale (but text is slightly smaller) than on my phone:

(Nexus 6 - 2,560 x 1,440)

(Samsung Note 8.0 - 1,280 x 800)

In fact they are almost “true” 10mm LED’s on the tablet :smiley: I like it!! :+1:

3 Likes

Are you are willing to reveal how you got the whole ASCII image to print on terminal? Pretty Please :smiley:
I am still getting only partial logo and lots of ??? in diamond symbols on my attempts… hoping you might have some secret you have yet to reveal?

Despite to the fact I didn’t post anything here (no time to play during last weeks…:sweat:), I’m interested in this feature!! Please @Costas!! :blush:

Two months later, but I finally got that darn Blynk logo to show properly on the terminal… one way or another… :wink:

2 Likes

@Gunner very nice, do you have the code?

P.S. very ugly clock :slight_smile:

Ah, yes… The Code… well… sorta…

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? :blush:)

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 :stuck_out_tongue:

One of these days I will try again on a clean, dedicated project… less data should mean less � and properly placed \n should help.

:grin:

/*
  getCurrentTime() -
      - return the time as 'HH:MM:SS'
*/
String getCurrentTime() {
  String extraZeroH = "", extraZeroM = "", extraZeroS = "";
  if (hour() < 10) extraZeroH = '0';
  if (minute() < 10) extraZeroM = '0';
  if (second() < 10) extraZeroS = '0';
  return String(extraZeroH + hour()) + ':' + extraZeroM + minute() + ':' + extraZeroS + second();
}
/*
  getCurrentDate() -
      - return the date as 'DD:MM:YY'
*/
String getCurrentDate() {
  return String(day()) + '-' + monthShortStr(month()) + '-' + (year() - 2000);
}
/*
  curDateTime() -
      - return the dat & time as String 'DD:MM:YY HH:MM:SS'
*/
String curDateTime() {
  return getCurrentDate() + String(" ") + getCurrentTime();
}
1 Like

My display output is straight from the example in the Sketch Builder… you should request your code be substituted in :wink:

Now this code monkey is activating copy/paste mode :stuck_out_tongue_winking_eye: Although, in my defense, I was actualy reading up on something simular in the Time library examples:

And to keep this topic… well, on topic :wink:

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.

1 Like

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.

Blynk.virtualWrite(V1, "\n"
                     "    ___  __          __\n"
                     "   / _ )/ /_ _____  / /__\n"
                     "  / _  / / // / _ \\/  '_/\n"
                     " /____/_/\\_, /_//_/_/\\_\\\n"
                     "        /___/ v" BLYNK_VERSION " on " BLYNK_INFO_DEVICE "\n");
  if (size_t ram = BlynkFreeRam()) {
    Blynk.virtualWrite(V1, "             Free RAM: ", ram);
  }