Hi there,
I have been using a Wemos d1 mini and an Iphone 6S for my project with Blynk for some time without any problems.
However, I wanted to display the time and date from a real time clock on my
Blynk app. So I loaded the terminal widget. However, I am getting error messages
when I compile the program using the Arduino IDE and the terminal.print command.
The error message is “invalid conversion from ‘const char to int’ [-fpermissive]”
I wanted to use the terminal program so that I could clear the screen between writes.
Actually, it would be useful to have a one line text and data widget.
WidgetTerminal terminal(V10);
void timer() {
Blynk.virtualWrite(V10, "Test "); //THIS WORKS
terminal.print(V10, "Test "); //THIS DOES NOT WORK
}
void loop()
`
thanks in advance
Personally, I prefer to use the Blynk.virtualWrite(V10, "Test ") approach, rather than using the terminal wrapper, as it gives more consistent results.
if you look at the WidgetTerminal.h file in the Blynk library files you’ll see that this is acting as a wrapper for terminal commands and is simply doing Blynk.virtualWrites in the background.
Hello Pete,
have worked further on the terminal widget.
The command:
terminal.println();
Does not force a carriage return with or without text. The virtual pin is contained in the widget statement as discussed above.
I have had to use Blynk.virtualWrite to buffer the previous line with spaces to force a carriage return, because the previous line does not have enough characters itself.
In other words, the previous line reads “Last SD Card Write 16/10/2020 08.40” for example and the following line, the data sent to the sd card.
Hi Pete, thanks for the help.
I tried:
terminal.print(" ");
and this does not work. I have to go out so will try the other variants later.
All the best
John
Hello Pete, you are quite right, I needed the “ln” in order to CR.
However, I tried all these. None work except your last suggestion of:
Blynk.virtualWrite(V0, “\n”); //Worked perfectly.
this is my test. (using “V0”
terminal.flush(); //Works
terminal.clear(); //Works
Blynk.virtualWrite(V0,“test”); //to send data to terminal line 1
terminal.println("\n"); //Did not work
terminal.println(" "); //Did not work
Blynk.virtualWrite(V0, “\n”); //Worked
Blynk.virtualWrite(V0,“line 2”); //Send data to terminal line 2
Perhaps this post is not the place to raise another issue with Terminal.
If so let me know please and I will create a new post.
When my app is running, if I pause the app, or go to my emails etc, the text written to the terminal vanishes and cannot be scrolled. This happens immediately I return to the app.
As I can now manage the data going to terminal, the only issue is for Blynk to get to the bottom of why the terminal.println does not carriage return. This statement is clear in its use as in the sample sketch Blynk provide in their documentation.
It sounds like you have a workaround to the need to begin a new line in the terminal, so why not use that?
As far as the terminal clearing when the app loses focus, that was an issue we were having with the iOS version of the app previously, which was fixed in a later release. I guess you’re running the app on Android?
Hi, yes, the writing to the terminal is working fine now.
However, the terminal clearing problem is with my Iphone 6S. I have the latest software upgrades downloaded.
Something interesting though, I changed the background colour and text for the terminal. Surprise, surprise, no matter what I tried, I then could not replicate the problem. I have not tried going back to the black background to see if this problem would return.
There is a rather lengthy topic about an issue that was identified with version 2.25.0 (3) and beta version 2.26.0 (2) of the iOS app.
This wasn’t actually about the display clearing, but about it refreshing after an idle period or losing focus then duplicating the previous output of the terminal and causing duplication.
However, it does sound somewhat connected, and maybe the “keep alive” solution of writing ‘nothing’ to the terminal every 10 seconds would help the problem if it recurs. Here’s a link to the relevant post of using a timer to write ‘nothing’ to the terminal, but if you have a spare hour of your life that you don’t want back then you can read the whole topic…
Hello again,
with this game, there is always something around the corner!!
Thanks for the ideas. I will try them.
However, guess what, I took my app offline in order to change a setting with terminal.
The last write to the terminal screen was visible. Then I changed the size of the terminal box. As soon as I did that the text vanished, except leaving me with two characters from the write.
There is another small issue with terminal. My main screen is full of widgets and the terminal screen only shows enough to display 2 lines at the bottom of the main screen.
In order to enlarge or reduce the size of the terminal screen, I have to first move the terminal widget down the second screen.
When the change size is enabled (shows dots to resize), if the screen is normal size then I can reduce the size of the screen. Once the screen is reduced I cannot increase the size without deleting the terminal widget and re-loading it, or moving the terminal screen down the second page and then resizing it. It will not re-size from the main page if the terminal screen position is bang up against the widget near the bottom of the main screen. This does not affect my use of the widget, only that people should be aware of the situation.
By the way, I think the Blynk service overall is fantastic.
I’m having the problem with the terminal clearing when the app loses focus. Using Android 1.3.13 and Blynk Cloud. The text appears fine, but disappears if you switch to another app, then return to Blynk.
If you’re using Blynk IoT then data retention has not yet been implemented in the Terminal widget.
If you do a search then you’ll find several topics on the subject.
If you’re using Blynk Legacy then it’s no longer supported.