Difficulty building RTAI linuxcnc from source

More
28 Jul 2023 18:38 #276475 by southbayguy
Thank you for your response. It didn't change the result.

I have made a change to linuxcnc-dev/src/hal/drivers/hal_motenc.c.
When I do make, the changes are compiled into a kernel module, hal_motenc.ko.
How do I tell make to link in the new hal_motenc.ko file, so it is used when I run linuxcnc?

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

More
28 Jul 2023 22:03 #276490 by southbayguy
I'm concentrating on error output from hal_motenc.c. After linuxcnc fails, I run dmesg, and it shows me:

13224.908831] USERMODE CHECK: OK.
[13224.908832] USERMODE CHECK PROVIDED (ns): KernelLatency 581, UserLatency 694.
[13224.908833] FINAL CALIBRATION SUMMARY (ns): KernelLatency 581, UserLatency 694.
[13224.916982] RTAI[math]: loaded, using musl libm.
[13224.956497] MOTENC: ERROR, unknown card detected
[13227.661406] RTAI[math]: unloaded.
[13227.700054] SCHED releases registered named ALIEN PEDV$D
[13227.702510] RTAI[malloc]: unloaded.

Note the "unknown card detected" right there in the middle of the Snip.

Then I edit hal_motenc.c so it is:

rtapi_print_msg(RTAPI_MSG_INFO, "MOTENC: Card is %s, ID: %d\n", pDevice->pTypeName, pDevice->boardID);
if ( pDevice->boardType == 0 ) {
rtapi_print_msg(RTAPI_MSG_ERR, "MOTENC: ERROR, unknown card detected 0728\n");

... everything the same except I've appended the data ("0728") to the error message.

Then I do make, setuid and the environment thing, and I don't get the error message with the date! I get the old error message. My new code is either not getting linked or not getting run.

I'm missing something. Please give me a clue. Thanks.

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

More
30 Jul 2023 19:52 #276577 by southbayguy
Hi -
Thanks to the senior moderators for helping me on this topic.
In a terminal, changing directories so I was in linuxcnc-dev, if I typed

./scripts/rip-environment
linuxcnc

then I got the installed version of linuxcnc.
If I typed everything on one line, then I got the version of linuxcnc that I had just built in my linuxcnc-dev directory, including the error message I was using as a test. So this is what did it for me:

,/scripts/rip-environement linuxcnc

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

More
31 Jul 2023 00:16 #276589 by phillc54
You were missing ". " in front of the command.
. ./scripts/rip-environment
It is the equivalent of entering:
source ./scripts/rip-environment
From the linuxcnc-dev/src directory you could:
. ../scripts/rip-environment
linuxcnc.org/docs/devel/html/code/buildi...cnc.html#Quick-Start
 
The following user(s) said Thank You: tommylight

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

More
13 Aug 2023 23:44 #277890 by southbayguy
As far as I can tell, I am successfully building the LinuxCNC project. Make runs without error. From linuxcnc-dev/src I do sudo make setuid. Then I cd up one level and from linuccnc-dev I do ./scripts/rip-environment linuxcnc. The software runs, I choose the Motenc interface, the software sees the Vital Systems interface card (because I bought an old desktop with legacy PCI slots), and I get the GUI. I've connected a motor and encoder to the first axis on the interface card. When I twist the motor shaft, I see X axis position change on the GUI. All this is wonderful progress.
What concerns me is that for some reason linuxcnc is taking its configuration values not from the configs folder under linuxcnc-dev but instead from the configs folder under my compiled-by-LinuxCNC.org version.

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

More
14 Aug 2023 00:04 #277892 by rodw

What concerns me is that for some reason linuxcnc is taking its configuration values not from the configs folder under linuxcnc-dev but instead from the configs folder under my compiled-by-LinuxCNC.org version.

That is normal.

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

More
14 Aug 2023 02:14 #277901 by southbayguy
Thank you for writing back.
I want to re-state things to make sure I'm clear.
From LinuxCNC.org, I downloaded the ready-to-run linuxcnc. It is in its own folder, at /home/robert/linuxcnc. Under that folder, there are two more folders, called configs and nc_files.
Under configs, there is a folder called by_interface.vitalsystems.
Within that last directory, there is a file called motenc.ini.
So the complete path is /home/robert/linuxcnc/configs/by_interface.vitalsystems/motenc.ini.

I also wanted to be able to build from source. I made a directory called linuxcnc-dev and put it under home/robert. So linuxcnc and linuxcnc-dev are actually at the same level.
To drill down to motenc.ini within linuxcnc-dev, the path is a tiny bit different. It's /home/robert/linuxcnc-dev/configs/by_interface/vitalsystems/motenc.ini.
The reading I did about building from source and running from the run-in-place environment seemed to say that it was a self-contained system, independent of other software installed on the machine. I find it confusing -- in that context -- that when I'm running the home-built version of linuxcnc it doesn't stay within the linuxcnc-dev folder for its configuration values.

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

More
14 Aug 2023 11:07 #277946 by rodw
You might have several experimental RIP configs for the one configuration.
You may also still be using the .Deb versions while compiling some experimental feature and swapping to and from b closing windows and running  the script
Normally, you would open the linuxcnc-dev config from the chooser and it asks you if you want to copy the config into ~/linuxcnc/configs where it belongs
If you revisit the building Linuxcnc docs, you may like to explore building the Debs and installing with dpkg -i
I ran RIP for years before trying this and it is very convenient as it creates the CNC Menu. When configuring adding no-docs  to the command line will save a few hours by skipping building the Debs for the docs.

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

More
15 Aug 2023 02:55 #278021 by southbayguy
Thank you.
I still don't understand what I need to do to make my home-built version of linuxcnc go to

/home/robert/linuxcnc-dev/configs/by_interface/vitalsystems/motenc.ini.

for its configuration values.

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

More
15 Aug 2023 03:12 #278024 by rodw

Thank you.
I still don't understand what I need to do to make my home-built version of linuxcnc go to

/home/robert/linuxcnc-dev/configs/by_interface/vitalsystems/motenc.ini.

for its configuration values.


You don't! You make a copy in /home/robert/linuxcnc/configs by selecting these options.

 

Then it will appear under the chooser under My configurations.
Then you edit the configuration you have created in /home/robert/linuxcnc/configs

IF you look at the chooser, it says Sample Configurtations at the top of the Vital tree, They are not designed to be edited in situ.
Attachments:

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

Time to create page: 0.184 seconds
Powered by Kunena Forum