Terminal has new bad behavior - Not flushing and scrolls to top on App start

Have uninstalled 2.15.3 and installed APK, which seems to be 2.15.2.

Seems like println’s are writing correctly.

But upon opening Blynk app, the terminal screen isn’t scrolled to bottom where latest lines are written, it’s at the top. If I kill the app, then reopen, it is at the bottom for a second, but then seems to “refresh” and scrolls up to the top.

I haven’t seen any duplicate lines, but that wasn’t happening often enough to figure out the scenarios that created them.

I think that’s a “feature”. I’m mainly working in “My Apps” so it might be slightly different for regular projects but for me when I open the App the terminal window is always empty so the cursor being at the top is “correct”. As I continue to use the App the text scrolls as required and the Terminal window will be empty if I leave the App and return to it.

I think I understand how you’re using terminal, @Costas. Seems like you’d never be affected by the scrolling back to old data if you’re always starting with a clean terminal window. I’m using terminal window as an activity log, so terminal collects data even if the app isn’t open, but when I do open it, has the last 25 lines of activity, which is enough for my purposes. The terminal is pretty big, but not 25 lines big, looks like 18 lines, so whenever I open app, terminal scrolls to top, which isn’t the latest, last lines added. Since it’s initially at the bottom for half a second, then pops up to the top, this could indeed be the programmed behavior, but, as in my case, isn’t the desired behavior. If this “jump to top” is, in fact, being done on purpose, programmatically, I wonder if an option in the widget settings could be added to turn that off? Now that I’m saying this, though, I’m certain that it didn’t behave this way not that long ago. This isn’t the end of the world, I can flick my thumb and scroll down, but seems odd that anything that scrolls would go to outdated information instead of last line. Wouldn’t it be strange if your DOS window scrolled up to the top every time you switched to a different window then came back?
Any chance I could get an APK for, say, 2.15.1, or maybe even a 2.14.x and try it out? I don’t mind doing what I can to help figure it out. Blynk is awesome, this community is awesome, happy to help if I can!

So it is only not scrolling on the beginning? Is it scrolling to the end on lines additions from server/input?

@BlynkAndroidDev, in last days i also observed that terminal is loosing connection after a while:

currently, for testing, i send data to terminal every 5 seconds, this data contains full rtc timestamp.

at the begining the timestamps just keep coming every 5 sec, but after a while the terminal stops displaying any new data.

even if i restart the mcu, the terminal in the app does nothing. to receive again the data i have to stop project, wait some seconds and re-start project (play button). after this, again works correctly for some time.

at the moment i couldn’t identified the cause for this. tried switching tabs, putting the app in background, locking the phone screen, but it worked after all. so i’m not sure what causes this. maybe time related?

i use the latest app from google play

Hm, thanks I’ll check, we have in app limit up to 500 lines, so it could be somehow related to this limit.

limit 500 lines for hour? day? last restart?

this limit means that it caches only last 500 lines. it is not limit in lines for use, currently it is a bug that it stops updating after them. will be fixed soon.

@BlynkAndroidDev
So it is only not scrolling on the beginning? Is it scrolling to the end on lines additions from server/input?

Correct, when I first open app and select the project, the terminal is scrolled to the bottom, but immediately maybe .5 seconds after opening, it pops up to the top, indicated by the scroll bar at the right. If I open a door it jumps back down to the bottom, and stays there. If I do something else on my phone, but don’t kill the Blynk app, and then come back to it, then terminal is still on the bottom, as I’d expect. It only pops up to the top of the terminal window, the old data, when I start the Blynk app fresh, wasn’t running. If I’m looking at the terminal and open/close doors, it does autoscroll as desired, I do have the autoscroll option on. I did try turning that off, still pops up to the top when I first open app, and doesn’t scroll down to bottom when new data comes in, also as expected, but not desired in my case (not sure why you’d ever want terminal not to autoscroll). Could something related to the autoscroll option for this widget be causing the window to refresh to the top?

Blynk app automatically updated on my phone to 2.15.3 again, can confirm that some lines aren’t appearing when they should. When I open a door, it appears in terminal. When I shut it, nothing, but when I open that same door again, two lines appear, the previous close and the second open. I can also confirm that, while it doesn’t appear in terminal, my sketch is writing it to Blynk Cloud; If I open the door, see the line, close the door, nothing, but if I kill the app and reopen, it appears in terminal, and with the correct timestamp from minutes before that my sketch wrote . Again, my sketch isn’t changing, but this behavior is different between 2.15.2 and 2.15.3.

Hope this helps, sorry for being so verbose. Again, this is a minor thing, and doesn’t bother me enough to change my project, but I can imagine where this behavior is more than an inconvenience. Thanks guys! Will try to get a screen grab and post…

Thanks, next huge release will contain also fixes for the terminal issues, and I hope will finish it’s fixes.

1 Like

Thanks much @BlynkAndroidDev, looking forward to it!

Screenshots show fresh opening of Blynk app, right as it pops to the top. Second shot is after I swipe my thumb up to see the most recent data. Hope this helps makes sense of what I’ve been reporting…

It seems already established that this issue exists… but I figured I would add my confirmation of this “terminal contents popping to the top” action whenever opening project in App… just moving to another project and back will cause it to scroll to the top. I think it started a couple of versions ago.

Agreed, I can confirm the same behavior @Gunner describes.

me too :slight_smile:

1 Like

Dear App developer,
could you please give me an approximation, when next app update will be happens?
My problem is related with the terminal widget behaviour discussed in other (EDIT - this) thread…

Thanks

@Gunner Thanks a lot Sir !

Last night’s update fixed all scrolling problems for me! Multiple projects and two different droid phones, scrolling is now at the bottom, last lines written. Thanks guys!!!

2 Likes

Not that I’m complaining, but I have noticed, after the latest update, that the terminal does go down to the bottom, but if I scroll up to see old data it’ll pop back down to the bottom after a second or two, as if the scroll is being forced to the bottom. @Costas, can you confirm this behavior? Maybe that was the solution (or workaround) to the problem?

If it matters, I’d rather have it at the bottom, latest written data, when I open the app. If it behaves a little odd when I scroll to the top, oh well, I’d rather have it that way then have to manually go to the bottom every time! Thanks again for the good work, guys!

How often do you update the terminal? It goes to bottom on every update.

1 Like

I was just going to ask that.

@brianr the only other way is for you to turn scrolling off.

1 Like

@BlynkAndroidDev Terminal is now performing much better. However it only seems to perform like a true Terminal if the phone is “watching the Terminal”. So if the phone is plugged into a charger and left alone you can see quite a big history in the Terminal window. However, when not on charge, if the phone sleeps it will sometimes show the latest posts but not very many and sometimes it shows no posts at all.

Why is Terminal history not available when the phone wakes?

It’s probably more important that it works when it wakes than it is if it never sleeps. What I mean by this is that if the phone is awake and you are using the app you generally know what it’s doing without confirmation from the Terminal. Whereas if you have not been using the app, perhaps through the night when the phone is sleeping, it would be nice to see the history.

For reference we are using My Apps on a cloud server.

Would it help if we changed the following line in server.properties from:

terminal.strings.pool.size=25

to

terminal.strings.pool.size=2500