2

...tinkered a bit with GPIO and Piface Digital. It was all ok until I had installed RPi.GPIO via pip. After that the directory /sys/devices/virtual/gpio disappeared and never showed up again. I had it working earlier when I installed RPi.GPIO from tar.gz.

Yesterday I made a fresh install, and there was that directory. But again, after installing RPi.GPIO over pip it disappeared again. I have removed that package, rebooted several times, deatached the Piface Digital but no luck. Don't know, what else I can do except reimaging.

Any suggestions?

1
  • As suggested by joan's answer, the gpio sysfs folder is at /sys/class. In my current Arch Linux it is that way.
    – Ghanima
    Commented Feb 13, 2015 at 16:17

2 Answers 2

1

Are you sure it's not because you have a recent kernel? I.e. have you recently updated the firmware.

The gpio directory seems to have moved to /sys/class.

ls /sys/devices/virtual

bdi    graphics  mem   net  thermal  vc      vchiq   vtconsole
block  input     misc  raw  tty      vc-cma  vc-mem  workqueue

.

ls /sys/class

bdi          ieee80211         lirc          rtc          uio
block        input             mem           scsi_device  vc
bsg          iscsi_connection  misc          scsi_disk    vc-cma
dma          iscsi_endpoint    mmc_host      scsi_host    vchiq
gpio         iscsi_host        net           sound        vc-mem
graphics     iscsi_iface       power_supply  spidev       vtconsole
hidraw       iscsi_session     raw           spi_master
i2c-adapter  iscsi_transport   rc            thermal
i2c-dev      leds              rfkill        tty
1
  • yeah, it'll be so. I do my Syu nearly daily. But that is not simply a move. The /sys/class directory existet formerly and also exists in raspbian, just the created interfaces are showing up in the virtual/gpio directory. But the realization of that didn't help me much since the pifacedigitalio package looked in the wrong directory. So I have modded the interrupts.py file in the pifacecommon package. I changed line 18 to GPIO_INTERRUPT_DEVICE = "/sys/class/gpio/gpio%d" % GPIO_INTERRUPT_PIN That works for me! :-) Thanx
    – flacer
    Commented Feb 16, 2015 at 13:00
0

As @joan listed, the gpio symbolic links in /sys/class/gpio/ moved from /sys/devices/virtual/ to /sys/devices/soc/20200000.gpio.

Solution 1

chmod -R +x /sys/devices/soc/20200000.gpio

Solution 2

Update the RPi.GPIO from /sys/devices/virtual/gpio to /sys/class/gpio.

Solution 3

Add line device_tree= in /boot/config.txt. That will revert the links to be in the old path. Make sure you reboot after changing the config.txt.


Pick your flavor :)

Edit:

I've fixed both pi-gpio (pull request #34) and gpio-admin (pull request #7) in a manner so that both the old and the new paths are supported. Hopefully, those pull requests are merged soon...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.