Intel Edison MRAA module not working

I recently downloaded the Intel XDK IOT version and used 13 Blink LED output. Then I loaded the program into Edison, but came up with a few errors; One of them was that he 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": { } } 
+7
intel-edison intel-xdk arduino iot
source share
5 answers

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

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

+3
source share

Depending on the version of your Edison firmware, the mraa modules for Node.js may not be installed correctly. To install the latest version of mraa, connect Edison to the Internet (via Wi-Fi) and run the following commands via ssh or serial terminal

 echo "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/mraa-upm.conf okpg update opkg upgrade 
+5
source share

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

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

0
source share

You can also take advantage of the latest version from npm (it will use the pre-generated SWIG shell from git master HEAD and create it on your board).

npm install mraa

here in more detail about how this works here - http://iotdk.intel.com/docs/master/mraa/npmpkg.html

0
source share

In the XDK IDE, there are drop-down menu settings located above the serial / end zone area on the right. If you drop out of this list, it has options for updating all libraries and the node daemon. This is an easier way to make sure that the MRAA and all other fingerprints on the whiteboard are updated and properly configured.

0
source share

All Articles