How do we get startup messages from Blynk on an external display

How do we get messages sent to the serial on an external display? e.g.

20:42:23.442 -> [2890] Connecting to WiFi: MYWIFICONN
20:42:26.872 -> [6341] Using Dynamic IP: 192.168.1.116
20:42:26.952 -> [6341] CONNECTING_NET => CONNECTING_CLOUD

The purpose is to have some of the init messages to guide a user to connect… or to debug when the device is unable to connect to network without having to plug in a serial cable.

use termnal widget

I would recommend you to use a nextion display and serial communication.

I mean like in code… e.g. println something. I want to display it on an OLED display.

I believe it’s display.printIn

It depends on the library you use for your display.
I suggest you look at the documentation and examples for that library.

Pete.

Actually I mean how can I even get that data out to a string variable without having to modify the core code… e.g. i know this

void enterConnectNet() {
  BlynkState::set(MODE_CONNECTING_NET);
  DEBUG_PRINT(String("Connecting to WiFi: ") + configStore.wifiSSID);

but how do i get to do something like

display.println(String("Connecting to WiFi: ") + configStore.wifiSSID);

without having to modify core code

The approach I’ve used in the past is to bridge the Rx and Tx pins on the board and run a sketch like this one…

The send_serial function captures the serial output to a variable, which in this case was sent to the terminal widget.
You have to remove the Rx Tx jumper before uploading new code via the USB port, but not for OTA updates.
Also, this line of code:
Serial.setRxBufferSize(1024);
is needed to ensure that you have a large enough buffer. Without it you can lose some of the serial output.

Pete.

2 Likes