Closed lenhuy closed 6 years ago
Use sudo -E node Test.js
, or modify your sudoers
file to keep NODE_PATH
.
MRAA version: v1.9.0 Test.js:3 var digitalPin = new m.Gpio(12); ^ Error: Illegal arguments for construction of _exports_Gpio
@lenhuy, you can find many tutorials/guides on configuring sudo
using your favorite search engine, as this is a standard Linux tool. It's strange that sudo -E
didn't work. Please post the contents of your system syslog/journal around the time you run this, mraa should be logging more details there.
Are you using the Ubuntu image provided by Emutex for the UP2, or just plain vanilla Ubuntu? The latter won't give you access to the GPIO pins as it doesn't have the required kernel driver.
I'm using the Ubuntu deskop version 16.04.1 LTS 64 bit https://www.ubuntu.com/download/desktop. How do I install the required kernel driver to gain access to the GPIO?
You can find instructions on how to patch the kernel here: https://wiki.up-community.org/Ubuntu
Thank you. I'd would like to use GrovePi board for the Up Squared, which packets that I need to install for node JS on Ubuntu?
Grove Pi board https://www.seeedstudio.com/UP%26sup2%3B-Grove-IoT-Development-Kit-p-2994.html
I got it working now. Need the line below to interface with Grove Sensors. mraa.addSubplatform(mraa.GROVEPI, "0 ")
Test.js var m = require('mraa'); console.log("MRAA version: " + m.getVersion()); var digitalPin = new m.Gpio(12);
node Test.js
MRAA version: v1.9.0 Test.js:3 var digitalPin = new m.Gpio(12); ^ Error: Illegal arguments for construction of _exports_Gpio
module.js:328 throw err; ^
Error: Cannot find module 'mraa'