Intel Edison MRAA module not working
Asked Answered
C

5

7

I recently downloaded the Intel XDK IOT version and used the LED pin 13 Blink sample. I then uploaded the program onto the Edison, but it came up with a few errors; One of them being that it could not find the MRAA module. The sample code that came with it was: main.js:

var mraa = new require("mraa"); //require mraa
console.log('MRAA Version: ' + mraa.getVersion()); //write the mraa version to the Intel XDK console

var myOnboardLed = new mraa.Gpio(13); //LED hooked up to digital pin 13 (or built in pin on Galileo Gen1 & Gen2)
myOnboardLed.dir(mraa.DIR_OUT); //set the gpio direction to output
var ledState = true; //Boolean to hold the state of Led

periodicActivity(); //call the periodicActivity function

function periodicActivity()
{
  myOnboardLed.write(ledState?1:0); //if ledState is true then write a '1' (high) otherwise write a '0' (low)
  ledState = !ledState; //invert the ledState
  setTimeout(periodicActivity,1000); //call the indicated function after 1 second (1000 milliseconds)
}

package.JSON:

{
  "name": "Onboard LED Blink App",
  "description": "",
  "version": "0.0.0",
  "main": "main.js",
  "engines": {
    "node": ">=0.10.0"
  },
  "dependencies": {
  }
}
Cammack answered 2/10, 2014 at 3:57 Comment(0)
S
3

echo "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/mraa-upm.conf opkg update opkg install libmraa0

the above answer has typos it should be "mraa" not "maa" and opkg not okpg

Signac answered 10/10, 2014 at 3:26 Comment(0)
S
5

Depending on what version of the Edison firmware you have, the mraa modules for Node.js may not be installed properly. To install the latest version of mraa connect your Edison to the internet (via wifi) and run the following commands via ssh or the serial terminal

echo "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/mraa-upm.conf
okpg update
opkg upgrade
Sherborn answered 2/10, 2014 at 15:39 Comment(0)
S
3

echo "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/mraa-upm.conf opkg update opkg install libmraa0

the above answer has typos it should be "mraa" not "maa" and opkg not okpg

Signac answered 10/10, 2014 at 3:26 Comment(0)
E
0

echo "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/mraa-upm.conf opkg update opkg install libmraa0

SRC https://github.com/intel-iot-devkit/mraa

Elysian answered 14/11, 2014 at 18:46 Comment(2)
how is this any different from any above answer?Cammack
only dif. is this one calls install other than upgrade.Elysian
I
0

You can also grab the latest version from npm (it'll use a pre-generated SWIG wrapper from git master HEAD and build it on your board).

npm install mraa

here's more details on how this works here - http://iotdk.intel.com/docs/master/mraa/npmpkg.html

Illjudged answered 18/2, 2015 at 17:53 Comment(0)
S
0

In the XDK IDE, there's a dropdown settings control just above the serial / terminal area on the right. If you drop down this list, it has options to update all of the libraries and node daemon. This is an easier way to make sure MRAA and all the other deps on the board are up to date and configured properly.

Sorgo answered 21/10, 2016 at 6:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.