Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get console on linux based cRIO ?

Solved!
Go to solution

zyl7, I absolutely get the use case, and indeed, the reasoning is roughly what I was guessing/estimating, but it's just that: I was guessing and I wanted to be sure. Also, it seems you already found the best place for the idea

0 Kudos
Message 11 of 18
(3,545 Views)

Hello,

I'm searching the way to get the console out of cRIOs on the secure shell.

What I've thought, but I'm not able to do, is to read in the SSH what the operative system wrote on the serial port.

Could this be a good way in order to obtain the solution?

Is there a way to do this?

 

Thanks

0 Kudos
Message 12 of 18
(1,076 Views)

Hi,

They will all say that you should use Syslog... You'll find Syslog client librairies in VIPM, and I use Kiwi Syslog server to get the messages. Messages will go through the Ethernet port and are not securized... At NI week 2017 they were all claiming that we should use Syslog and very surprised that 'folks' need a console... 

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 13 of 18
(1,069 Views)

Are you looking for the system log output, or do you have an application that is writing to the serial port?

 

In the former case, depending on what logs you are interested in, syslog-ng is configured to send logs to different places, depending on what is generating the message. A bit more information on what logs you are interested in (a particular daemon? the kernel? all of these?) would help shape an answer.

 

In the latter case, you can use one of a few tools: socat, interceptty, probably others, to setup a fake serial port that logs the data being sent and received, and forwards data to/from the actual hardware port. You would then configure your application to use the fake port (which will serve as a proxy for the actual port, logging as it does so).

0 Kudos
Message 14 of 18
(1,065 Views)

The latter is my case, but let me say that I have more than one application which write the serial port so it would be great if exist a way to read the actual port, simply read it in the SSH without have to install or redirect.

Some time ago I've read about strace, but I've never be able to use it.

Unfortunately I'm not so good both with Linux and with English language

0 Kudos
Message 15 of 18
(1,062 Views)

strace will certainly tell you what's being written to the serial port, but through the lens of listing all of the system calls that are being made by the application you're tracing (including the write()s that contain the text that's being sent to the serial console). You can limit the syscalls that are traced using the --sym flag, but that will still list all write()s that happen, whether they are to the serial port or not.

 

There are a couple of options listed out in this Stackoverflow

0 Kudos
Message 16 of 18
(1,034 Views)

Sorry, maybe i'm not understanding (my english is really poor).

My labview application on cRIO write the console out, and only it, on the serial port.

I'm able to connect to the cRIO by ssh on the ethernet port, not on the serial port.

What I need is exactly read in the ssh what cRIO is writing on the console out.

My console out messages are merely message for debug which i have to read as text on the screen, not matter if the ssh will be stucked.

I think that the programs you suggested drive only what is read from the serial port (in my case nothing) of the cRIO on another port of any type and i don't need it.

Have I understood well?

0 Kudos
Message 17 of 18
(1,029 Views)

Hi confra82,

 

Many of the programs in the linked Stackoverflow handle data written to the serial port as well as data read from the serial port (bi-directional). Some of the apps are meant to connect two UARTs, which is not what you were interested in.

 

If those are not suitable for what you want, you can always use strace, limit what is logged using the -e and -P flags (e.g. -e write -P /dev/ttyS0) and attach to the LVRT execution process (-p $(pidof lvrt)), that may get you what you are looking for

Message 18 of 18
(1,022 Views)