{"id":19738556,"url":"https://github.com/sensirion/linux-sgp30","last_synced_at":"2026-01-31T21:14:28.447Z","repository":{"id":149345916,"uuid":"191760989","full_name":"Sensirion/linux-sgp30","owner":"Sensirion","description":"Linux Kernel Driver for Sensirion SGP30 and SGPC3. External module based on the upstream sgp30 driver but feature-completed and backported to older kernels","archived":false,"fork":false,"pushed_at":"2022-08-23T07:07:03.000Z","size":119,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T05:35:49.452Z","etag":null,"topics":["chemical","gas-sensor","i2c","iio","kernel-driver","raspberry-pi","sensirion","sensor","sgp30","sgpc3"],"latest_commit_sha":null,"homepage":"","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,"zenodo":null}},"created_at":"2019-06-13T12:42:21.000Z","updated_at":"2022-08-23T07:07:06.000Z","dependencies_parsed_at":"2023-07-17T13:02:57.875Z","dependency_job_id":null,"html_url":"https://github.com/Sensirion/linux-sgp30","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sensirion/linux-sgp30","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sgp30","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sgp30/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sgp30/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sgp30/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sensirion","download_url":"https://codeload.github.com/Sensirion/linux-sgp30/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Flinux-sgp30/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260688016,"owners_count":23046829,"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","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":["chemical","gas-sensor","i2c","iio","kernel-driver","raspberry-pi","sensirion","sensor","sgp30","sgpc3"],"created_at":"2024-11-12T01:14:31.031Z","updated_at":"2026-01-31T21:14:28.435Z","avatar_url":"https://github.com/Sensirion.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sensirion SGP30/SGPC3 Linux Kernel Driver\n\nThe sgp30 driver for the Sensirion SGP30 and SGPC3 drivers is based on the IIO\nsubsystem\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/sgp30: The sgp30 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 sgp30.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 sgp30.ko\n      ```\n\n* In-kernel build\n\n      ```bash\n      sudo modprobe sgp30\n      ```\n\n### Instantiation\nInstantiate the driver on the correct i2c bus with\n\n```bash\necho sgp30 0x58 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device\n```\n\nOnly `sgp30` and `sgpc3` are permissible names. Use of the name of the wrong\nchip will result in an error during probing.\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_selftest\nOK\n```\n\nor alternatively on the i2c bus: `/sys/bus/i2c/devices/1-0058/iio:device0/`\n\n### Unloading\nUnload the driver by removing the device instance and then unloading the module.\n\n```bash\necho 0x58 | sudo tee /sys/class/i2c-adapter/i2c-1/delete_device\nsudo rmmod sgp30\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Flinux-sgp30","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensirion%2Flinux-sgp30","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Flinux-sgp30/lists"}