{"id":19738558,"url":"https://github.com/sensirion/linux-sps30","last_synced_at":"2026-05-18T19:04:01.990Z","repository":{"id":149345921,"uuid":"234525842","full_name":"Sensirion/linux-sps30","owner":"Sensirion","description":"Linux Kernel Driver for Sensirion SPS30. External module based on the upstream sps30 driver that is backported to older kernels","archived":false,"fork":false,"pushed_at":"2020-04-08T14:29:27.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-22T11:02:57.707Z","etag":null,"topics":["i2c","iio","kernel-driver","particulate-matter","raspberry-pi","sensirion","sensor","sps30"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sensirion.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":"2020-01-17T10:26:45.000Z","updated_at":"2021-10-14T06:22:22.000Z","dependencies_parsed_at":"2023-07-17T13:02:59.892Z","dependency_job_id":null,"html_url":"https://github.com/Sensirion/linux-sps30","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sensirion/linux-sps30","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sps30","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sps30/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sps30/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sps30/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sensirion","download_url":"https://codeload.github.com/Sensirion/linux-sps30/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sps30/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266481717,"owners_count":23935937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["i2c","iio","kernel-driver","particulate-matter","raspberry-pi","sensirion","sensor","sps30"],"created_at":"2024-11-12T01:14:31.198Z","updated_at":"2025-10-09T11:12:47.485Z","avatar_url":"https://github.com/Sensirion.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sensirion SPS30 Linux Kernel Driver\n\nThe sps30 driver for the Sensirion SPS30 is based on the IIO subsystem.\n\nThe driver contained here was originally submitted to the Linux kernel mailing\nlist: https://lkml.org/lkml/2018/12/14/1066\n\nSensirion then backported it to older kernel versions.\n\n## Requirements\nKernel with the following config options set, either as module or compiled in.\nThe config options must be listed in `.config` (e.g. selected with\n`make menuconfig`)\n\nMinimal driver requirements:\n\n* `CONFIG_CRC8`\n* `CONFIG_IIO`\n\n## Directory Structure\n/:      The root directory contains the Makefile needed for out-of-tree\n        module builds.\n\n/sps30: The sps30 directory contains the driver source and Kconfig as needed\n        for upstream merging with the Linux sources.\n\n## Building\n\n### Local Machine\n\nCompiling for your local machine is useful to test if the driver compiles\ncorrectly. Prerequisites are the kernel headers and build tools.\n\n```bash\n# Install dependencies\nsudo apt install build-essential linux-headers-$(uname -r)\n# configure\nexport KERNELDIR=/lib/modules/$(uname -r)/build\n# build\nmake -j\n```\nTo check for style issues we can use the `check` target\n\n```bash\nmake check\n```\n\n### Cross Compiling\n\nTo cross compile, one needs to install a cross compilation tool chain and set\nthe `ARCH` and `CROSS_COMPILE` environment variables accordingly:\n\n```bash\n# Example to cross compile for raspbian\nexport ARCH=arm\nexport CROSS_COMPILE=~/opt/toolchain/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-\n```\n\n## Usage\nThe driver is meant for direct use with sysfs or libiio.\nErrors are printed to the kernel log (dmesg)\n\n### Loading the Kernel Module\nLoad the dependencies of the sps30.ko kernel module:\n\n```bash\nsudo modprobe industrialio\nsudo modprobe crc8\n```\n\nLoad the kernel module with the appropriate command:\n\n* Out-of-tree build\n\n  ```bash\n  sudo insmod sps30.ko\n  ```\n\n* In-kernel build\n\n  ```bash\n  sudo modprobe sps30\n  ```\n\n### Instantiation\nInstantiate the driver on the correct i2c bus with\n\n```bash\necho sps30 0x69 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device\n```\n\nOnly `sps30` is a permissible name.\n\n### Operation\nQuery device files by reading from the iio subsytem's device:\n\n```bash\ncat /sys/bus/iio/devices/iio\\:device0/in_concentration_pm2p5_input\n```\n\nor alternatively on the i2c bus: `/sys/bus/i2c/devices/1-0069/iio:device0/`\n\n### Unloading\nUnload the driver by removing the device instance and then unloading the module.\n\n```bash\necho 0x69 | sudo tee /sys/class/i2c-adapter/i2c-1/delete_device\nsudo rmmod sps30\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Flinux-sps30","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensirion%2Flinux-sps30","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Flinux-sps30/lists"}