Permission problem when loading custome hal module

  • nauman
  • nauman's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
20 May 2024 11:09 - 20 May 2024 11:24 #300996 by nauman
Hi all
I am trying to load/install one custom module using 'sudo halcompiler --install cncmod'
it is installing and I can see module in '/lib/linuxcnc/modules/cncmod.so'
But the problem is when I load this module in my config it is giving me permission problem but same module is working fine in debain linuxcnc official distribution.

Environment
Host OS: Fedora iot 38

Error:

Debug file information:
bcm2835_spi_begin failed. Are you running with root privlages??
cncmod: rtapi_app_main: Operation not permitted (-1)
./CNC-MOD.hal:10: waitpid failed /usr/bin/rtapi_app cncmod
./CNC-MOD.hal:10: /usr/bin/rtapi_app exited without becoming ready
./CNC-MOD.hal:10: insmod for cncmod failed, returned -1
11193
11206
Stopping realtime threads
Unloading hal components
cncmod: not loaded
<commandline>:0: exit value: 255
<commandline>:0: rmmod failed, returned -1
Unexpected realtime delay on task 0 with period 25000
This Message will only display once per session.
Run the Latency Test and resolve before continuing.
<commandline>:0: unloadrt failed



And code where error is coming in my module is

if (!rt_bcm2835_init()) {
  rtapi_print_msg(RTAPI_MSG_ERR,"rt_bcm2835_init failed. Are you running with root privlages??\n");
  return -1;
}



How can I set the right permission in fedora same like linuxcnc debain
I also attach linuxcnc.report for more details.
Thank you
Attachments:
Last edit: 20 May 2024 11:24 by nauman.

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
20 May 2024 11:45 #300997 by tommylight
Create a normal user in Fedora and run LinuxCNC from that user, usually a "sudoer" account on most distros.
Most software with direct kernel access will not run as root in most distros, due to potential to wreck havoc if misused.

I am trying to load/install one custom module using 'sudo halcompiler --install cncmod'

the line should be sudo halcompile
notice the missing R .

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

  • nauman
  • nauman's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
20 May 2024 12:07 - 20 May 2024 12:13 #300999 by nauman
I have sudoer user 'cncmod' and I used 'sudo halcompile --install cncmod.c' still same problem.

more info

Install link

ls -l /dev/mem
  crw-rw-rw-. 1 root kmem 1, 1 Oct 26  2023 /dev/mem
ls -l /dev/gpiomem
  crw-rw-rw-. 1 root root 237, 0 Oct 26  2023 /dev/gpiomem
groups cncmod
  cncmod wheel
 
Last edit: 20 May 2024 12:13 by nauman.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum