Installing LinuxCNC with uspace.... for dummies like me

More
03 Jun 2018 22:48 - 03 Jun 2018 22:54 #111568 by Sparky961
A while ago I asked a question about what I'd need to do to get 'uspace', something needed to run a Mesa 7i76e (ethernet) interface card. Though I received some helpful answers, I think I could have been guided down an easier path. This is the result of many hours trying to sort through things and if you follow in my steps I suspect you should have a less painful experience than I did.

I took notes of everything I did over the course of about 6+ hours partly so that I could do it again, and to share my experience with others looking to quickly and easily accomplish the same thing. Note that I'm doing this with VirtualBox, so anything related to that will not be relevant to installing on a physical computer.



1. Download the LinuxCNC 2.7 Wheezy distribution from linuxcnc's website and do whatever you need to do in order to boot from the image. There are lots of other sources that tell you how to do this so I'm skipping the details on this.

www.linuxcnc.org/linuxcnc-2.7-wheezy.iso

Select the graphical installer when it first start up and follow the prompts.



2. Update the list of packages for the package manager
	sudo apt-get update
--> Seemed to work - lots of scrolling terminal output, no obvious errors



3. Get any updates based on the updated list of packages
	sudo apt-get upgrade-dist
--> wow, that takes a long time and does a lot of scary stuff... but otherwise seemed to work



4. Check what kernel you have. You may have something different, and take note of the difference when typing commands related to getting different kernel modules.
	uname -r
--> 3.4.9-rtai-686-pae



5. Started linuxcnc with an axis sim configuration just to establish a working baseline
--> axis sim works (RTAPI ERROR: Unexpected realtime delay on task 1 - likely due to running in VirtualBox)



6. Started glade to establish a working baseline
--> version 3.8.0, preferences window has GtkBuilder (default) and Libglade, HAL Python and VCP Actions widget panels are displayed



7. NOTE: I've kept this in for completeness, but if I did it again I'd skip this step. I suspect nothing else will be different if you do, but can't guarantee it since I did.

Install VirtualBox Guest Additions with instructions at: www.linuxbabe.com/desktop-linux/how-to-i...-debian-step-by-step
	  sudo apt-get install build-essential module-assistant
	  sudo m-a prepare
	  [mount cd image]
	  sudo sh /media/cdrom/autorun.sh
--> Seemed to build kernal module ok.



8. Restart
--> VirtualBox Guest Additions isn't working properly, based on auto-resize guest window not working. Not a problem, but annoying.



9. NOTE: My first attempt with this step failed, but again I've left this in for completeness. Omitting this step shouldn't cause any problems.
	sudo apt-get install linuxcnc-uspace
--> "Package linuxcnc-uspace is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'linuxcnc-uspace' has no installation candidate' "



10. Install the preempt-rt kernel. This is where you might need to change the name based on what kernel you saw installed in step 4.
	sudo apt-get install linux-image-rt-686-pae
--> Appears to have completed without error



11. Restart
--> Need to select Linux 3.2.0-6-rt-686-pae from GRUB menu (need to change to default later)
--> Received message box in VirtualBox: "VboxClient: The VirtualBox kernel service is not running. Exiting." Fine, no worries.



12. Check again what kernel is running. It should now be the one just installed, with '-rt' somewhere in the name
	uname -r
--> 3.2.0-6-rt-686-pae



13. Install keys for .... well, I'm not going to pretend I understand why I'm doing this one. I'm just following instructions.
	sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-key 3cb9fd148f374fef
--> A bunch of terminal output, last three lines seeming important are:
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: new signatures: 2
.... so I think this succeeded



14. Remove the old kernel, and probably linuxcnc too. This was a fresh install for me but be careful with this if you're doing this on a system that has anything you don't want to lose - like your machine configuration. You really should have a backup anyway!

Start Applications > System > Synaptic Package Manager
- find linux-image-3.4-9-rtai-686-pae
- right click and select 'mark for complete removal'
- accept notification for removal of other packages: linuxcnc, linuxcnc-dev, rtai-modules-3.4-9-rtai-686-pae (because it states: "The following changes are required in order to proceed")
- did nothing for linux-image-686-pae because it does not show as 'installed'
- click 'apply changes' (and crossed my fingers)



15. Restart
--> only one kernel option is shown now, 3.2.0-6-rt-686-pae, and it is the default



16. Add the repository for the uspace version of linuxcnc
	sudo add-apt-repository "deb http://linuxcnc.org/ wheezy base 2.7-uspace"
--> No error or failure message. Assume success.
--> Replaces lines in /etc/apt/sources.list.d/linuxcnc.list



17. Update the list of packages for the new repository you just added
	sudo apt-get update
--> Got a bunch of stuff without error (and didn't take all day doing it)



18. Restart



19. Install the 'uspace' version of linuxcnc
	sudo apt-get install linuxcnc-uspace
--> looks like all is well, no error messages



20. Restart, because I'm used to Windows and it seemed the right thing to do.



21. Verify that you now have a 'uspace' version by checking if the hm2_eth driver is available. It isn't in the standard version, which is the whole reason I went through this in the first place!
	halrun
	loadrt hm2_<TAB>
--> Shows the possibilities for command completion, including the tell-tale hm2_eth that's only available with uspace



22. Repeat steps 5 and 6 to make sure both are still working



SUCCESS!

Last edit: 03 Jun 2018 22:54 by Sparky961.
The following user(s) said Thank You: tommylight

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

More
04 Jun 2018 09:33 - 04 Jun 2018 09:33 #111583 by InMyDarkestHour
Condensed version, without sudo apt-get dist-upgrade.
This should work as well. After your install
sudo add-apt-repository "deb http://linuxcnc.org/ wheezy base 2.7-uspace"
sudo apt-get update
sudo apt-get install linuxcnc-uspace linuxcnc-doc-en

Reboot with Linux 3.2.0-6-rt-686-pae
sudo apt-get remove linux-image-3.4-9-rtai-686-pae
sudo update-grub
Last edit: 04 Jun 2018 09:33 by InMyDarkestHour.

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

More
04 Jun 2018 20:57 - 04 Jun 2018 21:00 #111620 by andypugh

A while ago I asked a question about what I'd need to do to get 'uspace', something needed to run a Mesa 7i76e (ethernet) interface card. Though I received some helpful answers, I think I could have been guided down an easier path.
...
1. Download the LinuxCNC 2.7 Wheezy distribution from linuxcnc's website


Was this long enough ago that nobody pointed you at the Stretch/uspace image?

www.linuxcnc.org/testing-stretch-rtpreempt/

[Edit] I see now that you did download the Stretch image, and you got it working. So why the super-complicated instructions here?
Last edit: 04 Jun 2018 21:00 by andypugh.

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

More
04 Jun 2018 21:13 #111623 by InMyDarkestHour
Old mate seemed to have some troubles using glade with Stretch, I wrongly or rightly at the time, suggested that installing from the wheezy iso and then installing the preempt version might be an easier option. I honestly thought it would have been just a simple task with one reboot to use the new kernel and remove the old.......which it was when I attempted it.

forum.linuxcnc.org/41-guis/34646-ui-deve...vironment-setup-help

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

More
04 Jun 2018 22:18 #111629 by Sparky961

I see now that you did download the Stretch image, and you got it working. So why the super-complicated instructions here?


LinuxCNC worked fine with the 7i76e card I have, but when I tried to start using Glade for UI development I fell down the rabbit hole with versions, dependencies, and what not.

I shared my installation notes because there are often things that happen when following someone else's brief list of command line instructions that are unclear or incomplete. I'm sure you can appreciate (or at least acknowledge) that many of the people using LinuxCNC have no idea how to do anything in Linux. I'm definitely not an expert, probably less than intermediate even, but even knowing how to stumble my way around on a Linux box I get frustrated when things don't work like they're supposed to. For every one of you who know how to fix those "annoying little things", there are tens or hundreds that are immediately lost. That's when the frustrated people just start following random sets of instructions and trying things that may make it worse. Aside from the extra complication of the VirtualBox references, my instructions are just an expansion of those I was following from linuxcnc.org.

I don't know, maybe it isn't useful. That's fine too. But if it helps even one other person then it was worth my time to format it.

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

More
04 Jun 2018 22:28 #111631 by Sparky961

Old mate seemed to have some troubles using glade with Stretch, I wrongly or rightly at the time, suggested that installing from the wheezy iso and then installing the preempt version might be an easier option.


Actually, your suggestions were quite helpful indeed. I've had much more success on this path than with Stretch. The only place you inadvertently steered me wrong was where I didn't have the correct repository added. This was rectified by following the instructions I referenced.

Those same instructions include updating the kernel first and removing the old one, so that's what I did. If that isn't necessary then someone should revise the instructions.

I like the simplicity of yours, but what would really help is some commentary on what each command is doing and why. Not to mention what indicates failure or success. I usually look things up before executing them so I have an idea what I'm doing, but often have no idea what to do with auxiliary questions like "xxxx is no longer used, do you want to remove it?" or "xxxx is recommended, do you want to install it?" These are made up, of course, but not unrealistic. The wrong choice could mean the difference between something working or not.

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

More
04 Jun 2018 22:37 #111632 by Sparky961
The real question that needs asking behind all of this is: why isn't there a downloadable ISO with 'uspace', a preempt-rt kernel, and a version of Glade that's set up to work with LinuxCNC?

Clearly there is hardware that doesn't work without 'uspace', but are things that don't work _with_ it? What about the preempt-rt kernel? Why would you choose not to have it?

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

More
05 Jun 2018 00:19 #111636 by InMyDarkestHour
I could foresee lots of Mach3 converts of those new to cnc wanting to use the parallel port getting all bent out of shape, the rtai kernel also works with the PCI\PCIe mesa cards. So in general it covers a greater audience as far as I can make out.

RTAI has, usually, better latency which is needed for software step generation ie: you are wanting to use the parallel port. I think PREEMPT is only specifically required for the Mesa ethernet cards.

Although I have played with a couple of AMD motherboards and Radeon based Video cards that have had reasonable latencies with a PREEMPT kernel........but these were on a non debian based install of Linuxcnc.

apt-get will tell you when things haven't worked or have worked, like 99.99% of Linux commands.

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

More
05 Jun 2018 01:41 #111639 by Sparky961

I could foresee lots of Mach3 converts of those new to cnc wanting to use the parallel port getting all bent out of shape, the rtai kernel also works with the PCI\PCIe mesa cards. So in general it covers a greater audience as far as I can make out.


Is this to say that parallel ports are only supported by RTAI? You allude to this but don't actually say so. I agree that's desired by more users, but it's still more difficult than it needs to be for someone with a Mesa ethernet card. But I'm not going to win this argument and I know it. Linux has never been about making it easy for everyone.

RTAI has, usually, better latency which is needed for software step generation ie: you are wanting to use the parallel port. I think PREEMPT is only specifically required for the Mesa ethernet cards.


It wasn't my choice to use an ethernet-connected card. Someone else made a mistake in purchasing and now I'm using a 7i76e instead of a 7i76. Aside from the BS I'd had to go through to get it working, I really like the idea of using the existing ethernet port on a computer instead of requiring _two_ cards. It expands the possibilities for small computers that can't easily accept a PCI card. I suspect others will begin to see the advantages as well, if they aren't already way ahead of me.

Although I have played with a couple of AMD motherboards and Radeon based Video cards that have had reasonable latencies with a PREEMPT kernel........but these were on a non debian based install of Linuxcnc.


So, translation being that preempt-rt kernels have worse latency?

apt-get will tell you when things haven't worked or have worked, like 99.99% of Linux commands.


Output is cryptic and excessive. It is written by linux experts, for linux experts. But this is me against the entire linux community so I won't take that thread any farther.

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

More
05 Jun 2018 02:44 - 05 Jun 2018 02:46 #111641 by InMyDarkestHour
This is the output of attempting to install a non-existent package:
rmurphy@ThinkCentre-M90p ~ $ sudo apt-get install fuzzy-wuzzy-do-dah
[sudo] password for rmurphy: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package fuzzy-wuzzy-do-dah
rmurphy@ThinkCentre-M90p ~ $

It would fair to say the output is not excessive nor is it cryptic. It would also be fair to assume that if the utility can not locate the package it can not install it.

Again with multiple packages that do not exist:
rmurphy@ThinkCentre-M90p ~ $ sudo apt-get install fuzzy-wuzzy-do-dah doo-di-dumm lalalala hahaha
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package fuzzy-wuzzy-do-dah
E: Unable to locate package doo-di-dumm
E: Unable to locate package lalalala
E: Unable to locate package hahaha
rmurphy@ThinkCentre-M90p ~ $ 

Debian makes it quite simple to install packages, back in the old days with RPM (Redhat Linux) packages no dependencies were installed and you would spend a fair bit of time chasing those packages up. Slackware is still pretty much the same but the tools to search for the needed packages have improved.

Granted Windows makes it simpler to install software, but with that simpleness comes the chance of software being installed that you did not want to install.

Linux is making it easier, the progress it has made is enormous.

No software or Operating System is about making it easier for everyone ( as much as the marketing dept may say), it is about making it easier for the majority. They would be far more time spent if PREEMPT was the default option trying to get first time users going with parallel ports. I would hazzard a guess there are other reasons as well. Maybe the rtai development was ahead of, more mature, than the PREEMPT development. Or it was just a better option. Maybe if there were realtime network drivers uspace would not be needed ?

If you look at this page (last edit about 2014), yes I know some of the wiki pages are quite old:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Mesa_Cards

There is no mention of the ethernet cards, maybe they are a recent development and hence there was no need for PREEMPT, rtai worked fine for all cases. Now this is just an educated guess.
All in all we should be appreciative for all the hard work that goes into Linuxcnc. Developing is much more difficult task.
Last edit: 05 Jun 2018 02:46 by InMyDarkestHour.

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

Time to create page: 0.168 seconds
Powered by Kunena Forum