Faruk
Posts: 54
Joined: Sat Sep 08, 2018 7:34 am

pigpio error: "no permission to update GPIO"

Sat Jan 12, 2019 1:57 pm

Hello

I work on script so I want control to backlight of LCD screen with PWM(software). It is worked earlier but it does not work now. I commented out bakclight divide and worked on the other modules on software. Now I want use but I took this error. I researched on net but I could not fix this. How can I fix this error? My pwm code divide this:

Code: Select all

improt RPi.GPIO as gpio
import pigpio

pi=pigpio.pi()
print (pi.connected)    #Test for pigs t


gpio.setmode(gpio.BCM)
gpio.setwarnings(False)
gpio.setup(33, gpio.IN)  #Pin of DW button 
gpio.setup(30, gpio.OUT) #Pin of backlight
gpio.setup(39, gpio.OUT) #Pin of lcd on/off function


#-Backlight and LCD open-#
def screenopen():
    global pi
    global screenflg

    screenflg=False
    print "screen open start"
    
    gpio.setwarnings(False)
    try:
        
        gpio.output(39,1)
        pi.set_PWM_frequency(30,100)
        
        for i in range(0,155,30):
            pi.set_PWM_dutycycle(30,i)
            time.sleep(0.01)
        print "screen open end"

    except:
        import traceback
        traceback.print_exc()
        prgloop()
Regards
Last edited by Faruk on Mon Jan 14, 2019 5:15 am, edited 2 times in total.

Heater
Posts: 13058
Joined: Tue Jul 17, 2012 3:02 pm

Re: pigpio error: "no permission to update GPIO"

Sat Jan 12, 2019 2:39 pm

What error? You have not shown it.

Try running with sudo like so:

$ sudo python myProg.py

Faruk
Posts: 54
Joined: Sat Sep 08, 2018 7:34 am

Re: pigpio error: "no permission to update GPIO"

Sat Jan 12, 2019 2:52 pm

Error is:"no permission to update GPIO". Return this error. I will try. If I would not work it. I think use new image. Because I try for do this different way but my Rpi reboot itself.

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

Re: pigpio error: "no permission to update GPIO"

Sat Jan 12, 2019 3:15 pm

You appear to be mixing some pigpio code (which you've imported) with lots RPi.gpio code (which you haven't imported).

I'd recommend you pick one or the other.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Faruk
Posts: 54
Joined: Sat Sep 08, 2018 7:34 am

Re: pigpio error: "no permission to update GPIO"

Mon Jan 14, 2019 5:18 am

I edited my code I forgot first line. Sorry. Also I tried use just GPIO(not pigpio) so my rpi reboot itself when run program. I could not understand why? I researched now.

Faruk
Posts: 54
Joined: Sat Sep 08, 2018 7:34 am

Re: pigpio error: "no permission to update GPIO"

Mon Jan 14, 2019 9:23 am

All of error this:

Code: Select all

Traceback (most recent call last):
  File "/home/pi/Petra/PGUI.py", line 166, in updateGUI
    screenclose()
  File "/home/pi/Petra/PGUI.py", line 95, in screenclose
    pi.set_PWM_frequency(30,255)
  File "/usr/local/lib/python2.7/dist-packages/pigpio.py", line 1586, in set_PWM_frequency
    _pigpio_command(self.sl, _PI_CMD_PFS, user_gpio, frequency))
  File "/usr/local/lib/python2.7/dist-packages/pigpio.py", line 975, in _u2i
    raise error(error_text(v))
error: 'no permission to update GPIO'
I could not find any solution.

Return to “General discussion”