Merad wrote:So I've set my Pi up for remote C++ development using Netbeans and the WiringPi library to access GPIO... the only problem is that of course programs accessing GPIO have to be run as root, and I can't figure out how to have Netbeans run the program as root when running/debugging remotely. Does anyone know of a way to set this up? Or maybe to give a specific user access to GPIO so that they can run programs without needing root privileges?
Delending on the level of GPIO access you need, some things can be run as non-root.
To do this, you need to export the pins using the gpio export command - that sets their direction in or out, then you can use wiringPiSetupSys() in your program.
Issues with doing it this way: It's not fast. It's not slow either, but won't be fast enough for some things. You can't easilly change a pins direction inside your program and you can't change the pull up/downs either.
However you can use e.g. system() to change a pins direction and pull up. You can also system() to use the gpio program to set the exports, but you must do this before you call wiringPiSetupSys () - as it reads & opens the exported pins just once... (as a performance thing)
Also - in this mode it uses the BCM_GPIO pin numbering scheme - and you need to know that e.g. pin 22 was mapped to 27 in the Rev 2 board..
You won't be able to use the softPwm or softTone modules in this mode, but most others will work including some of the devLib - e.g. the LCD code, but not timing specific things like the RHT03 sensors.
Another way might be to simply have a login on the Pi and sudo the binary after you've compiled it rather than try to launch it remotely.
-Gordon