-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Illegal arguments for construction of _exports_Gpio in Node 4.2.3 using mraa 0.8.1 #380
Comments
Did a little more research, the actually problem is a lack of permissions for that user (not running as root). Nothing to do with specific versions. I will close this, however, might I ask what would be an ideal udev rule to use on Edison to allow gpio & i2c permissions to a group named |
Ah cool :) Had me confused. Making nice udev rules is hard because you need to give permissions to created nodes. I've never tried it but this seems like it would be on the right tracks: http://raspberrypi.stackexchange.com/questions/23162/gpio-value-file-appears-with-wrong-permissions-momentarily |
Hi, @arfoll I tried the followinig udev rule, and it did set the permissions as I expected, but still failing from code unless run as sudo:
Any suggestions? Seems pretty important to be able to run mraa code on Edison under other users accounts besides |
I did some additional research, and even when setting the group to I modded my udev rules as follows:
Now I am seeing all files owned by gpio group.
I would strongly suggest that we collectively prioritize figuring this out, since no production deployment on Edison will want run as |
@arfoll any thoughts on how I might be able to track down the required permissions on Edison? |
I havent got an edison to hand right now. Have you tried looking at the permissions of the linked file. "../../devices/pci0000:00/0000:00:0c.0/gpio/gpio127" |
Hi, @tingleby Yes, and it would appear to also have to correct group ownership?
|
Likewise, I am certain on the correct group membership of current user:
|
More info: Here is the error as caught by my journal:
That would appear to be this code here: I tried adding that path to the udev rule, and was able to chown to the
Despite that, still same problem... 😿 |
So Ive had a play this afternoon, Ive gotten most of the way but still I get some issues. Mostly I think with muxes. |
FWIW, it looks good and indeed @deadprogram's problems mostly look like some permissions still not accounted for. If you need a hand with e.g. testing those rules you've come up with - let me know. I have Edison and both Arduino & mini-breakout boards. |
I'm trying to use these udev rules to allow non-root users access to GPIO and the SPI bus through mraa. I've adapted the rules a for spi:
Now when I try to use mraa with gpio, I don't get any errors but I also can't control the GPIO. I think writing to the gpio is failing. I'm also having issues with the spi bus:
Could you please give me some pointers for what the udev rules should be to get these working? |
Hi @mogar as far as I know, still no one has actually been able to access GPIO etc. under a non-root user on Edison. :( If so, they have not chimed in here. |
I was able to control both I2C and GPIO successfully using nodejs on an Edison running Jubilinux. I believe the process should be the same for other variants. @mogar's udev rules worked, though I also had to add the following rule:
For debugging, I found this command useful (you can replace
Which gives you output like this to tell you which files are the issue:
It seems that there is an issue caused by the GPIOs being added while the program is running. The first time I run it I see this:
And the GPIO doesn't work, probably because the device path has just been created and udev hasn't had time to change its permissions yet. The second time I run it, the device is already there, and it works fine. Maybe mraa needs to wait a bit before accessing those paths after setting the GPIO up? |
So the solution I made but haven't quite finished is using imraa to do exactly this, open the gpios you want and then not release them. You can use this configuration file as the basis: and then at the top of the file define the I/O you want to use under which user, and the rest should just work. |
When trying to run the example program https://github.com/intel-iot-devkit/mraa/blob/master/examples/javascript/Blink-IO.js on an Edison with the latest release Yocto image 2.1 using mraa 0.8.1 under node.js 4.2.3, I received the error
Illegal arguments for construction of _exports_Gpio
The text was updated successfully, but these errors were encountered: