You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
I'm simply trying to test PWM output to my piezo buzzer. I did some tracing and found that the Pi seems to "Hang/Crash" after a call to com.pi4j.wiringpi.Gpio.pinMode(); (WiringPiGpioProviderBase.java, Line 155)
I tried with both of these methods (see below) and I get the same result. Its hard to say whether it crashed or hangs, but my SSH connection gets dropped after 30 seconds or so and the Pi no longer seems to respond.
GpioPinPwmOutput buzzer = gpio.provisionPwmOutputPin(RaspiPin.GPIO_26, "Buzzer");
or Gpio.pinMode(RaspiPin.GPIO_26.getAddress(), PWM_OUTPUT);
However, If I set the pinmode from the command line gpio mode 26 pwm and do a 'gpio pwm 26 500' for example, it works.
Further info on my environment setup:
RPI 2 Model B
Pi4j 1.2-SNAPSHOT
Kernel v4.9.35-v7+
Wiring pi v2.44
The text was updated successfully, but these errors were encountered:
ribasco
changed the title
RPI 2 seems to "Hangs" or "Crash" after setting pinmode to PWM output
RPI 2 seems to "Hang" or "Crash" after setting pinmode to PWM output
Aug 1, 2017
I think this issue can be reopened. There has been some movement concerning root privileges and PWM functionality in Raspbian. Seems like the following patch makes it possible to use hardware PWM without sudo: raspberrypi/linux#1983
Perhaps it could be included in the non-privileged mode in an upcoming release? I really would like to see that.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Been stuck on this problem the whole day.
I'm simply trying to test PWM output to my piezo buzzer. I did some tracing and found that the Pi seems to "Hang/Crash" after a call to
com.pi4j.wiringpi.Gpio.pinMode();
(WiringPiGpioProviderBase.java, Line 155)I tried with both of these methods (see below) and I get the same result. Its hard to say whether it crashed or hangs, but my SSH connection gets dropped after 30 seconds or so and the Pi no longer seems to respond.
GpioPinPwmOutput buzzer = gpio.provisionPwmOutputPin(RaspiPin.GPIO_26, "Buzzer");
or
Gpio.pinMode(RaspiPin.GPIO_26.getAddress(), PWM_OUTPUT);
However, If I set the pinmode from the command line
gpio mode 26 pwm
and do a 'gpio pwm 26 500
' for example, it works.Further info on my environment setup:
RPI 2 Model B
Pi4j 1.2-SNAPSHOT
Kernel v4.9.35-v7+
Wiring pi v2.44
The text was updated successfully, but these errors were encountered: