Community
cancel
Showing results for 
Search instead for 
Did you mean: 
KT1
New Contributor I
1,676 Views

EDISON Error: Illegal arguments for construction of _exports_Gpio @MRAA

I am running a nodejs app on docker build on a resin.io yocto build.

Running Intel Eddison using MRAA for interrupt. Code was working fine till today.

It now breaks and gives

Error: Illegal arguments for construction of _exports_Gpio

MRAA Version: v1.1.1 also did a NPM install for the latest version but still getting same error

21.01.17 14:35:12 [-0500] /usr/src/app/main.js:100

 

21.01.17 14:35:12 [-0500] InterruptPin2 = new mraa.Gpio(32) // mraa8 -gp28

 

21.01.17 14:35:12 [-0500] ^

 

21.01.17 14:35:12 [-0500]

 

21.01.17 14:35:12 [-0500] Error: Illegal arguments for construction of _exports_Gpio

 

21.01.17 14:35:12 [-0500] at Error (native)

 

21.01.17 14:35:12 [-0500] at Object. (/usr/src/app/main.js 17)

 

21.01.17 14:35:12 [-0500] at Module._compile (module.js:570:32)

 

21.01.17 14:35:12 [-0500] at Object.Module._extensions..js (module.js:579:10)

 

21.01.17 14:35:12 [-0500] at Module.load (module.js:487:32)

 

21.01.17 14:35:12 [-0500] at tryModuleLoad (module.js:446:12)

 

21.01.17 14:35:12 [-0500] at Function.Module._load (module.js:438:3)

 

21.01.17 14:35:12 [-0500] at Module.runMain (module.js:604:10)

 

21.01.17 14:35:12 [-0500] at run (bootstrap_node.js:394:7)

 

21.01.17 14:35:12 [-0500] at startup (bootstrap_node.js:149:9)
Tags (1)
0 Kudos
8 Replies
GImre
Beginner
72 Views

Hi, looking at the GPIO pin table at: https://github.com/intel-iot-devkit/mraa/blob/master/docs/edison.md mraa/edison.md at master · intel-iot-devkit/mraa · GitHub looks like the pin GP28 has an MRAA number of 8, maybe try value that instead of "32"? (so mraa.Gpio(8)). Based on some notes in this Github issue that looks similar to yours: https://github.com/intel-iot-devkit/mraa/issues/88 Illegal arguments for construction of _exports_Gpio Edison on mini breakout with NodeJS · Issue # 88 · intel-iot-devkit/m…

KT1
New Contributor I
72 Views

sorry thate as old comment about Gp28

I am using J19-4 and J19-5

var InterruptPin = new mraa.Gpio(31)

var InterruptPin2 = new mraa.Gpio(32)

InterruptPin.dir(mraa.DIR_IN) // set the Gpio direction to input

InterruptPin2.dir(mraa.DIR_IN) // set the Gpio direction to input

but I have tried different ones 33,36,40,41

they all give the same error of

Error: Illegal arguments for construction of _exports_Gpio

21.01.17 14:35:12 [-0500] at Error (native)

21.01.17 14:35:12 [-0500] at Object. (/usr/src/app/main.js 17)

21.01.17 14:35:12 [-0500] at Module._compile (module.js:570:32)

21.01.17 14:35:12 [-0500] at Object.Module._extensions..js (module.js:579:10)

21.01.17 14:35:12 [-0500] at Module.load (module.js:487:32)

21.01.17 14:35:12 [-0500] at tryModuleLoad (module.js:446:12)

21.01.17 14:35:12 [-0500] at Function.Module._load (module.js:438:3)

21.01.17 14:35:12 [-0500] at Module.runMain (module.js:604:10)

21.01.17 14:35:12 [-0500] at run (bootstrap_node.js:394:7)

21.01.17 14:35:12 [-0500] at startup (bootstrap_node.js:149:9)

 

This code was running perfectly till this weekend. code didn't change or any hardware connections
GImre
Beginner
72 Views

What base image are you using in your Dockerfile? (the `FROM` line)

 

Can you share the Dockerfile contents?
KT1
New Contributor I
72 Views

# Gets latest base image from https://registry.hub.docker.com/u/resin/edison-node/

FROM resin/edison-node:latest

# Enable systemd

ENV INITSYSTEM on

# Copy package.json to root of container

# This is copied independently for better caching.

COPY package.json /usr/src/app/package.json

WORKDIR /usr/src/app

# install all npm (node.js) dependencies

RUN npm install

# Copy our node.js source code into /usr/src/app

COPY app/ /usr/src/app

# Run the main.js script when the container starts on the device.

CMD ["node", "/usr/src/app/main.js"]

This is the docker file

 

i tried adding mraa to the package.json to get the latest mraa but same issue.

KT1
New Contributor I
72 Views

imrehg I had a spare Edison lying around which had the same MRAA issue. so def a image build/ mraa issue and not a hardware issue.

GImre
Beginner
72 Views

Hi, which version of resinOS are you using? Were these devices newly installed? This would help us narrow down what you have experienced.

KT1
New Contributor I
72 Views

Hi imrehg

 

 

I did a fresh install about 5 days ago do to some unrelated corrupt file fissue (docker was not running on the Edison upon boot)so the os image was recent flash. Resin OS 1.21.0

Seems like the edison-node:latest is building the mraa library properly again. Would love to know what changes you made to the script for future reference. What are the best practices to put the application for production use? Are there a recommended tags to follow?

thanks

idata
Community Manager
72 Views

Hi laniko,

 

 

We'd like to help you out on this case unfortunately, since Resin OS is not a supported image, there's not much we can contribute and it is out of our area of expertise. If you decide to use the supported Yocto image, you can download it from https://software.intel.com/en-us/iot/hardware/edison/downloads https://software.intel.com/en-us/iot/hardware/edison/downloads

 

 

I found however, a couple of links where you can send any questions to the Resin team. Take a look at:

 

https://forums.resin.io/ https://forums.resin.io/

 

https://resin.io/contact/# contact-form https://resin.io/contact/# contact-form

 

 

Regards,

 

-Sergio

 

Reply