Comments: Installing libmraa on Ubilinux for Edison


Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • I am having trouble building mraa on ubilinux. My error occurs when I run this section of code: git clone mkdir mraa/build && cd $_ cmake .. -DBUILDSWIGNODE=OFF make make install cd

    The error I receive is: cmake .. -DBUILDSWIGNODE=OFF -- INFO - libmraa Version v1.1.1-5-g1af737f -- INFO - cmake Version 2.8.9 -- INFO - Target arch is i586 -- Could NOT find PythonInterp: Found unsuitable version "2.7.3", but required is at least "3" (found /usr/bin/python) -- Could NOT find PythonInterp: Found unsuitable version "2.7.3", but required is at least "3.2" (found /usr/bin/python) -- INFO - Adding onewire backend support -- INFO - Adding support for platform ALL -- INFO - Adding support for all platforms INFO - Adding x86 platforms PYTHON2 attempting to build! CMake Error at src/python/python2/CMakeLists.txt:10 (target_include_directories): Unknown CMake command "target_include_directories".

    -- Configuring incomplete, errors occurred!


    • I have run into the same issue trying to follow the tutorial.

      My cmake version is 2.8.9 as well, but the python 2 cmake file now includes a call to the 'target_include_directories' function which isn't implemented until cmake version 2.8.11 see this thread.

      I've tried to update my cmake with apt-get, but 2.8.9 is the latest version it will download. I'm about to try downloading an older version of mraa and if that fails then building cmake 2.8.11 from source.

      UPDATE: I was able to get mraa to build by using an older version of make. Inside the mraa folder run

      git checkout v1.0.0

      and then follow the rest of the tutorial as usual and it should build properly. This isn't a great solution, but it did allow me to build and use the library. Ideally someone smarter than myself will find a way to build the latest version of mraa.

  • I am trying to install mraa on Ubilinux.

    when I execute this command : export PYTHONPATH=$PYTHONPATH:$(dirname $(find /usr/local -name

    I get the following error: root@ubilinux:~# export PYTHONPATH=$PYTHONPATH:$(dirname $(find /usr/local -name dirname: extra operand /usr/local/lib/python2.7/site-packages/' Trydirname --help' for more information.

    Is there anyway to fix this ? Thanks

    • I had this problem too. I found out on the Intel forum somewhere that it depends on your version of mraa...

      Earlier version use:

      export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/site-packages/

      Later versions use:

      export PYTHONPATH=$PYTHONPATH:/usr/lib/i386-linux-gnu/python2.7/site-packages/

      For me running:

      find /usr/local -name 

      showed mraa in multiple locations, which is weird. I ended up setting my path explicitly and it works. Just remember that you need to use sudo and add the python path using "sudo visudo" as per the tutorial. You can then check by running "sudo python" and "import mraa".

      This link was also very helpful:

  • [edit] - found my own answer: MRAA to Edison pin mapping:

    I noticed that to GP44 on the sparkfun GPIO board corresponds to mraa.Gpio(31), while the OS knows it as /sys/class/gpio/gpio44. Is there documentation for this (and the other pins) somewhere?

  • Hello! My name is Reagan! I'm making a smartwatch with the Intel Edison and I'm trying to get the GPIO Block to work with an LED and I'm having some problems running the blink program. When I run I get this:

    root@ubilinux:~# python File "", line 1 import mraa import time ^ SyntaxError: invalid syntax root@ubilinux:~# root python bash: root: command not found root@ubilinux:~# apt-get install root Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package root root@ubilinux:~# sudo python File "", line 1 import mraa import time ^ SyntaxError: invalid syntax root@ubilinux:~#

    It's pretty weird since it happens in the exact same way to the C file...I did see quite a different screen when I ran nano ~/.bashrc I got this:

    GNU nano 2.2.6 File: /root/.bashrc

    ~/.bashrc: executed by bash(1) for non-login shells.

    Note: PS1 and umask are already set in /etc/profile. You should not

    need this unless you want different defaults for root.

    PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '

    umask 022

    You may uncomment the following lines if you want `ls' to be colorized:

    export LS_OPTIONS='--color=auto'

    eval "dircolors"

    alias ls='ls $LS_OPTIONS'

    alias ll='ls $LS_OPTIONS -l'

    alias l='ls $LS_OPTIONS -lA'


    Some more alias to avoid making mistakes:

    alias rm='rm -i'

    alias cp='cp -i'

    alias mv='mv -i'

    export PYTHONPATH=$PYTHONPATH:$(dirname $(find /usr/local -name (<- I put this in) [ Read 20 lines ] ^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos ^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text^T To Spell What is going on? Thank you!

  • Nice tuto thanks,

    But i my led doesn't blink (i have a arduino board and i would like to blink the LED 13) If i check your table ( the code in my led is "37" So, in my blink.c : i replace "#define LED_PIN 31" -> "LED_PIN 37"

    Very Thanks

  • When I kill the terminal, it seems to terminate my test application as well. Is there someway I can run my application even when the terminal on which I launch the application is closed? thanks.

    • you bet, simply add an ampersand after the command and it will fork and run in the background, and continue to run even if your shell exits. like this:

      user@host> python &

      further explanation here

If you've found a bug or have other constructive feedback for our tutorial authors, please send us your feedback!