megamarky
Posts: 42
Joined: Sun Jun 11, 2017 6:43 am

WiringPi/Pi4J without sudo in Spring Boot

Sun Jan 14, 2018 8:26 am

Hi,

there's a Beta version http://gigabrain.io/twoplayer.html of a two player game that runs with Spring Boot and Pi4J. To get the GPIO write access the boot app will have to be run with GPIO write rights.

Currently the install script launches the java app with sudo command, and the app checks rights to /dev/mem and this needs to be changed not to require the sudo.

The Pi4J 1.2 SNAPSHOT is currently used. There was a post about the http://wiringpi.com/wiringpi-update-to-2-29/

Code: Select all

export WIRINGPI_GPIOMEM=1
Should only this environment variable be enough for this setup? Has anyone made a Pi4J setup to use the /dev/gpiomem access with wiringpi?
GigaBrain.io

User avatar
DougieLawson
Posts: 33785
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: WiringPi/Pi4J without sudo in Spring Boot

Sun Jan 14, 2018 10:14 am

Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

megamarky
Posts: 42
Joined: Sun Jun 11, 2017 6:43 am

Re: WiringPi/Pi4J without sudo in Spring Boot

Sun Jan 14, 2018 11:32 am

Thank you, I did not realize that this was the same property as the pi4j.linking. I will change it to use the property

Code: Select all

java -Dpi4j.linking=dynamic 
GigaBrain.io

megamarky
Posts: 42
Joined: Sun Jun 11, 2017 6:43 am

Re: WiringPi/Pi4J without sudo in Spring Boot

Mon Jan 15, 2018 2:27 pm

There still seems to be issue using the PWM write functions without sudo.

https://github.com/raspberrypi/linux/issues/1983

https://github.com/Pi4J/pi4j/issues/352

Looks like there is a new RaspberryPi kernel version coming that has the PWM usage without sudo.
GigaBrain.io

Return to “Java”

Who is online

Users browsing this forum: No registered users and 3 guests