{"id":42885376,"url":"https://github.com/info-beamer/sysfs-gpio-shim","last_synced_at":"2026-01-30T14:48:30.600Z","repository":{"id":228198045,"uuid":"773353148","full_name":"info-beamer/sysfs-gpio-shim","owner":"info-beamer","description":"Reviving /sys/class/gpio using FUSE","archived":false,"fork":false,"pushed_at":"2025-01-13T14:17:16.000Z","size":31,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T15:30:18.806Z","etag":null,"topics":["gpio","raspberry-pi","sysfs-gpio"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/info-beamer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-17T12:46:54.000Z","updated_at":"2025-01-13T14:17:19.000Z","dependencies_parsed_at":"2024-04-13T22:29:09.228Z","dependency_job_id":"0fb25487-2395-461f-87c9-9cd3bfae282e","html_url":"https://github.com/info-beamer/sysfs-gpio-shim","commit_stats":null,"previous_names":["info-beamer/sysfs-gpio-shim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/info-beamer/sysfs-gpio-shim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/info-beamer%2Fsysfs-gpio-shim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/info-beamer%2Fsysfs-gpio-shim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/info-beamer%2Fsysfs-gpio-shim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/info-beamer%2Fsysfs-gpio-shim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/info-beamer","download_url":"https://codeload.github.com/info-beamer/sysfs-gpio-shim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/info-beamer%2Fsysfs-gpio-shim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gpio","raspberry-pi","sysfs-gpio"],"created_at":"2026-01-30T14:48:28.283Z","updated_at":"2026-01-30T14:48:30.592Z","avatar_url":"https://github.com/info-beamer.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Reviving /sys/class/gpio using FUSE\n\nThis FUSE based virtual filesystem emulates the deprecated\n[/sys/class/gpio method](https://github.com/torvalds/linux/blob/7efd0a74039fb6b584be2cb91c1d0ef0bd796ee1/Documentation/userspace-api/gpio/sysfs.rst) of manipulating GPIOs. I wrote this\ntool to see if it is possible to maintain backwards\ncompatibility for code deployed on a number of Raspberry Pis.\n\nThis code is still work in progress and should not be\nconsidered stable.\n\nWhile the new method using gpiod is really powerful, the\nsimplicity of just poking around in a few files is\nsometimes still hard to beat.\n\n## Compiling\n\nI only tested on Raspberry Pi OS. Compiling requires\nlibfuse3-dev and unfortunately libgpiod 2.1 which Raspberry Pi\nBookworm currently doesn't ship. They still have 1.6.\n\nSo you'll have to compile [libgpiod 2.1 from source](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/README) first.\nOnce that's done, just type `make` and you should get the `sysfs-gpio-shim` binary.\n\n## Running\n\nNot sure how to best automate this on Raspberry Pi OS.\nManually it works like this. As root:\n\n```\nGPIO_GID=\"$(cut -d: -f3 \u003c \u003c(getent group gpio))\"\n./sysfs-gpio-shim -o default_permissions,allow_other,gid=$GPIO_GID /sys/class/gpio\n```\n\nThis will shadow the existing /sys/class/gpio directory\nwith the emulated filesystem provided by this tool.\n\nIf you're done and no one is using the files in\n`/sys/class/gpio` you can unmount the filesystem as\nusual using `umount /sys/class/gpio`.\n\n## What works/doesn't work\n\nI only tried a simple push button connected to\nGPIO18 on a Pi5 as well as some tests using multiple GPIOs\non a Pi3. Edge detection by polling /value should work.\n\nSetting active low, setting or reading the current value and\nexporting/unexporting the GPIO works too.\n\nThe behaviour should be mostly identical to what the\nsysfs implementation did. See also TODO.md.\n\nNon-Pi devices are not supported and no effort will\nbe made by me to change this. Sorry.\n\n## Performance\n\nProbably garbage. If you're using sysfs-based GPIO\ncontrol and expect performance, you're doing it wrong.\n\n## Bugs/Help\n\nIf you find a bug, feel free to open an issue. If you\nuse this tool and it works well, please also let me\nknow :)\n\n## Similar projects\n\n* [gpiod-sysfs-proxy](https://github.com/brgl/gpiod-sysfs-proxy), written in Python.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfo-beamer%2Fsysfs-gpio-shim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfo-beamer%2Fsysfs-gpio-shim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfo-beamer%2Fsysfs-gpio-shim/lists"}