OK, I am not using a current kernel, so can't really address the issues with group settings. But, here's one thing that will work: if you have a user program xyz, do : sudo chown root:root xyz sudo chmod u+s xyz
TYhis makes the program owned by rootm, and uses the privileges of root when that program is run. You DO need root privileges to MAKE these settings, but then the program will run and be able to access the GPIO without the user needing the privileges. Making the user a member of the right group should also make any program run by that user have the necessary privilege. It depends on what is in the /etc/group file as to what group you need to be a member of. Jon On Tuesday, May 11, 2021 at 12:29:23 AM UTC-5 [email protected] wrote: > > From: [email protected] [mailto:[email protected]] On > Behalf Of Dennis Lee Bieber > > "John Dammeyer" <[email protected]> wrote: > > > >The SPI bus ADAfruit application for a 320x240 display written in > Python runs properly rendering LENNA.JPG onto the LCD display. > > > The key outputs are the DC and RESET which are on gpio48 and gpio60. An > "ls" of the /sys/class/gpio folder shows on start up those > > two are not visible. > > > > > > > SPI and I2C rely upon a different PINMUX configuration than GPIO... > > GPIO is pretty much all "mode 7". SPI0 pins are "mode 0" and SPI1 pins > are > > "mode 3". > > http://www.ofitselfso.com/BeagleNotes/BeagleboneBlackPinMuxModes.php > > Hi Dennis, > I think you missed the above line in my initial posting where the signals > DC and RESET are used for controlling the LCD display. They have absolutely > nothing to do with SPI. > > > > > >to create the gpio48 folder and as super user the VXP library can do > that but then it fails on the write to SPI. > > In fact if I run the program without running it as super user the failure > messages that occur happen because gpio48 and gpio60 cannot be created due > to access rights. > > The PXL library appears to be designed and tested with a BBB (based on the > photos and wiring diagram) but because the library is older, the moving > target (AKA BeagleBone OS) is likely the culprit for it not working. > > Here's the constructor which shows I'm trying to get to spidev1.0 and the > PinDC and PinRST are gpio48 and gpio60 respectively. > > > =================================================================================== > constructor TApplication.Create; > begin > FGPIO := TSysfsGPIO.Create; > FDataPort := TSysfsSPI.Create('/dev/spidev1.0'); > > FDisplay := TDisplay.Create(TDisplay.OLED128x128, FGPIO, FDataPort, PinDC, > PinRST); > > FDisplaySize := (FDisplay as TDisplay).ScreenSize; > > FDisplay.Initialize; > FDisplay.Clear; > > LoadGraphics; > end; > > =================================================================================== > > And then here's the python code that does work. > > > #################################################################################### > from PIL import Image > > import Adafruit_ILI9341 as TFT > import Adafruit_GPIO as GPIO > import Adafruit_GPIO.SPI as SPI > > # BeagleBone Black configuration. > DC = 'P9_15' > RST = 'P9_12' > SPI_PORT = 1 > SPI_DEVICE = 0 > > # Create TFT LCD display class. > disp = TFT.ILI9341(DC, rst=RST, spi=SPI.SpiDev(SPI_PORT, SPI_DEVICE, > max_speed_hz=64000000)) > > #################################################################################### > > In both cases SPI device 1.0. All I'm doing is compiling an example from > the PXL library and the original subject line is still my primary interest. > Likely this issue will be solved by the Lazarus group since it's likely a > Linux on BBB problem. > > So before we get too far off topic again do you know what to do to for > setting up GPIO access without sudo? > > Thanks > John > > > > > > > > > SPI0 appears on P9_17, _18, _21, and _22 (raw GPIO # 5, 4, 3, 2, aka > > gpio0_5, ...). SPI1 are on P9_28, _29, _30, _31 (raw GPIO # 113, 111, > 112, > > 110, aka gpio3_17, _15, _16, _14). > > > > GPIO # 48 (gpio1_16) on P9_15 has no modes for SPI. > > > > > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/12eed06d-2d12-402a-a82f-0ca2603d4a8fn%40googlegroups.com.
