in Tomcat7, wiringPiSetup: Must be root. (Did you forget sudo?)

1,020 views
Skip to first unread message

Cem Sekem

unread,
Oct 20, 2015, 10:13:08 AM10/20/15
to Pi4J
Hi, 

i have a trouble in wiring a pin.
Using; 
Raspberrypi 2, 
Raspian wheezy,
JVM: java-7-oracle 
Tomcat 7, 
pi4j version 1.0


when this code works;

GpioController gpio = GpioFactory.getInstance();
GpioPinDigitalOutput pin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01, "Pin1", PinState.HIGH);
pin.pulse(1000, true);

i got this error in catalina.out 
"wiringPiSetup: Must be root. (Did you forget sudo?)"

i do several things to start tomcat7 as root, but i failed;
does anybody know anything about this error?

Kevin Roberts

unread,
Oct 21, 2015, 12:32:55 PM10/21/15
to Pi4J
Did you edit /etc/default/tomcat7 and change user and group to root?

Cem Sekem

unread,
Oct 22, 2015, 9:36:50 AM10/22/15
to Pi4J
OK,
thanks Kevin.

i was changing the wrong file /etc/init.d/tomcat7
the right one is /etc/default/tomcat7 

it is running now.

21 Ekim 2015 Çarşamba 19:32:55 UTC+3 tarihinde Kevin Roberts yazdı:

f201...@pilani.bits-pilani.ac.in

unread,
May 27, 2016, 4:16:49 AM5/27/16
to Pi4J

f201...@pilani.bits-pilani.ac.in

unread,
May 27, 2016, 4:18:07 AM5/27/16
to Pi4J
can anyone tell what exactlly i have to type to get rid of the problem

DIVANSHU GUPTA

unread,
May 27, 2016, 6:40:59 AM5/27/16
to Pi4J
it works properly if we write 
sudo ./blink
where it has been compiled by gcc -Wall -o blink blink.c -lwiringpi


Divanshu Gupta
1st year,B.E.(Hons.) electrical and electronics Engineering
Alternate Email : divans...@gmail.com

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

Birla Institute of Technology & Science, Pilani

Pilani Campus, Vidhya Vihar, Pilani, Rajasthan - 333 031, INDIA


--
You received this message because you are subscribed to a topic in the Google Groups "Pi4J" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pi4j/-H5SVaTxgks/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pi4j+uns...@googlegroups.com.
Visit this group at https://groups.google.com/group/pi4j.
To view this discussion on the web visit https://groups.google.com/d/msgid/pi4j/741f85cb-d1c6-428b-a30f-867147376f70%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

DIVANSHU GUPTA

unread,
May 28, 2016, 7:56:42 AM5/28/16
to Pi4J

Divanshu Gupta
1st year,B.E.(Hons.) electrical and electronics Engineering
Alternate Email : divans...@gmail.com

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

Birla Institute of Technology & Science, Pilani

Pilani Campus, Vidhya Vihar, Pilani, Rajasthan - 333 031, INDIA


dheerag.PNG
Reply all
Reply to author
Forward
0 new messages