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

Hi all,

 

I'm developping new things on a 9068 cRIO. This cRIO runs Linux RT.

I've built a cRIO app framework and using it since several years, I'm using the console to debug my code and have the status of my cRIO displayed.

I can't find a way to see the console with the 9068 when I send strings to it (see simple example attached to this post).

 

Anyone can help me to see what I'm sending to the console ?

 

BTW : I do not want to write debug strings to the serial port, only to monitor.

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 1 of 18
(8,510 Views)

zyl7,

 

There are a few things to look out for:

 

1. First, open MAX and find your controller under Remote Settings and make sure 'Console Out' is selected:
Capture.PNG

2. The second thing I would check is that your serial endpoint is set to 115,200 baud as stated in the manual. This is different from the 9600 baud on previous controllers.

3. If you boot into Safemode by holding the reset button down for 5 seconds, the controller will automatically turn on the Console for troubleshooting.

 

Best,

Tannerite
National Instruments
0 Kudos
Message 2 of 18
(8,501 Views)

Hi Tannerite,

 

  1. Why are you talking about a serial endpoint as I do not want to enbale the console on RS port, I only can access to my cRIO using its Ethernet port.
  2. As you may know, the console tab disappeared from the cRIO (Linux based) webpage... How can I see it ? Using Putty maybe ?
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 3 of 18
(8,498 Views)

zyl7,

 

I see. I misunderstood you initial post as wanting to see the console through the serial cable. Going back to the screenshot on my first post, you must enable the secure shell server by selecting the checkmark in MAX.

 

From there, you can ssh into the device using a tool like PuTTY to gain access to the console.

 

Best,

Tannerite
National Instruments
0 Kudos
Message 4 of 18
(8,492 Views)

Tannerite,

 

SSH is enabled on my cRIO.

Please read again my first post, i do not want to see what's in the cRIO. I want the cRIO to post data to the console ! Look at the snippet attached to my first post to better understand what I want to do.

This console out is availbale through the web page of previous cRIOs (VXWorks/PharLaps based)... but it disappeared for Linux based cRIOs...

 

So, my question is : how to see strings that I push on the console out (with 'Write to Monitor' option) using a Linux based cRIO (for ex 9068) ?

 

Thanks.

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 5 of 18
(8,486 Views)
Solution
Accepted by topic author CyGa

Actually, in order to get the output (which is destined for the serial port, either by means of the "monitor" output option, which requires enabling serial console to see, or the serial port as normal without configuring the console out) to be visible from over the network, there's not a great, straight-forward way to do that just over ethernet today.

 

An option that you have is to modify how lvrt is launched to log to a file and to access that file (either from lvrt, webdav, or ssh), writing the messages to the monitor. This is a more down-n-dirty approach but it would get the results that you wanted.

 

Edit the /etc/init.d/lvrt-wrapper or /usr/local/natinst/labview/lvrt-wrapper file to pipe the console/monitor to a file

(note that square brackets [ ]  denote a keystroke, lines that start with // are notes and should not be entered)

 

vi /location/of/lvrt-wrapper

// Go to the line that looks like "exec ./lvrt"

[i]

// Add the following to the end of the line

[space]>[space]/home/lvuser/lvrt.log

[:][w]

// The line should now look like "exec ./lvrt > /home/lvuser/lvrt.log"

// Restart your target, check the contents of the file with "cat /home/lvuser/lvrt.log"

Message 6 of 18
(8,474 Views)

Thanks Brad for your answer.

Seems a bit complicated to do something such simple and which helps a lot debugging embedded apps... For me it looks like a downgrade from previous systems...

Serial ports are not often used now and doesn't allow remote 'control' of cRIO status.

 

And indeed, writing to file to get simple message is a bit 'down-n-dirty' as you said... If the cRIO is configured to write 'console' messages to a file, how are the files handled ? (max messges perf iles, max files per target, etc...)

 

There are no ways to push messages to a PUTTY console connected to a cRIO ?

 

Thanks.

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 7 of 18
(8,469 Views)

The primary issue is one of a multiple-user OS filling the role that, until this point, was handled by a single-user (and single-process) OS: it is designed to keep console sessions separated, and a putty login is nothing more than another console session (albeit over the network and secured). This is great and powerful, but, to lift a line from Stan Lee, with great power comes great responsibility (or complexity, in this case). The mechanisms needed to garner the results that you're looking for are much more complex than this solution.

0 Kudos
Message 8 of 18
(8,464 Views)

Also, I would state that the level of debugging what your application is doing is many, many times greater on the newer NI Linux RT targets than on our past targets, it is simply the case that the tools have changed.

 

Also, I just wanted to make sure that I have a clear picture of what your debugging process was in the past: you would use these "Output Debug String" primitives and use the MAX target console to check the results? I ask since there is a lot of confusing use of "console" and "monitor" in past posts. If this type of access to the target is desirable, you can always make a feature request to get the same/similar behavior.

0 Kudos
Message 9 of 18
(8,459 Views)

Hi BradM,

 

"Also, I just wanted to make sure that I have a clear picture of what your debugging process was in the past: you would use these "Output Debug String" primitives and use the MAX target console to check the results? I ask since there is a lot of confusing use of "console" and "monitor" in past posts. If this type of access to the target is desirable, you can always make a feature request to get the same/similar behavior."

 

=> I'm usually using the 'Output Debug String' as a log console to display the status of an execution, a particular state a my cRIO or error messages. As the messages are buffered and limited to max number it's pretty easy to use it and quite efficient in term of memory and disk use.

To see the console I use MAX or directly the webpage of the cRIO typing its IP address as URL.

It allows a quick diagnostic of what happen to an embedded app ruuning in a cRIO.

 

Imagine your system is deployed in a production environnement. How do you check your app state ?

Using the user LEDs ? => not enough details.

Using the RS port ? => I've got to find a (crossed ?) RS cable, find a RS to USB adaptor (which new computer is standardly equipped with an RS port ?), connect of all of that on a computer (my desktop computer is a bit heavy on my laps... ) and run a HyperTerminal (which isn't embbeded anymore in WinOS) like software ...

 

The Ethernet port is maybe the last interface which common to all computer platforms, which allows communicating quite easily through a network, on large distances....

So yes, I'll definitely have to make a request (somewhere?) to have a 'console' on a Linux based cRIO, because THIS is really usefull...

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 10 of 18
(8,439 Views)