I am currently building a car - For the main display I am using a touch screen driven by a Raspberry Pi using JavaFX. I have multiple scenes running, input data being parsed and displayed, so I have next turned my attention to adding PI4J for digital I/O and RS-232.
As a first step, I have copied a simple program that blinks an LED tied to an output port. The program compiles without error, and loads to the Raspberry Pi using the remote platform function of NetBeans 8.0.2. However, when the program tries to execute I get the following statements:
<--Pi4J--> GPIO Control Example ... started.
wiringPiSetup: Must be root. (Did you forget sudo?)
From what I have read, control of the GPIO for the Raspberry Pi can only be done at the root level. I have done a fair amount of research to find a solution, but it seems most of them are aimed at Eclipse, or compiling/running programs directly on the Raspberry Pi.
I tried the method provided by the arthur Robert Savage of modifying /etc/environment file (which did not exist on the Raspberry Pi) and the sudousers (I think that was the name of the file) without any success.
Could someone please tell me how to get the program to run under sudo on the Raspberry Pi from Netbeans?
Kind regards
David