Skip to content

Installing Machinekit

kinsamanka edited this page Aug 15, 2014 · 2 revisions

Using Pre-built Image:

  • Download the minimal raspbian image at http://0ptr.link/files/
  • Compare the md5sum of the downloaded file: http://0ptr.link/files/MD5SUMS
  • Install the image by following the instructions here
  • The first boot up will be a bit slow as the ssh keys are being generated
  • The default username is pi and the password is raspberry
  • Post install
    • Configure locale

      sudo dpkg-reconfigure locales
      
    • Configure timezone

      sudo dpkg-reconfigure tzdata
      

Installing from an Existing Raspbian image:

  • Login to the running RPi

  • Import GPG keys

    sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-key 49550439
    
  • Add RPi Machinekit repository

    sudo sh -c 'echo "deb http://0ptr.link/raspbian wheezy main' > \
     /etc/apt/sources.list.d/rpi-machinekit.list"
    
  • Update

    sudo apt-get update
    
  • Backup old kernel and install xenomai kernel

    sudo apt-get install linux-image-xenomai
    sudo mv /boot/kernel.img /boot/kernel.img.bck
    sudo cp /boot/vmlinuz* /boot/kernel.img
    
  • Install machinekit

    sudo apt-get install machinekit-xenomai
    
  • Modify user rights

    sudo usermod -a -G xenomai,kmem <username>
    
  • Configure udev rules

    sudo sh -c \
    'cat >/etc/udev/rules.d/xenomai.rules<<EOF
    # allow RW access to /dev/mem
    KERNEL=="mem", MODE="0660", GROUP="kmem" 
    # real-time heap device (Xenomai:rtheap)
    KERNEL=="rtheap", MODE="0660", GROUP="xenomai"
    # real-time pipe devices (Xenomai:rtpipe)
    KERNEL=="rtp[0-9]*", MODE="0660", GROUP="xenomai"
    EOF
    '
    
  • Reboot

    sudo reboot
    
  • Test if xenomai is working

    latency-test
    
NOTE: If cpufreq is running, make sure it is set to performance mode.