How to diagnose crashing LinuxCNC

More
08 Jul 2024 19:46 - 08 Jul 2024 19:51 #304690 by HerrNamenlos123
I just followed linuxcnc.org/docs/stable/html/getting-st...th_preempt_rt_kernel and installed Raspbian bookworm Lite on a Raspberry 3B, and installed the Preempt-RT Kernel, and then installed LinuxCNC using the install script.

I have no desktop environment and want to run only the LinuxCNC application using the X11 server, without any other bloat.

Now, after installing xorg, i can successfully run LinuxCNC using
sudo xinit linuxcnc $* -- :0 vt$XDG_VTNR


Now, the terminal of the rpi turns into a black window, that renders LinuxCNC fullscreen, without a desktop environment. (Screenshot in Attachments)

However, when I select any config (e.g. sim->axis->axis) and click ok, the window closes and the normal EMC2 splash screen appears for a few seconds, like it should, and then it just closes without any message and the X11 server stops.

Following is the command line output:
> sudo xinit linuxcnc $* -- :0 vt$XDG_VTNR


X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
Current Operating System: Linux cnc 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64
Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_hdmi=0  vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=6396eb0b-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=GB
xorg-server 2:21.1.7-3+rpt2+deb12u7 (https://www.debian.org/support)
Current version of pixman: 0.42.2
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Jul  8 21:42:58 2024
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.


And here is the same command with a script that just echos "hi":
sudo xinit ./test.sh $* -- :0 vt$XDG_VTNR


X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
Current Operating System: Linux cnc 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64
Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_hdmi=0  vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=6396eb0b-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=GB
xorg-server 2:21.1.7-3+rpt2+deb12u7 (www.debian.org/support)
Current version of pixman: 0.42.2
        Before reporting problems, check wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Jul  8 21:44:26 2024
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
hi
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.
[/code]

So, as you can see, command line output is printed directly and LinuxCNC does not produce any.

How can I diagnose this issue? If LinuxCNC stops without any command line output, can I find a log file somewhere? Or can I enable some debug features?

Thank you for any answers!
Attachments:
Last edit: 08 Jul 2024 19:51 by HerrNamenlos123. Reason: Fix code tags

Please Log in or Create an account to join the conversation.

More
08 Jul 2024 20:50 #304700 by HerrNamenlos123
Alright, I found the solution already.

Firstly:
I was able to get debug information out of LinuxCNC by having xinit instead loading a script, that calls LinuxCNC and redirects its output to a file.

Secondly:
It turned out LinuxCNC cannot run as root, however xinit must run as root, which means the script needed to use "sudo -u cnc linuxcnc" to run it as a normal user even though xinit runs it as root.

And thirdly:
There was also an issue where it did not load forever and apparently it was waiting for user input in the console, which was not visible.
In the end it turned out it's a lot easier to run "sudo xinit" in one terminal, to run the xorg server, and in another terminal run linuxcnc manually, thereby not having an issue with root and you can also do user input.

I cannot attach a Screenshot here but it works now and I have LinuxCNC running fullscreen on a Raspberry PI, without a desktop environment.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
08 Jul 2024 21:56 #304707 by tommylight
You can attach screenshots here as long as they are within size limit, but the editor is flaky so i click on "source", attach pictures then click on "insert all", and only after that is done i write the text.

Please Log in or Create an account to join the conversation.

Time to create page: 0.198 seconds
Powered by Kunena Forum