Logging in LINUXCNCRSH

More
21 Feb 2017 16:49 #88432 by Alex_k26
Alex_k26 created the topic: Logging in LINUXCNCRSH
Hi, everybody!
I'm using linuxcncrsh interface and I have an objective to save error messages in a some log-file.
Please, show me the way I can solve it?

I know that I can use linuxcncrsh and Axis interfaces together but it's not suitable in this case.

Thank you in advance!

Alex
More
21 Feb 2017 18:54 #88449 by dgarrett
dgarrett replied the topic: Logging in LINUXCNCRSH
If you want to use linuxcncrsh instead of a gui

1) in the inifile (example here: l.ini), use:
[DISPLAY]
DISPLAY=linuxcncrsh

2) start using the inifile and redirect stdout(1)
and stderr(2) to a log file (log)
$ linuxcnc l.ini >|log 2>&1 &

3) Connect (from a separate terminal if localhost).
To test, clear estop, turn machine on, issue mdi expecting
fail message in log since homing was not perfomed. Transcript:
$ telnet localhost 5007
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
hello EMC me 1
HELLO ACK EMCNETSVR 1.1
set enable EMCTOO
set enable EMCTOO
set echo off
set echo off
set verbose on
SET VERBOSE ACK
set estop off
SET ESTOP ACK
set machine on
SET MACHINE ACK
set mdi g0x0y0
SET MDI ACK
shutdown
Connection closed by foreign host.

4) Result (tested with master branch) shows the error message
for the MDI command
$ cat log
LINUXCNC - 2.8.0~pre1
Machine configuration directory is '/data/f/linuxcnc-dev/configs/sim/axis'
Machine configuration file is 'l.ini'
Starting LinuxCNC...
emc/iotask/ioControl.cc 768: can't load tool table.
Found file(LIB): /data/f/linuxcnc-dev/lib/hallib/basic_sim.tcl
setup_kins: cmd=loadrt trivkins coordinates=XYZ
Note: Using POSIX realtime
task: main loop took 0.025550 seconds
Can't issue MDI command when not homed
Connected to me
Shutting down
Shutting down and cleaning up LinuxCNC...
task: 45896 cycles, min=0.000017, max=0.025550, avg=0.001053, 1 latency excursions (> 10x expected cycle time of 0.001000s)
Note: Using POSIX realtime
Time to create page: 0.094 seconds
Powered by Kunena Forum