3 Replies Latest reply on Mar 20, 2015 5:37 PM by CMata_Intel

    Enabling MRAA on Ubilinux on the Edison

    EmbeddedMark

      Hello All,

       

      I would like to take some of the Node JS code I wrote on my Raspberry Pi and port to the Edison.  Some of the code pulls and sets digital pin values from the GPIO connector on the RPI. 

       

      I purchased a Sparkfun Base, GPIO, and ADC block.

       

      Unfortunately, I seem to be having difficulties finding any good documentation that shows how to install all of these so that I can use Node JS libraries with the MRAA code.

       

      Any tips or links would be greatly appreciated.

       

      Thanks,

       

      Mark

        • 1. Re: Enabling MRAA on Ubilinux on the Edison
          ElijahParker

          Check out: https://learn.sparkfun.com/tutorials/installing-libmraa-on-ubilinux-for-edison

           

          Just don't include the cmake flag that disables node.

           

          Also, note that you'll want to use the raw pin references with mraa so they match up with the gpio board.

          • 2. Re: Enabling MRAA on Ubilinux on the Edison
            EmbeddedMark

            Thanks Elijah.

             

            While the above sparkfun article is useful for installing MRAA for python, it is not so helpful for Node JS.  To start, one needs to load swig 3.0+.  I did this with the following commands:

             

            These installs are needed to compile swig 3.0.5

            # apt-get install libpcre3 libpcre3-dev

            download latest swig from http://www.swig.org/download.html v3.0.5

            # ./configure

            # make

            # make install

             

            # git clone https://github.com/intel-iot-devkit/mraa.git

            # mkdir mraa/build && cd $_

            # cmake ..  -DCMAKE_INSTALL_PREFIX:PATH=/usr

            # make

            # make install

             

            The final step is to load the latest node  mraa library with # npm install mraa

             

            Unfortunately, this yields the following errors: 

             

            gyp ERR! build error

            gyp ERR! stack Error: `make` failed with exit code: 2

            gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)

            gyp ERR! stack     at ChildProcess.emit (events.js:98:17)

            gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)

            gyp ERR! System Linux 3.10.17-poky-edison-ww42+

            gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

            gyp ERR! cwd /usr/lib/node_modules/mraa

            gyp ERR! node -v v0.10.36

            gyp ERR! node-gyp -v v1.0.1

            gyp ERR! not ok

             

             

            npm ERR! mraa@0.5.4-138-g163a40e install: `node-gyp rebuild`

            npm ERR! Exit status 1

            npm ERR!

            npm ERR! Failed at the mraa@0.5.4-138-g163a40e install script.

            npm ERR! This is most likely a problem with the mraa package,

            npm ERR! not with npm itself.

            npm ERR! Tell the author that this fails on your system:

            npm ERR!     node-gyp rebuild

            npm ERR! You can get their info via:

            npm ERR!     npm owner ls mraa

            npm ERR! There is likely additional logging output above.

            npm ERR! System Linux 3.10.17-poky-edison-ww42+

            npm ERR! command "/usr/bin/node" "/usr/bin/npm" "-g" "install" "mraa"

            npm ERR! cwd /home/edison/js

            npm ERR! node -v v0.10.36

            npm ERR! npm -v 1.4.28

            npm ERR! code ELIFECYCLE

            npm ERR! not ok code 0

             

             

            Any idea of what I am doing wrong?

             

            ANY TIPS OR POINTERS are GREATLY appreciate.  Will summarize install instructions once I get this working.....

             

            Thanks,

             

            Mark

            • 3. Re: Enabling MRAA on Ubilinux on the Edison
              CMata_Intel

              Hi EmbeddedMark ;

               

              Do you have updates in this? If you still have issues with this I suggest you to contact EmutexLabs for more accurate information about Ubilinux.

               

              Regards;

              CMata