mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

LinuxCNC (Emc2) How to compile and get it working...........

Thu Aug 09, 2012 6:41 pm

I thought maybe I should start a new thread even though I have been posting to a few other threads on this topic, I felt as this should allow others to actually get a compiled version I should post with a more precise topic description.

I SHOULD MAKE CLEAR THIS IS NOT COMPLETE AND WILL TAKE MONTHS MORE WORK TO ACUALLY DRIVE SOME MOTORS!!!!

But anyone interested in compiling linuxcnc in simulator mode should start here and then work towards the other components required for a real time compilation..........


I should start by saying real time linuxcnc on RPI has 3 possible routes and as far as I can see the easier they are to implement the worse the possible real time performance....

List of realtime linuxcnc implementations in order of my guess about how simple they are to implement:
1) RT_PREEMPT linux kernel patches (supported in the next version of linuxcnc and the route that I am following
2) Xenomai. ipipe patches (not directly supported by linuxcnc but a ARM version has been compiled called miniemc2)
3) RTAI kernel (linuxcnc preferential real time support but only ever used on x86 systems)


I think there are quite a few problems to sort out in the RPI kernel tree before its worth hacking at real time support so I am not going to attempt it (In hope that someone that actually knows this stuff will do this work).

I have only really done some very simple work and made a simple script for others to compile the linuxcnc simulator system on RPI.

At present I am looking at creating some IO drivers for hal interfacing with RPI GPIO.

Really I have not done much but hope others will be encouraged to look at getting the real time version compiled.

Below are some links to other relevant forum posts:

http://www.raspberrypi.org/phpBB3/viewt ... =63&t=2376
http://www.raspberrypi.org/phpBB3/viewt ... =24&t=1847
http://www.raspberrypi.org/phpBB3/viewt ... =63&t=9490

I was going to attach the shell script but it seems this file is not allowed :(

You will have to copy paste the code below and run it as a shellscript
instructions....

Make sure you have a recent version of raspbian and a network connection to upgrade it, best not compile this while running X, make sure you have a swap partition of at least 500mb (sudo swapon /dev/sda1).

save script below as 'linuxcnc.sh'
at prompt type 'chmod a+x linuxcnc.sh'
type './linuxcnc.sh'
once the compile shows success startx
open a terminal and type 'cd linuxcnc/linuxcnc-buesch-rt ; . scripts/rip-environment ; scripts/linuxcnc'

You should have linuxcnc running on X in simulator mode.

Code: Select all

#!/bin/sh
echo "script to compile linuxcnc in sim mode for raspbian"
echo "this will take a very very very long time, please wait 5 hours then comeback"

sudo apt-get update
sudo apt-get -f -y --force-yes install adduser alsa-base alsa-utils apt apt-utils aptitude aptitude-common asciidoc aspell aspell-en autoconf automake autopoint autotools-dev base-files 
sudo apt-get -f -y --force-yes install base-passwd bash bash-completion binutils blt bsdmainutils bsdutils build-essential bwidget bzip2 ca-certificates cifs-utils console-setup console-setup-linux consolekit coreutils cpio cpp cpp-4.6 cron cryptsetup-bin curl dash dblatex dbus dbus-x11 dconf-gsettings-backend dconf-service debconf debconf-i18n debconf-utils debhelper debian-reference-common debian-reference-en debianutils desktop-base desktop-file-utils dictionaries-common diffutils dillo dmsetup docbook docbook-dsssl docbook-utils docbook-xml docbook-xsl dosfstools dphys-swapfile dpkg dpkg-dev dvipng e2fslibs e2fsprogs ed eject esound-common fake-hwclock fakeroot fbset ffmpeg file findutils firmware-atheros firmware-brcm80211 firmware-libertas firmware-ralink firmware-realtek fontconfig fontconfig-config fonts-droid fonts-freefont-ttf freeglut3 freeglut3-dev fuse g++ g++-4.6 gcc gcc-4.4-base gcc-4.5-base gcc-4.6 gcc-4.6-base gcc-4.7-base gccxml gconf-service gconf2 gconf2-common gdb gdbserver gegl 
sudo apt-get -f -y --force-yes install gettext gettext-base ghostscript gir1.2-atk-1.0 gir1.2-freedesktop gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gst-plugins-base-0.10 gir1.2-gstreamer-0.10 gir1.2-pango-1.0 git git-man gksu glib-networking glib-networking-common glib-networking-services gnome-icon-theme gnome-themes-standard gnupg gpgv gpicview grep groff groff-base gsettings-desktop-schemas gsfonts gtk2-engines gzip hardlink hdparm hicolor-icon-theme hostname html2text i2c-tools idle idle-python2.7 idle-python3.2 idle3 ifplugd ifupdown imagemagick imagemagick-common info initscripts insserv install-info intltool-debian iproute iptables iputils-ping isc-dhcp-client isc-dhcp-common iso-codes jadetex kbd keyboard-configuration kmod krb5-locales latex-beamer latex-xcolor leafpad less libaa1 libaacs0 libacl1 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libamd2.2.0 libapt-inst1.5 libapt-pkg-dev libapt-pkg4.12 libart-2.0-2 libart-2.0-dev libasound2 libaspell15 
sudo apt-get -f -y --force-yes install libasprintf0c2 libasyncns0 libatasmart4 libatk1.0-0 libatk1.0-data libatk1.0-dev libattr1 libaudiofile1 libaudit0 libav-tools libavahi-client3 libavahi-common-data libavahi-common3 libavcodec53 libavdevice53 libavfilter2 libavformat53 libavutil51 libbabl-0.1-0 libblas3 libblas3gf libblkid1 libbluray1 libboost-iostreams1.46.1 libboost-iostreams1.48.0 libboost-iostreams1.49.0 libboost-iostreams1.50.0 libboost-python-dev libboost-python1.49-dev libboost-python1.49.0 libboost-regex1.49.0 libboost1.49-dev libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc6 libc6-dev libcaca0 libcairo-gobject2 libcairo-script-interpreter2 libcairo2 libcairo2-dev libcap2 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcdparanoia0 libck-connector0 libclass-isa-perl libcolord1 libcomerr2 libcroco3 libcryptsetup4 libcups2 libcupsimage2 libcurl3 libcurl3-gnutls libcwidget3 libdaemon0 libdatrie1 libdb5.1 libdbus-1-3 libdbus-1-dev libdbus-glib-1-2 libdc1394-22 libdca0 libdconf0 
sudo apt-get -f -y --force-yes install libdevmapper-event1.02.1 libdevmapper1.02.1 libdirac-encoder0 libdirectfb-1.2-9 libdjvulibre-text libdjvulibre21 libdpkg-perl libdrm-nouveau1a libdrm-radeon1 libdrm2 libdvdnav4 libdvdread4 libedit2 libegl1-mesa libegl1-mesa-drivers libelf1 libenca0 libenchant1c2a libept-dev libept1.4.12 liberror-perl libesd0 libevent-2.0-5 libexiv2-12 libexpat1 libexpat1-dev libfaad2 libffi-dev libffi5 libfftw3-3 libfile-fcntllock-perl libflac8 libfltk1.3 libfm-data libfm-gtk-bin libfm-gtk1 libfm1 libfontconfig1 libfontconfig1-dev libfontenc1 libfreetype6 libfreetype6-dev libfribidi0 libfuse2 libgail-3-0 
sudo apt-get -f -y --force-yes install libgail-common libgail-dev libgail18 libgbm1 libgcc1 libgconf-2-4 libgconf2-4 libgcrypt11 libgd2-noxpm libgdbm3 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgdk-pixbuf2.0-dev libgegl-0.2-0 libgeoclue0 libgettextpo0 libgfortran3 libgif4 libgirepository-1.0-1 libgksu2-0 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglade2-0 libglapi-mesa libglib2.0-0 libglib2.0-bin 
sudo apt-get -f -y --force-yes install libglib2.0-data libglib2.0-dev libglu1-mesa libglu1-mesa-dev libgmp10 libgnome-keyring-common libgnome-keyring0 libgnomecanvas2-0 libgnomecanvas2-common libgnomecanvas2-dev libgnomecups1.0-1 libgnomeprint2.2-0 libgnomeprint2.2-data libgnomeprint2.2-dev libgnomeprintui2.2-0 libgnomeprintui2.2-common libgnomeprintui2.2-dev libgnutls26 libgomp1 libgpg-error0 libgpm2 libgraphite3 libgs9 libgs9-common libgsm1 libgssapi-krb5-2 libgssglue1 libgstreamer-plugins-base0.10-0 libgstreamer-plugins-base0.10-dev libgstreamer0.10-0 libgstreamer0.10-dev libgtk-3-0 libgtk-3-bin libgtk-3-common libgtk2.0-0 libgtk2.0-common libgtk2.0-dev libgtop2-7 libgtop2-common libgudev-1.0-0 libhunspell-1.3-0 libice-dev libice6 libicu-dev libicu48 libid3tag0 libident libidn11 libijs-0.35 libilmbase6 libimlib2 libiw30 libjack-jackd2-0 libjasper1 libjavascriptcoregtk-1.0-0 libjavascriptcoregtk-3.0-0 libjbig0 libjbig2dec0 libjpeg8 libjson0 libk5crypto3 libkeyutils1 libkmod2 libkpathsea6 
sudo apt-get -f -y --force-yes install libkrb5-3 libkrb5support0 liblapack3 liblapack3gf liblcms1 liblcms2-2 libldap-2.4-2 liblensfun-data liblensfun0 liblightdm-gobject-1-0 liblircclient0 liblocale-gettext-perl liblqr-1-0 libltdl7 liblvm2app2.2 liblzma5 liblzo2-2 libmad0 libmagic1 libmagickcore5 libmagickcore5-extra libmagickwand5 libmail-sendmail-perl libmenu-cache1 libmikmod2 libmount1 libmp3lame0 libmpc2 libmpeg2-4 libmpfr4 libmtdev1 libncurses5 libncurses5-dev libncursesw5 libnetpbm10 libnewt0.52 libnfnetlink0 libnfsidmap2 libnl-3-200 libnl-genl-3-200 libnotify4 libnspr4 libnss3 libobrender27 libobt0 libogg0 libopenal-data libopenal1 libopenexr6 libopenjpeg2 libopenraw1 libopenvg1-mesa libopts25 liborc-0.4-0 libosp5 libostyle1c2 libp11-kit0 libpam-ck-connector libpam-modules libpam-modules-bin libpam-runtime libpam0g libpango1.0-0 libpango1.0-dev libpaper-utils libpaper1 libparted0debian1 libpci3 libpciaccess0 libpcre3 libpcre3-dev libpcrecpp0 libpcsclite1 libpipeline1 libpixman-1-0 
sudo apt-get -f -y --force-yes install libpixman-1-dev libpng12-0 libpng12-dev libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libpoppler19 libpopt0 libportmidi0 libpostproc52 libprocps0 libproxy0 libptexenc1 libpth-dev libpth20 libpthread-stubs0 libpthread-stubs0-dev libpulse0 libpython2.7 libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 libraw1394-11 libreadline-dev libreadline6 libreadline6-dev librsvg2-2 librsvg2-common librtmp0 libruby1.9.1 libsamplerate0 libsasl2-2 libsasl2-modules libschroedinger-1.0-0 libsdl-image1.2 libsdl-mixer1.2 libsdl-ttf2.0-0 libsdl1.2debian 
sudo apt-get -f -y --force-yes install libselinux1 libsemanage-common libsemanage1 libsepol1 libsgmls-perl libsgutils2-2 libsigc++-1.2-5c2 libsigc++-2.0-0c2a libslang2 libsm-dev libsm6 libsmbclient libsmpeg0 libsndfile1 libsoup2.4-1 libsource-highlight-common libsource-highlight4 libsp1c2 libspeex1 libspiro0 libsqlite3-0 libsqlite3-dev libss2 libssh2-1 libssl-dev libssl1.0.0 libstartup-notification0 libstdc++6 libstdc++6-4.6-dev libswitch-perl libswscale2 libsys-hostname-long-perl libsysfs2 libsystemd-login0 libtagcoll2-dev libtalloc2 libtasn1-3 libtdb1 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libthai-data libthai0 libtheora0 libtiff4 libtimedate-perl libtinfo-dev libtinfo5 libtirpc1 libtogl-dev libtogl1 libts-0.0-0 libudev-dev libudev0 libumfpack5.4.0 libunique-1.0-0 libunistring0 libusb-0.1-4 libusb-1.0-0 libustr-1.0-1 libuuid1 libva-egl1 libva-x11-1 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libvte-common libvte9 libwayland-dev libwayland0 libwbclient0 
sudo apt-get -f -y --force-yes install libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libwebkitgtk-3.0-0 libwebkitgtk-3.0-common libwebp2 libwibble-dev libwmf0.2-7 libwnck-common libwnck22 libwrap0 libx11-6 libx11-data libx11-dev libx11-doc libx11-xcb1 libx264-123 libxapian-dev libxapian22 libxau-dev libxau6 libxaw7 libxaw7-dev libxcb-dri2-0 libxcb-glx0 libxcb-render0 libxcb-render0-dev libxcb-shape0 libxcb-shm0 libxcb-shm0-dev libxcb-util0 libxcb-xfixes0 libxcb1 libxcb1-dev libxcomposite-dev libxcomposite1 libxcursor-dev libxcursor1 libxdamage-dev libxdamage1 libxdmcp-dev libxdmcp6 libxext-dev libxext6 libxfixes-dev libxfixes3 libxfont1 libxft-dev libxft2 libxi-dev libxi6 libxinerama-dev libxinerama1 libxkbfile1 libxklavier16 libxml2 libxml2-dev libxml2-utils libxmu-dev libxmu-headers libxmu6 libxmuu1 libxpm-dev libxpm4 libxrandr-dev libxrandr2 libxrender-dev libxrender1 libxres1 libxslt1-dev libxslt1.1 libxss-dev libxss1 libxt-dev libxt6 libxtst6 libxv1 libxvidcore4 libxvmc1 libxxf86dga1 libxxf86vm1 
sudo apt-get -f -y --force-yes install libyaml-0-2 lightdm lightdm-gtk-greeter linux-libc-dev linux-sound-base lmodern locales login logrotate lsb-base lsb-release lua5.1 luatex lxappearance lxde lxde-common lxde-core lxde-icon-theme lxinput lxmenu-data lxpanel lxpolkit lxrandr lxsession lxsession-edit lxshortcut lxtask lxterminal lynx lynx-cur m4 make man-db manpages mawk menu-xdg mesa-common-dev midori mime-support module-init-tools mount mplayer mtools multiarch-support mupdf nano ncdu ncurses-base ncurses-bin net-tools netbase netcat-openbsd netcat-traditional netpbm netsurf-common netsurf-gtk 
sudo apt-get -f -y --force-yes install nfs-common ntfs-3g ntp obconf omxplayer openbox openjade openssh-blacklist openssh-blacklist-extra openssh-client openssh-server openssl parted passwd patch pciutils pcmanfm perl perl-base perl-modules pgf pkg-config po-debconf policykit-1 poppler-data powermgmt-base preview-latex-style procps prosper ps2eps psmisc psutils python python-apt python-apt-common python-cairo python-dev python-glade2 python-gobject-2 python-gobject-2-dev python-gtk2 python-gtk2-dev python-gtk2-doc python-imaging python-lxml python-minimal python-numpy python-pygame python-support python-tk python2.6 python2.6-minimal python2.7 python2.7-dev python2.7-minimal python3 python3-minimal python3-numpy python3-tk python3.2 python3.2-minimal raspberrypi-artwork raspberrypi-bootloader raspbian-archive-keyring raspi-config raspi-copies-and-fills readline-common rpcbind rsync rsyslog ruby ruby1.9.1 samba-common scratch sed sensible-utils sgml-base sgml-data sgmlspl shared-mime-info source-highlight 
sudo apt-get -f -y --force-yes install sp squeak-plugins-scratch squeak-vm ssh strace sudo sysv-rc sysvinit sysvinit-utils tar tasksel tasksel-data tcl tcl-dev tcl8.4 tcl8.4-dev tcl8.5 tcl8.5-dev tcpd tex-common tex-gyre texlive texlive-base texlive-bibtex-extra texlive-binaries texlive-common texlive-doc-base texlive-extra-utils texlive-font-utils texlive-fonts-recommended texlive-fonts-recommended-doc texlive-generic-recommended texlive-latex-base texlive-latex-base-doc texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended texlive-latex-recommended-doc texlive-luatex texlive-math-extra texlive-pictures texlive-pictures-doc texlive-pstricks texlive-pstricks-doc tipa tk tk-dev tk8.4 tk8.4-dev tk8.5 tk8.5-dev togl-demos traceroute tsconf ttf-dejavu-core ttf-freefont ttf-marvosym tzdata ucf udev udisks ufraw-batch unzip usbutils util-linux vim-common vim-tiny wget whiptail wireless-tools wpasupplicant x11-common x11-utils x11-xkb-utils x11proto-composite-dev x11proto-core-dev 
sudo apt-get -f -y --force-yes install x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-scrnsaver-dev x11proto-xext-dev x11proto-xinerama-dev xarchiver xauth xdg-utils xfonts-encodings xfonts-utils xinit xkb-data xml-core xmlto xorg-sgml-doctools xserver-common xserver-xorg xserver-xorg-core xserver-xorg-input-all xserver-xorg-input-evdev xserver-xorg-input-synaptics xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-mach64 xserver-xorg-video-r128 xserver-xorg-video-radeon xsltproc xtrans-dev xz-utils zenity zenity-common zip zlib1g zlib1g-dev 
#sudo apt-get install debhelper libpth-dev dvipng tcl8.5-dev tk8.5-dev bwidget libxaw7-dev libncurses-dev libreadline-dev asciidoc source-highlight dblatex xsltproc groff python-dev python-lxml libglu1-mesa-dev libgl1-mesa-dev libgl1-mesa-swx11-dev libgtk2.0-dev libgnomeprintui2.2-dev gettext autoconf libboost-python-dev
if [ -d linuxcnc ]; then
echo "you seem to already have a linuxcnc directory and we dont want to overwrite it!"
else
mkdir linuxcnc
cd linuxcnc
#git clone 
git clone git://gitorious.org/emc-rt-preempt/emc-rt-preempt.git linuxcnc-buesch-rt
cd linuxcnc-buesch-rt

git checkout linuxcnc-buesch-rt-patches-forward-port

#cd linuxcnc-buesch-rt

echo "#define typecheck(a,b) 
#define raw_local_irq_save(a)
#define trace_hardirqs_off()
#define raw_irqs_disabled_flags(flags)
#define trace_hardirqs_on()

#define local_irq_save(flags)                           \
        do {                                            \
                typecheck(unsigned long, flags);        \
                raw_local_irq_save(flags);              \
                trace_hardirqs_off();                   \
        } while (0)

#define local_irq_restore(flags)                        \
        do {                                            \
                typecheck(unsigned long, flags);        \
                if (raw_irqs_disabled_flags(flags)) {   \
                        raw_local_irq_restore(flags);   \
                        trace_hardirqs_off();           \
                } else {                                \
                        trace_hardirqs_on();            \
                        raw_local_irq_restore(flags);   \
                }                                       \
        } while (0)


#  define _atomic_spin_lock_irqsave(l,f) do { local_irq_save(f); } while (0)
#  define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0)
 
static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
{return(0);}
static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
{return(0);}" > src/rtapi/arm_bitops.h

mv src/rtapi/rtapi_bitops.h src/rtapi/rtapi_bitops.h.old
cat src/rtapi/rtapi_bitops.h.old | sed -e '/The header/,+5d' | sed '$d' > src/rtapi/rtapi_bitops.h


echo -n '#elif defined(__arm__)
#include "arm_bitops.h"
#else
#error The header file <asm/bitops.h> is not usable and rtapi does not yet have support for your CPU
#endif
#endif' >> src/rtapi/rtapi_bitops.h
sudo apt-get remove Tcl8.4
./debian/configure sim
dpkg-checkbuilddeps 
cd src
#sudo apt-get remove Tcl Tcl8.4
./autogen.sh 
./configure --enable-simulator
make

fi

Serac
Posts: 124
Joined: Wed Jul 18, 2012 2:49 pm

Re: LinuxCNC (Emc2) How to compile and get it working.......

Mon Aug 13, 2012 12:49 pm

mung wrote:I SHOULD MAKE CLEAR THIS IS NOT COMPLETE AND WILL TAKE MONTHS MORE WORK TO ACUALLY DRIVE SOME MOTORS!!!!

I have only really done some very simple work and made a simple script for others to compile the linuxcnc simulator system on RPI.

You will have to copy paste the code below and run it as a shellscript
instructions....
BIG FAT WARNING The script will download and install a whole bunch of stuff that most will have no need of or want on a basic Raspberry Pi. This script will download some 1.2G* of packages and then consume another 2.5G* before doing anything else. To install tcl8.4 and then remove it at a later stage is silly. Installing firmware blobs for devices most will not have is daft as is installing stuff like libjack and mplayer.

If you are going to set your self up as an expert, the least you can do is provide a minimal list of packages that are required to build an application without including superfluous cruft.

Anyone wanting a simulation tool would be better off looking at openscam, and if they want to use a Pi for CNC, try rt-stepper. If people are really desperate to run emc2/linuxcnc, they can download the live CD and run it on any x86 box. Oh, and try asking for the source CD to accompany the LiveCD..

BIG FAT WARNING No.2 emc2/linuxcnc will inflict raft of security holes on you that could compromise your system (did I mention the pollution of the home directory with a bunch of worthless debug files)..

* Estimated based on apt-get reporting of disk usage.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Mon Aug 13, 2012 8:37 pm

Serac Wrote
BIG FAT WARNING The script will download and install a whole bunch of stuff that most will have no need of or want on a basic Raspberry Pi. This script will download some 1.2G* of packages and then consume another 2.5G* before doing anything else. To install tcl8.4 and then remove it at a later stage is silly. Installing firmware blobs for devices most will not have is daft as is installing stuff like libjack and mplayer.

If you are going to set your self up as an expert, the least you can do is provide a minimal list of packages that are required to build an application without including superfluous cruft.

Anyone wanting a simulation tool would be better off looking at openscam, and if they want to use a Pi for CNC, try rt-stepper. If people are really desperate to run emc2/linuxcnc, they can download the live CD and run it on any x86 box. Oh, and try asking for the source CD to accompany the LiveCD..

BIG FAT WARNING No.2 emc2/linuxcnc will inflict raft of security holes on you that could compromise your system (did I mention the pollution of the home directory with a bunch of worthless debug files)..

* Estimated based on apt-get reporting of disk usage.
I could spend a while trying to address all your points, but I cannot really be bothered.

Instead I with try another tangent and ask you some questions Serac....

1) Do you live under a bridge?
2) have you ever been a member of the German national socialist party?
3) Have you actually tried to run the script?


additional notes:
1) I am not an expert.
2) I have always felt Linux is about education.
3) You need to put in a little work to ever get something worthwhile.
4) There are always some simple clues to solve most problems, but monitoring all data sources is almost never possible.
5) If you want people to do something else try asking........

Serac
Posts: 124
Joined: Wed Jul 18, 2012 2:49 pm

Re: LinuxCNC (Emc2) How to compile and get it working.......

Tue Aug 14, 2012 2:49 pm

mung - Your first two so called "questions" are atypical of the sort of response expected from the emc2/linuxcnc developers/fanbois. May I introduce you to my kill-file and cluebat

As to "had I tried to run the script" - Not in it's posted form. First off, the use of the --force-yes flag for apt-get is poorly considered and should only be used when upgrading a system critical library (e.g. libc6) and is not a catch all for beginners. Second, your "package list" includes a number of core packages already installed on a default base rasbian system and then tops it off with a bunch of cruft that few will need - In total, 312 new packages, downloading 846MB of archives and consuming 1501MB of disk space.

Code: Select all

sudo apt-get --no-install-recommends install \
        gettext autoconf libpth-dev gcc g++ make git \
        libncurses5-dev libreadline-dev tcl8.5-dev tk8.5-dev bwidget blt \
        libxaw7-dev libglu1-mesa-dev libgl1-mesa-dev libgtk2.0-dev \
        libgnomeprintui2.2-dev python python-dev python-support python-tk \
        python-lxml libboost-python-dev yapps2-runtime \
        libtk-img python-imaging  python-imaging-tk python-xlib \
        python-gtkglext1 python-configobj python-gnome2 python-glade2 python-numpy
This will install the essential stuff (based on build-depends in that sic debian directory) along with git so that you can clone any number of git repositories - 142 packages, 87.7MB download, 282.2MB disk) - A significant saving of time and space. If you want to build the sic documents, that costs extra.

Take time out to read the apt-get man page, and you might find that it is not necessary to list every package and that you can let apt-get pull in dependencies automatically. In future, if you go giving out bad/poor "advice", you can expect another public slapdown.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Tue Aug 14, 2012 9:29 pm

Serac wrote:mung - Your first two so called "questions" are atypical of the sort of response expected from the emc2/linuxcnc developers/fanbois. May I introduce you to my kill-file and cluebat

Take time out to read the apt-get man page, and you might find that it is not necessary to list every package and that you can let apt-get pull in dependencies automatically. In future, if you go giving out bad/poor "advice", you can expect another public slapdown.

Thank you for the generous introduction to kill-file and cluebat, I have always wanted to meet them and it is nice to feel I have some new friends now.

With regards to you comments, I would like to thank you for your educational and interesting feedback. I am pleased that you have helped simplify my task by doing my work for me. I should say that I know nothing about apt-get but I simply did a 'dpkg -l >> scriptfile.sh', then edited the file and added the commands I used to compile from my bash histary file, I was too lazy to do much more, sorry.

I know that what is right is often forgotten for what is convenient, but unfortunately efficiency is not always intelligent laziness, some times laziness is unintelligent inefficiency.

Also you would probably find that the script does not compile linuxcnc as unfortunatly I did not add a line to 'apt-get remove tcl'.

:oops:

Anyways I can see you are an uber elite haxor and I could never get to your level, but I do what I find interesting and try to let people learn from my mistakes, I do not feel you can or should expect any more unless you are paying for my time, or helping in some other way.

I generally do not specialise and just mess around and hack things that interest me, I have not used linux much for the past 5 or 6 years, so most of what I know is out of date. If you feel I should stop posting to this forum due to my sometimes incorrect statements then please send a formal request to my lawyers.

P.S. how are things going with your xenomai work, have you got hold of the board support package yet?

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Sun Aug 19, 2012 9:24 pm

I thought I would just show what seems to be the best performance I can get out of the RPI using linuxcnc to run a bog standard stepper driver board without a real time kernel.

The youtube video looks very bad due to poor lighting sorry, but I am not going to film it again until I get a realtime version working (which could be a very very long time).

http://www.youtube.com/watch?v=Kwega6qbDes&

dan0
Posts: 5
Joined: Wed Oct 10, 2012 7:14 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Wed Oct 17, 2012 8:33 am

i'll be following this, this is exactly what i want to do with my pi. unfortunately i likely won't get mine till december. i have a south bend lathe and an induma vertical mill and would like to convert them both. i could get a cheap x86 box with a pci ltp card and a cheap stepper driver from china but it would be nice to see a solution with just a rpi and a couple l298 chips connected to gpio. if it turns out to be a viable solution that is...

zultron
Posts: 5
Joined: Sat Nov 03, 2012 5:06 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Fri Nov 09, 2012 3:14 am

Hi Serac,
Serac wrote:If people are really desperate to run emc2/linuxcnc, they can download the live CD and run it on any x86 box. Oh, and try asking for the source CD to accompany the LiveCD..
I'm curious what this means. I don't think you literally mean a CD image with deb package sources, but that there are some packages on the LiveCD that are not truly open source?

John

ar0n
Posts: 20
Joined: Thu Jun 07, 2012 9:33 pm

Re: LinuxCNC (Emc2) How to compile and get it working.......

Fri Nov 09, 2012 12:52 pm

Actually this guy posted an RT driver here:
http://linuxcnc.org/index.php/forum/18- ... lish#23984

I have started to work with it / on it so it can be used on an spi bus. This could work without an extender, but I need those gpio pis for other tasks :).

zultron
Posts: 5
Joined: Sat Nov 03, 2012 5:06 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Thu Dec 13, 2012 5:19 am

ar0n wrote:Actually this guy posted an RT driver here:
http://linuxcnc.org/index.php/forum/18- ... lish#23984

I have started to work with it / on it so it can be used on an spi bus. This could work without an extender, but I need those gpio pis for other tasks :).
Yeah, the poster in your link, 'mungkie', is the same poster above, 'mung'.

Let's hear more about your work!

Since the OP, I've been cleaning up and merging the code for the old (RTAI) and new (RT_PREEMPT, Xenomai) RT systems that have been added to LinuxCNC as part of a greater push to make LCNC independent of RTAI, the live CD, and even the x86 platform. Another fellow has been working hard on getting LCNC running on the BeagleBone, and has succeeded in compiling it on the RPi (and yet another is writing code to allow the PCI HAL drivers to run in user space).

Mung/munkie did some of the important initial work to make the ARM port happen. Thanks mung! It's lucky he ignored the nay-sayers who tried so hard to discourage him.

Keep an eye on the emc-developers ML. There's already enough info there to start playing with this (look for Haberler's recent posts), and there are a few folks hard at work on the ARM stuff.

It looks like the RPi isn't the ideal platform for high performance stepping, but it should be able to run steppers at a slow rate. The BeagleBone is probably the way to go because of the onboard real-time processors, but it will be a while before those work well.

Finally, to answer my own question, the live CD sources are indeed out there, so don't believe the FUD:

http://linuxcnc.org/dists/lucid/

They won't run on newer Debians just yet, but we're working hard to fix that, and provide RH packages too.

John

dan0
Posts: 5
Joined: Wed Oct 10, 2012 7:14 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Thu Dec 13, 2012 4:02 pm

just to be clear, is it the intention to run the steppers directly off the gpio through an h-bridge or is this to get real time communication to an external stepper controller by using the gpio as a parallel port? what kind of external hardware will we need once this all works?

zultron
Posts: 5
Joined: Sat Nov 03, 2012 5:06 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Fri Dec 14, 2012 10:09 am

dan0 wrote:just to be clear, is it the intention to run the steppers directly off the gpio through an h-bridge or is this to get real time communication to an external stepper controller by using the gpio as a parallel port? what kind of external hardware will we need once this all works?
In fact, there's little intention to run LCNC on the RPi. There's not really enough CPU to get good realtime performance, which is what the project is shooting for. The main target is the BeagleBone, and the intention is to have the onboard PRUs wiggle either the gpio pins or talk to e.g. the BeBoPr cape.

The RPi is in the mix just because it's there, and of course the gpio pins are the lowest common denominator. I haven't heard of any plan to use the gpio as a parallel port to offload base thread processing to other hardware. That could work, but it would probably have to be championed by someone not yet within the project, since it looks like current bets are on the TI chip with the PRUs. Shouldn't be very hard to do.

If you're very interested, go check out the emc-developers mailing list archive.

John

dan0
Posts: 5
Joined: Wed Oct 10, 2012 7:14 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Fri Dec 14, 2012 9:57 pm

http://wiki.linuxcnc.org/cgi-bin/wiki.pl?TB6560

^ this is what i was thinking of communicating with if the pi can't use gpio for direct motor control.

i think the project should still be pursued. even if the performance is limited a wood router that doesn't need sub thousandth accuracy could be driven with belts instead of lead screws to get high inches per minute. and there are other uses that would have low feeds like a wire edm retrofit or 2d metal plate cutting like plasma or oxy/gas cutting. but using parallel communication (seems from reading the lcnc page parallel is recommended and very common on stepper boards like the one above) to a stepper controller would of load all the micro-stepping processing to the stepper controller.

if i had coding experience i'd get involved but i don't think i can contribute anything with my limited knowledge of programming and communication standards.

zultron
Posts: 5
Joined: Sat Nov 03, 2012 5:06 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Sat Dec 15, 2012 4:17 am

dan0 wrote:http://wiki.linuxcnc.org/cgi-bin/wiki.pl?TB6560

^ this is what i was thinking of communicating with if the pi can't use gpio for direct motor control.
I must have misunderstood your original question. That board is a motor driver, and won't help with the timing problems I referred to. I'd imagine it could be connected to the gpio pins easily enough, yes.
i think the project should still be pursued. even if the performance is limited a wood router that doesn't need sub thousandth accuracy could be driven with belts instead of lead screws to get high inches per minute. and there are other uses that would have low feeds like a wire edm retrofit or 2d metal plate cutting like plasma or oxy/gas cutting. but using parallel communication (seems from reading the lcnc page parallel is recommended and very common on stepper boards like the one above) to a stepper controller would of load all the micro-stepping processing to the stepper controller.
Well, there are a whole bunch of different subjects and problems mixed up in there. Most basically, if you don't care about high stepper rates, you should be ok with running steppers off the RPi's gpio pins. There's a thread on the ML with some initial timing results that might help with your calculations.

Like I said, the RPi looks pretty disappointing to those looking for high performance stepping, but for applications where >50uS jitter is acceptable, it might work just fine.

manolodearteixo
Posts: 2
Joined: Sun May 24, 2015 2:47 pm

Re: LinuxCNC (Emc2) How to compile and get it working.......

Sun May 24, 2015 7:50 pm

Someone is trying to port LinuxCNC and EMC2 to the RPi2?

M

zultron
Posts: 5
Joined: Sat Nov 03, 2012 5:06 am

Re: LinuxCNC (Emc2) How to compile and get it working.......

Sun May 24, 2015 10:04 pm

manolodearteixo wrote:Someone is trying to port LinuxCNC and EMC2 to the RPi2?
Been done. http://machinekit.io

Return to “Automation, sensing and robotics”