Serial terminal (VT100) with automatic save specified data

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.
Reply to
Stef
Loading thread 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.

Reply to
Anssi Saari

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 
andrews@sdf.org
Reply to
Andrew Smallshaw

vineri, 7 decembrie 2018, 14:20:42 UTC+2, Stef a scris:

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...

Reply to
raimond.dragomir

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
Reply to
Stef

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

Interesting, just a simple [5i to start and [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"
Reply to
Stef

On 2018-12-07 snipped-for-privacy@gmail.com wrote in comp.arch.embedded:

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)
Reply to
Stef

On 2018-12-07 Stef wrote in comp.arch.embedded:

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 [5i and [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"
Reply to
Stef

Some extensions to Xmodem did, as does Ymodem.

Theo

Reply to
Theo

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

Reply to
John Speth

On 2018-12-08 John Speth wrote in comp.arch.embedded:

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:

formatting link

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

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

There should be open source implementations around. The one I remember using in Linux is lrzsz at

formatting link
Of course, I have no idea how hard it would be to adapt that to your system.

Reply to
Anssi Saari

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 
andrews@sdf.org
Reply to
Andrew Smallshaw

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 
andrews@sdf.org
Reply to
Andrew Smallshaw

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.
Reply to
Stef

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.
Reply to
Stef

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.