Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Community Manager
1,385 Views

Gpio 2 Error

Hi all ,

I have an error with Gpio 2 on Intel Galileo gen 2, this is my example code for the error:

---------------------------------------------------------------------------------------------------------------------

var mraa = require('mraa');

console.log('MRAA Version: ' + mraa.getVersion());

var myDigitalPin2 = new mraa.Gpio(2);

myDigitalPin2.dir(mraa.DIR_OUT);

myDigitalPin2.write(1);

---------------------------------------------------------------------------------------------------------------------

And the error appear like this:

---------------------------------------------------------------------------------------------------------------------

ERROR: /home/root/.node_app_slot/main.js:3

ERROR: var myDigitalPin2 = new mraa.Gpio(2);

ERROR: ^

ERROR: Error: Illegal arguments for construction of _exports_Gpio

at Object. (/home/root/.node_app_slot/main.js:3:21)

at Module._compile (module.js:456:26)

at Object.Module._extensions..js (module.js:474:10)

at Module.load (module.js:356:32)

at Function.Module._load (module.js:312:12)

at Function.Module.runMain (module.js:497:10)

at startup (node.js:119:16)

at node.js:935:3

---------------------------------------------------------------------------------------------------------------------

Note:

1- I am using Intel XDK IOT Edition.

2- Intel Galileo gen 2.

3- I have updated the libraries and the demon to latest versions.

4- This error appears only with gpio 2, and if I used any other gpio the error will disappear.

5- I have changed the galileo board and the same error appeared.

Thanks in advance for your help,

Bashar Thamir,

Tags (1)
6 Replies
Highlighted
Community Manager
10 Views

Hi,

 

 

What image are you using, ubclibc or eglibc? Using your current libraries and daemons are you able to run the code for every GPIO except GPIO2?

 

What MRAA version are you using?

 

 

In case you haven't done this yet, look at the steps for installing MRAA & UPM Library on Intel IoT Platform with IoTDevKit Linux* image

 

1. echo "src maa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf

 

2. opkg update

 

3. opkg upgrade

 

 

-Sergio

 

0 Kudos
Highlighted
Community Manager
10 Views

Dear Sergio,

I'm using eglibc, Mraa version is: 1.0.0, UPM version is: 0.7.0.

And the run without any problem with other Gpio the problem only with Gpio2.

my current firmware is 1.0.2.

Thanks.

Bashar,

Highlighted
Valued Contributor II
10 Views

Hi,

there was a bug related only with GPIO2 of Galileo Gen2 board.It is already fixed in MRAA version 1.0.0 on May 20, 2016.

A MRAA version 1.0.0 build compiled from the source before May 20, 2016 will have a problem.

So, need to update MRAA to the latest MRAA build created after May 20, 2016.

Now it looks like:

A possible solution is to build MRAA from the source.

BR,

xbolshe

0 Kudos
Highlighted
Community Manager
10 Views

Dear xbolshe,

I have already the latest mraa version 1.0.0 and this is a screenshot for the error using putty:

and I didn't understand what you mean by ("build MRAA from the source").

thanks for your help any way.

Bashar.

0 Kudos
Highlighted
Valued Contributor II
10 Views

Hi,

there are about 14 different subversions of MRAA version 1.0.0.

As I have already mentioned above not all of them have a fixed GPIO2 issue.

The source means a source code located at https://github.com/intel-iot-devkit/mraa GitHub - intel-iot-devkit/mraa: Low Level Skeleton Library for IO Communication on GNU/Linux platforms

If you are not familiar with a MRAA compilation, it is better to use the previous MRAA version or wait when a new MRAA build will be available.

PS: as you may find http://iotdk.intel.com/repos/3.0/intelgalactic/opkg/i586 http://iotdk.intel.com/repos/3.0/intelgalactic/opkg/i586 has MRAA build with a date

It means that commands like

echo "src mraa-upm http://iotdk.intel.com/repos/3.0/intelgalactic-dev/opkg/i586 http://iotdk.intel.com/repos/3.0/intelgalactic-dev/opkg/i586" > /etc/opkg/mraa-upm.conf

opkg update

opkg install mraa

will not help to fix the GPIO2 issue.

BR,

xbolshe

0 Kudos
Highlighted
Community Manager
10 Views

Dear xbolshe,

Thanks for your help I downgrade the mraa version by rewrite an old version of (https://software.intel.com/galileo-image/latest EGLIBC microSD card image), now I have mraa v0.8.0 and everything works ok for me.

Bashar,

0 Kudos