{"id":18360958,"url":"https://github.com/f-4-u/rpi_oled","last_synced_at":"2026-04-30T02:31:44.489Z","repository":{"id":217198521,"uuid":"743277931","full_name":"f-4-u/rpi_oled","owner":"f-4-u","description":"This Python script displays system statistics on an OLED display connected to a Raspberry Pi. It utilizes the psutil library to gather system information and the luma.oled library for interfacing with the OLED display.","archived":false,"fork":false,"pushed_at":"2024-04-03T17:28:01.000Z","size":26578,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T20:02:53.983Z","etag":null,"topics":["gpio","i2c","oled","psutil","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f-4-u.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-01-14T21:13:47.000Z","updated_at":"2024-01-14T23:24:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c4b3756-8125-48c0-873e-339edf3df88e","html_url":"https://github.com/f-4-u/rpi_oled","commit_stats":null,"previous_names":["f-4-u/rpi_oled"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/f-4-u/rpi_oled","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-4-u%2Frpi_oled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-4-u%2Frpi_oled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-4-u%2Frpi_oled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-4-u%2Frpi_oled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f-4-u","download_url":"https://codeload.github.com/f-4-u/rpi_oled/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-4-u%2Frpi_oled/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32452268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["gpio","i2c","oled","psutil","raspberry-pi"],"created_at":"2024-11-05T22:30:33.230Z","updated_at":"2026-04-30T02:31:44.472Z","avatar_url":"https://github.com/f-4-u.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Display Stats Script\n\nThis Python script displays system statistics on an OLED display connected to a Raspberry Pi. It utilizes the `psutil` library to gather system information and the `luma.oled` library for interfacing with the OLED display.\n\n## Demo\n\n![Preview](./images/preview.gif)\n\n## Prerequisites\n\n- Raspberry Pi with GPIO access\n- OLED display\n- Python 3.x installed on the Raspberry Pi\n- `pip` package manager installed on the Raspberry Pi\n\n## Setup\n\n1. **Clone the Repository:**\n\n    ```bash\n    git clone https://github.com/f-4-u/rpi_oled.git\n    cd rpi_oled\n    ```\n\n2. **Create and Activate a Virtual Environment:**\n\n    ```bash\n    python3 -m venv env\n    source env/bin/activate\n    ```\n\n3. **Install Dependencies:**\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n## Running the Script\n\n1. **Connect OLED Display:**\n\n   Ensure your OLED display is properly connected to the Raspberry Pi.\n\n2. **Activate Virtual Environment:**\n\n    ```bash\n    source env/bin/activate\n    ```\n\n3. **Run the Script:**\n\n    ```bash\n    python stats.py\n    ```\n\n    The script will continuously display system statistics on the OLED display.\n\n4. **Exit the Script:**\n\n    To stop the script, press `Ctrl+C`.\n\n## Updating Dependencies\n\nIf you add or remove dependencies in your script, update the `requirements.txt` file:\n\n```bash\npip freeze \u003e requirements.txt\n```\n\nAnd re-install the dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\n## Autostart with systemd\n\nTo automatically start the `stats.py` script at bootup on your Raspberry Pi, you can create a systemd service. Follow these steps:\n\n1. **Create a systemd Service File:**\n\n    Create a new file named `display-stats.service` in the `/etc/systemd/system/` directory.\n\n    ```bash\n    sudo nano /etc/systemd/system/display-stats.service\n    ```\n\n    Add the following content to the file:\n\n    ```ini\n    [Unit]\n    Description=Display Stats Script\n    After=network.target\n\n    [Service]\n    ExecStart=/path/to/your/project/env/bin/python /path/to/your/project/stats.py\n    WorkingDirectory=/path/to/your/project\n    User=yourusername\n    Group=yourusername\n    Restart=always\n\n    [Install]\n    WantedBy=multi-user.target\n    ```\n\n    Replace `/path/to/your/project` with the actual path to your project directory and set `yourusername` to the username of your Raspberry Pi.\n\n2. **Reload systemd and Enable the Service:**\n\n    ```bash\n    sudo systemctl daemon-reload\n    sudo systemctl enable display-stats.service\n    ```\n\n3. **Start the Service:**\n\n    ```bash\n    sudo systemctl start display-stats.service\n    ```\n\n    To check the status or troubleshoot, you can use:\n\n    ```bash\n    sudo systemctl status display-stats.service\n    ```\n\n    To stop or restart the service:\n\n    ```bash\n    sudo systemctl stop display-stats.service\n    sudo systemctl restart display-stats.service\n    ```\n\n## Additional Group Memberships\n\nTo ensure proper access to GPIO and I2C functionalities, it may be necessary to add your default user to the `gpio` and `i2c` groups on your Raspberry Pi. Follow these steps:\n\n1. **Add User to `gpio` Group:**\n\n   ```bash\n   sudo usermod -aG gpio $USER\n   ```\n\n2. **Add User to `i2c` Group:**\n\n   ```bash\n   sudo usermod -aG i2c $USER\n   ```\n\n3. **Restart Your Raspberry Pi:**\n\n   To apply the changes, restart your Raspberry Pi:\n\n   ```bash\n   sudo reboot\n   ```\n\nAfter completing these steps, your user should have the necessary group memberships to access GPIO and I2C without requiring elevated privileges. This is important for running scripts interacting with hardware interfaces seamlessly.\n\n## Font\n\nThe script uses the [Dogica](https://www.dafont.com/dogica.font) font. Dogica is a monospace typeface made with Inkscape and FontForge and tailored for GB Studio. It features more than 200 characters in an 8x8 grid and comes in two styles: monospace and pixel, the kerned version. Four pictures for GB Studio are included. It is free for personal and commercial use under the OFL license. Credit/attribution is not required for raster works.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-4-u%2Frpi_oled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff-4-u%2Frpi_oled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-4-u%2Frpi_oled/lists"}