www.8devices.com
View unanswered posts | View active topics It is currently 20 May 2024, 19:26



Reply to topic  [ 6 posts ] 
 Disable ANSI escape codes 
Author Message

Joined: 06 Jul 2012, 09:04
Posts: 5
Hello,

I need to disable the ANSI Escape Characters(those used for color highlightning and changing the cursor positions, etc.) on the serial console, because I'm sending the serial output directly to another microcontroller which sends this to a Teleprinter, so there is no need for colors.
I've searched for config files and looked into the kernel_menuconfig thingy, but could not find any option to select what the terminal output should look like.
Does someone know any way to tell the kernel, that I don't want those characters or any place where I can find informations about where to set up stuff like that?
Because my terminal also does have only about 60 characters per line and it would be nice if I could change the characters needed to make a new line.
I could parse the output to look for "Escape" Characters and cut off the highlightning or do the new line on the microcontroller, but it would be cleaner if I could change those things on the Carambola side.

Another thing I played around with is the u-boot bootloader. I tried changing settings (by "setenv variable status" then "saveenv"). Those settings were still there when I went again to this command line tool, but they weren't applied. I tried to hand over "bootargs loglevel=1" to disable the kernel log messages, but that dind't work(neither did chaning the bootdelay, baudrate, ...).
What am I doing wrong here?

Thanks,

Fred


22 Jul 2012, 18:17
Profile

Joined: 19 May 2012, 08:01
Posts: 16
Location: UK
Using /etc/inittab you can totally disable the console shell so it becomes a bare serial port for your exclusive use, or you could swap the ports so you still have a console shell on the other port, or just use the other serial port if your other device likes TTL levels. If you're using shell commands to output stuff then you can redirect it to where you want, e.g. another serial port, doesn't have to be stdout.

In my project I talk to another micro using the second serial port from a C program and it's just a bare port so nothing is interpreted (unless you ask for it, i.e. canonical mode). Using the serial port in C is quite well documented and very reliable.

What are you using to write your data?


22 Jul 2012, 22:13
Profile WWW

Joined: 06 Jul 2012, 09:04
Posts: 5
Thanks for the tip, I will look into that.
The whole thing is planned to be a Teleprinter with the Carambola built in,
so you have a wireless Linux Terminal with a Typewriter-like Interface.
If it would work just to open another Console on the second serial port without the kernel messages,
that would take me one step further, but still won't fix my Color-Codes and Outputs-too-big problems.


23 Jul 2012, 06:38
Profile

Joined: 19 May 2012, 08:01
Posts: 16
Location: UK
I see. I would investigate the TERM environment setting, try setting it to "dumb".


23 Jul 2012, 07:24
Profile WWW

Joined: 14 May 2012, 15:48
Posts: 196
You have to look into configuring bash to disable color codes.
But that alone won't help you getting rid of all of the control codes. Actually you should look more into these codes. The VT100 control codes do allow for setting terminal properties such as resolution (chars x lines). Also if you're using any kind of text editor or Text-UI on that console you'll be flooded with control codes (without those codes these programs couldn't behave the way they do).
So even if you don't want color on your terminal it seems to me you can't get around writing a parser for VT100. (Actually you can specify the terminal protocol in the same config where you enable the serial consoles, but VT100 is already the most basic one I think).
There's a lot of documentation on the net about VT100 and it's not too complicated to write a parser for it (I've done that before).


23 Jul 2012, 07:35
Profile

Joined: 19 May 2012, 08:01
Posts: 16
Location: UK
Indeed, this page for the "term" command mentions a "-m" for mono option.

http://linux.die.net/man/7/term


23 Jul 2012, 07:36
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.