Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Serial terminal (VT100) with automatic save specified data

162 views
Skip to first unread message

Stef

unread,
Dec 7, 2018, 7:20:42 AM12/7/18
to
For a test setup, I have created a small UI using the serial port
connected to a VT100 capable terminal (Tera Term).
I use the VT100 commands to create a "nice" (for certain values of nice)
looking output. This works OK.

But now I periodically (every few seconds) have an amount of data that
needs to be stored on the PC. A CVS like output with a 100 lines or so.
I can just spit this out after the menu, surrounded by some division lines
and copy paste out of the terminal, or dig through the log file (with
thousands of VT100 commmands between the data). But there must be an
easier way.

Do you know of a way (in Tera Term or other terminal) to automatically
save this data? Using some kind of modem protocol for instance?

Preferrably the data does not even show up on the screen and may be
even the file name could be set by the serial data.


--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

He who foresees calamities suffers them twice over.

Anssi Saari

unread,
Dec 7, 2018, 8:31:49 AM12/7/18
to
Stef <ste...@yahooI-N-V-A-L-I-D.com.invalid> writes:

> Do you know of a way (in Tera Term or other terminal) to automatically
> save this data? Using some kind of modem protocol for instance?
>
> Preferrably the data does not even show up on the screen and may be
> even the file name could be set by the serial data.

Terminal programs typically support downloads via zmodem which is a
protocol that allows automatic downloads and you can set the filename in
your system. I haven't used tera term in a few years but I'd assume file
transfers like that are supported. Of course, you'd have to implement
zmodem in your system.

Andrew Smallshaw

unread,
Dec 7, 2018, 10:32:08 AM12/7/18
to
On 2018-12-07, Stef <ste...@yahooI-N-V-A-L-I-D.com.invalid> wrote:
>
> But now I periodically (every few seconds) have an amount of data that
> needs to be stored on the PC. A CVS like output with a 100 lines or so.
> I can just spit this out after the menu, surrounded by some division lines
> and copy paste out of the terminal, or dig through the log file (with
> thousands of VT100 commmands between the data). But there must be an
> easier way.

The likes of X/Y/Zmodem have already been mentioned, don't know
what your specifc terminal emulator would support. Xmodem is
easiest to implement with the proviso that you don't have exact
control over file size, for text data that is unlikely to be a
serious issue though.

The other option that comes to mind would be local terminal printing,
many terminal emulators can save this to a file automatically, I
know PuTTY can for example. That's trivially easy to implement
for ANSI terminals such as the VT100, one control code to switch
to the printer, output the text and another to switch back to screen
output.

--
Andrew Smallshaw
and...@sdf.org

raimond....@gmail.com

unread,
Dec 7, 2018, 10:41:57 AM12/7/18
to
The easier way would have been a real software for the PC.
But you invested in a no-pc-software solution and you dig now
for a work-around.
Maybe a python script or something like that to extract
your real data from the log file full of VT100 commands?
But this is also a kind of pc software...

Stef

unread,
Dec 7, 2018, 11:12:04 AM12/7/18
to
Zmodem looks indeed capable of what I want to do and is supported by
Tera Term. But implementing it is not that easy it seems. I'll have to
see if it's worth the trouble for this test setup. Thanks.


--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

And it should be the law: If you use the word `paradigm' without knowing
what the dictionary says it means, you go to jail. No exceptions.
-- David Jones

Stef

unread,
Dec 7, 2018, 11:34:04 AM12/7/18
to
On 2018-12-07 raimond....@gmail.com wrote in comp.arch.embedded:
> vineri, 7 decembrie 2018, 14:20:42 UTC+2, Stef a scris:
>> For a test setup, I have created a small UI using the serial port
>> connected to a VT100 capable terminal (Tera Term).
>> I use the VT100 commands to create a "nice" (for certain values of nice)
>> looking output. This works OK.
>>
>> But now I periodically (every few seconds) have an amount of data that
>> needs to be stored on the PC. A CVS like output with a 100 lines or so.
>> I can just spit this out after the menu, surrounded by some division lines
>> and copy paste out of the terminal, or dig through the log file (with
>> thousands of VT100 commmands between the data). But there must be an
>> easier way.
>>
>> Do you know of a way (in Tera Term or other terminal) to automatically
>> save this data? Using some kind of modem protocol for instance?
>>
>> Preferrably the data does not even show up on the screen and may be
>> even the file name could be set by the serial data.
>> He who foresees calamities suffers them twice over.
>
> The easier way would have been a real software for the PC.
> But you invested in a no-pc-software solution and you dig now
> for a work-around.
> Maybe a python script or something like that to extract
> your real data from the log file full of VT100 commands?
> But this is also a kind of pc software...

How would this be easier? It requires developing a PC application.
Remember this is just for testing. The final device will just have
a start button and a few indicator lights. But during testing having
some intermediate results is required.

And yes, I can just search the logs for the data. I was just hoping
there is an easier solution for this temorary 'problem'.

--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

(null cookie; hope that's ok)

Stef

unread,
Dec 7, 2018, 11:34:04 AM12/7/18
to
On 2018-12-07 Andrew Smallshaw wrote in comp.arch.embedded:
> On 2018-12-07, Stef <ste...@yahooI-N-V-A-L-I-D.com.invalid> wrote:
>>
>> But now I periodically (every few seconds) have an amount of data that
>> needs to be stored on the PC. A CVS like output with a 100 lines or so.
>> I can just spit this out after the menu, surrounded by some division lines
>> and copy paste out of the terminal, or dig through the log file (with
>> thousands of VT100 commmands between the data). But there must be an
>> easier way.
>
> The likes of X/Y/Zmodem have already been mentioned, don't know
> what your specifc terminal emulator would support. Xmodem is
> easiest to implement with the proviso that you don't have exact
> control over file size, for text data that is unlikely to be a
> serious issue though.

Does X modem als allows the sender to set the filename?

> The other option that comes to mind would be local terminal printing,
> many terminal emulators can save this to a file automatically, I
> know PuTTY can for example. That's trivially easy to implement
> for ANSI terminals such as the VT100, one control code to switch
> to the printer, output the text and another to switch back to screen
> output.

Interesting, just a simple <ESC>[5i to start and <ESC>[4i to stop?
Certainly worth looking in to. Thanks.


--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

Receiving a million dollars tax free will make you feel better than
being flat broke and having a stomach ache.
-- Dolph Sharp, "I'm O.K., You're Not So Hot"

Stef

unread,
Dec 7, 2018, 12:04:03 PM12/7/18
to
On 2018-12-07 Stef wrote in comp.arch.embedded:
> On 2018-12-07 Andrew Smallshaw wrote in comp.arch.embedded:
>
>> The other option that comes to mind would be local terminal printing,
>> many terminal emulators can save this to a file automatically, I
>> know PuTTY can for example. That's trivially easy to implement
>> for ANSI terminals such as the VT100, one control code to switch
>> to the printer, output the text and another to switch back to screen
>> output.
>
> Interesting, just a simple <ESC>[5i to start and <ESC>[4i to stop?
> Certainly worth looking in to. Thanks.

Did some testing. Interesting, but not quite there yet.
Tera Term asks where it should print to and you can only select an actual
printer. Same for PuTTY, select a printer and output goes there. The
PuTTY log can only log 'all' or 'printable characters', the latter
meaning the non-printing chars and escape sequences are omitted from the
log. Have not found an option yet to only log/print to file what is
between the <ESC>[5i and <ESC>[4i.

--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

Once, I read that a man be never stronger than when he truly realizes how
weak he is.
-- Jim Starlin, "Captain Marvel #31"

Theo

unread,
Dec 7, 2018, 6:17:07 PM12/7/18
to
Stef <ste...@yahooi-n-v-a-l-i-d.com.invalid> wrote:
> Does X modem als allows the sender to set the filename?

Some extensions to Xmodem did, as does Ymodem.

Theo

John Speth

unread,
Dec 8, 2018, 10:42:13 AM12/8/18
to
> Do you know of a way (in Tera Term or other terminal) to automatically
> save this data? Using some kind of modem protocol for instance?

It sounds like you've received some good suggestions. A possibly
extreme solution would be to alter Tera Term. The source code is
available somewhere. I've made small modifications to it to suit my
needs over the years.

JJS

Stef

unread,
Dec 10, 2018, 3:08:42 AM12/10/18
to
A bit on the extreme side indeed. ;-)
Maybe some simple hack to change the VT100 print to log instead of print
would not be too complicated. But I would first need to get a build going,
I don't even think I have a compiler for Windows software ready for use.
Sounds like too much work for the tests I need to do now. But good to keep
in mind that it is a possiblity. I assume you mean source from this page:

https://ttssh2.osdn.jp/index.html.en


--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

HTTPD Error 4004 : very old Intel cpu - insufficient processing power

Anssi Saari

unread,
Dec 10, 2018, 9:01:38 AM12/10/18
to
Stef <ste...@yahooI-N-V-A-L-I-D.com.invalid> writes:

> Zmodem looks indeed capable of what I want to do and is supported by
> Tera Term. But implementing it is not that easy it seems. I'll have to
> see if it's worth the trouble for this test setup. Thanks.

There should be open source implementations around. The one I remember
using in Linux is lrzsz at https://ohse.de/uwe/software/lrzsz.html. Of
course, I have no idea how hard it would be to adapt that to your
system.

Andrew Smallshaw

unread,
Dec 10, 2018, 11:04:32 AM12/10/18
to
On 2018-12-07, Stef <ste...@yahooI-N-V-A-L-I-D.com.invalid> wrote:
> On 2018-12-07 Stef wrote in comp.arch.embedded:
>> On 2018-12-07 Andrew Smallshaw wrote in comp.arch.embedded:
>>
>>> The other option that comes to mind would be local terminal printing,
>>
>> Interesting, just a simple <ESC>[5i to start and <ESC>[4i to stop?
>> Certainly worth looking in to. Thanks.
>
> Did some testing. Interesting, but not quite there yet.
> Tera Term asks where it should print to and you can only select an actual
> printer. Same for PuTTY, select a printer and output goes there. The
> PuTTY log can only log 'all' or 'printable characters', the latter
> meaning the non-printing chars and escape sequences are omitted from the
> log. Have not found an option yet to only log/print to file what is
> between the <ESC>[5i and <ESC>[4i.

Hmm, you appear to be correct, I must have mis-remembered.

However, I've just had a play on this Win10 machine, setting up a
generic plain text printer outputting to FILE:. Worked quite
nicely, didn't even ask for a filename but used a default. It's
a separate file for each output job though, which may or may not
work out well for you. The same would be true for X/Y/Zmodem as
well though.

--
Andrew Smallshaw
and...@sdf.org

Andrew Smallshaw

unread,
Dec 10, 2018, 11:17:37 AM12/10/18
to
On 2018-12-07, raimond....@gmail.com <raimond....@gmail.com> wrote:
>
> The easier way would have been a real software for the PC.
> But you invested in a no-pc-software solution and you dig now
> for a work-around.

For many infrastructure devices I'd say the generic software approach
is to be preferred, it allows the user to use whatever platform
they want and removes a requirement on the developer to provide
ongoing support for that element at least. If the device is not
some commodity tat but a three, four or five figure peice of plant
or instrumentation it could well be expected to last twenty or
thirty years. Good luck using that 16 bit control app that was
originally supported on Windows 98.

And no, it's not just oddball stuff from smaller specialists that
this covers. Cisco comes to mind, sure, if it's on the network
you can FTP or SFTP across a new firmware image, but if it isn't
(it's been bricked for example) you are back to the console port
and uploading the image via Zmodem.

--
Andrew Smallshaw
and...@sdf.org

Stef

unread,
Dec 13, 2018, 5:21:43 AM12/13/18
to
Also found a piece of Zmode code that refers to lrzsz. All open source,
but a serious bit of code to add to a project. For now th PuTTY solution
with printing does what I asked for.

--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

Chisolm's First Corollary to Murphy's Second Law:
When things just can't possibly get any worse, they will.

Stef

unread,
Dec 13, 2018, 5:30:07 AM12/13/18
to
Just set up a Generic / text only printer and selected that in PuTTY.
And indeed, on the VT100 printing commands the output is printed to
file. All seperate files with automatic names, just like I wanted.

The file names are of course not very discriptive:
"PuTTY remote printer output (x).prn" with 'x' increasing on each job.
But in the print job I put a header with date and time and other info
so the jobs are recognizable. Very usable for my testing, thanks again.


--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

You will be traveling and coming into a fortune.
0 new messages