{"id":15142090,"url":"https://github.com/ageagainstthemachine/envirosnoop","last_synced_at":"2026-02-01T22:01:30.065Z","repository":{"id":210842499,"uuid":"714518017","full_name":"ageagainstthemachine/EnviroSnoop","owner":"ageagainstthemachine","description":"An environmental monitoring device employing a Raspberry Pi Pico W to send sensor data to an InfluxDB 2 server.","archived":false,"fork":false,"pushed_at":"2025-04-02T03:59:03.000Z","size":434,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T06:06:42.977Z","etag":null,"topics":["bme680","circuitpython","circuitpython-pico-w","circuitpython-project","pm25","pms7003","radsens","raspberry-pi-pico-w","scd41","scd4x","scd4x-sensor","ssd1306-oled"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ageagainstthemachine.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":"2023-11-05T04:40:32.000Z","updated_at":"2025-04-02T03:59:07.000Z","dependencies_parsed_at":"2024-11-01T11:40:48.593Z","dependency_job_id":"858c7478-4b84-41b3-9a8e-49708dc6b346","html_url":"https://github.com/ageagainstthemachine/EnviroSnoop","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"8b560c12616d9d7e5a681ca0720fa0e73f3af031"},"previous_names":["ageagainstthemachine/envirosnoop"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ageagainstthemachine/EnviroSnoop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageagainstthemachine%2FEnviroSnoop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageagainstthemachine%2FEnviroSnoop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageagainstthemachine%2FEnviroSnoop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageagainstthemachine%2FEnviroSnoop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ageagainstthemachine","download_url":"https://codeload.github.com/ageagainstthemachine/EnviroSnoop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageagainstthemachine%2FEnviroSnoop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261073405,"owners_count":23105643,"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":["bme680","circuitpython","circuitpython-pico-w","circuitpython-project","pm25","pms7003","radsens","raspberry-pi-pico-w","scd41","scd4x","scd4x-sensor","ssd1306-oled"],"created_at":"2024-09-26T09:22:35.771Z","updated_at":"2026-02-01T22:01:30.057Z","avatar_url":"https://github.com/ageagainstthemachine.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EnviroSnoop\n\n\u003cimg src=\"assets/envirosnoop_logo.png\" width=\"200px\" /\u003e\n\n## A Raspberry Pi Pico W-Based Environmental Monitor\n\nEnviroSnoop is an environmental monitoring system employing a Raspberry Pi Pico W. It leverages CircuitPython to measure various environmental parameters using a suite of sensors. Sensors can be easily enabled and disabled, making it a modular framework that supports various sensors. Data is sent to an InfluxDB 2 server for further visualization and analysis.\n\n## Key Features:\n\n- **Multiple Sensor Support:** Compatible with BME680, SCD4X, RadSens, and PM2.5 sensors for comprehensive environmental data collection.\n- **Asynchronous Operation:** Employs asyncio for effective concurrent handling of sensor data reading, display updates, and network tasks.\n- **Sensor Configuration Flexibility:** Dynamically manage sensor operations based on user-configured settings.\n- **Dual Logging System:** Integrates both console and syslog server logging for thorough monitoring and diagnostics.\n- **InfluxDB Connectivity:** Automatically transmits collected environmental data to an InfluxDB 2 database for analysis and storage.\n- **Real-Time Display Updates:** Utilizes an OLED display for immediate visualization of some key sensor readings.\n- **WiFi and NTP Synchronization:** Features WiFi connectivity for network operations and accurate timekeeping through NTP.\n\n## System Requirements:\n\n- Raspberry Pi Pico W with CircuitPython 8.2.x.\n- Sensor modules (corresponding to desired environmental measurements).\n- Various CircuitPython libraries and sensor libraries (see below).\n- WiFi internet/network access.\n- InfluxDB 2 server and auth info/token.\n- A configured `settings.toml` file (see below for configuration).\n\n## Required Modules and Libraries\n\nEnviroSnoop requires various CircuitPython libraries and modules for its functionality. Below is a detailed list of these requirements:\n\n- `os`: Provides a way of using operating system dependent functionality.\n- `gc`: This module provides an interface to the garbage collector.\n- `struct`: Performs conversions between Python values and C structs represented as Python bytes objects.\n- `board`: Board-specific configuration for CircuitPython.\n- `digitalio`: Digital input/output support.\n- `wifi`: For handling WiFi connections.\n- `socketpool`: Provides a pool of socket resources.\n- `adafruit_ntp`: Network Time Protocol client for CircuitPython.\n- `time`: Time related functions.\n- `asyncio`: Provides infrastructure for writing single-threaded concurrent code using coroutines and multiplexing I/O access.\n- `supervisor`: Provides access to CircuitPython's supervisor functions.\n- `busio`: Provides support for bus protocols like I2C and SPI.\n- `adafruit_requests`: CircuitPython library for making HTTP requests.\n- `adafruit_connection_manager`: Library for managing sockets and connections.\n- `ssl`: Provides access to Transport Layer Security (TLS) encryption and peer authentication facilities for network sockets.\n- `circuitpython_base64`: Base64 encoding and decoding for CircuitPython. Note: I have renamed the standard base64.mpy to be circuitpython_base64.mpy.\n\n### Display Libraries\n- `displayio`: For managing displays.\n- `adafruit_displayio_ssd1306`: Driver for the SSD1306 OLED display.\n- `terminalio`: Default font and text size for CircuitPython.\n- `adafruit_display_text.label`: For creating text labels on the display.\n\n### Sensor Libraries\n- `adafruit_bme680`: Library for the BME680 sensor (temperature, humidity, pressure, gas).\n- `adafruit_scd4x`: Library for the SCD4X sensor (CO2, temperature, humidity).\n- `adafruit_pm25.uart`: Library for the PM2.5 sensor using UART.\n\n### Custom Sensor Modules\n- `RadSens`: Custom module for the RadSens radiation sensor.\n\n### Syslog\n- `usyslog`: A minimal syslog client for CircuitPython.\n\n## Installation and Usage:\n\n1. **Hardware Assembly:** Connect the required sensors to the Raspberry Pi Pico W (I2C \u0026 UART).\n2. **Configuration Setup:** Adjust the `settings.toml` file to suit your needs.\n3. **Program Execution:** Upload the code to the Raspberry Pi Pico W. Check the InfluxDB server to see if data is making it there.\n\n## Monitored Parameters:\n\n- BME680: Temperature, Humidity, Air Pressure, Gas Resistance\n- SCD4X: CO2 Levels, Temperature, Humidity\n- RadSens: Radiation Intensity, Pulse Count\n- PM2.5 Sensor: Particulate Matter Concentration\n\n## Configuration Overview\n\nEnviroSnoop's behavior and sensor integration can be customized via the `settings.toml` file. Below is an overview of the configuration parameters:\n\n### WiFi Configuration\n- `SSID`: WiFi network SSID.\n- `PSK`: Password for the WiFi network.\n\n### SSL/TLS Configuration\n- `SSL_VERIFY_HOSTNAME`: Set to \"TRUE\" to verify the SSL/TLS hostname.\n\n### Location Configuration\n- `LOCATION`: Physical location of the device (e.g., \"Some-Room\").\n\n### NTP (Network Time Protocol) Configuration\n- `NTP_OFFSET`: Timezone offset from UTC (e.g., \"-8\" for Pacific Time).\n- `NTP_SYNC_INTERVAL`: Time synchronization interval (in seconds).\n\n### Sensor Enable/Disable Flags\n- `ENABLE_PM25_SENSOR`: Enable or disable the PM2.5 sensor.\n- `ENABLE_SCD4X_SENSOR`: Enable or disable the SCD4X sensor.\n- `ENABLE_RADSENS_SENSOR`: Enable or disable the RadSens sensor.\n- `ENABLE_BME680_SENSOR`: Enable or disable the BME680 sensor.\n\n### Sensor Read Intervals\n- `SCD4X_INTERVAL`, `BME680_INTERVAL`, `RADSENS_INTERVAL`, `PM25_INTERVAL`: Read intervals for each sensor (in seconds).\n\n### Display Configuration\n- `ENABLE_DISPLAY`: Enable or disable the OLED display functionality.\n- `DISPLAY_UPDATE_INTERVAL`: Interval for updating the display (in seconds).\n- `OLED_I2C_ADDR`: I2C address (in hexadecimal) for the OLED screen (default is 0x3C).\n- `OLED_CONTRAST`: OLED display contrast (brightness) with acceptable values between 0.00 and 1.00.\n\n### Sensor Calibrations\n- `SEA_LEVEL_PRESSURE`: Sea level pressure in hPa for calibrating sensors.\n- `BME680_TEMP_CALIBRATION_OFFSET`: Temperature calibration offset for the BME680 sensor.\n\n### InfluxDB Configuration\n- `INFLUXDB_URL`: IP/URL of the InfluxDB instance.\n- `INFLUXDB_ORG`: Organization name for InfluxDB.\n- `INFLUXDB_BUCKET`: Bucket name in InfluxDB.\n- `INFLUXDB_TOKEN`: Authentication token for InfluxDB.\n- `INFLUXDB_SEND_INTERVAL`: Interval for sending data to InfluxDB in seconds.\n\n### Syslog Server Configuration\n- `SYSLOG_SERVER_ENABLED`: Enable or disable syslog server logging.\n- `SYSLOG_SERVER`: IP address or hostname of the syslog server.\n- `SYSLOG_PORT`: Port number for the syslog server (note that only basic UDP syslog is supported currently).\n\n### Diagnostic Configuration\n- `MEMORY_MONITORING`: Enable or disable memory monitoring (during critical program execution points, memory usage stats are sent to syslog or the console).\n- `CONSOLE_LOG_ENABLED`: Enable or disable console logging.\n\n## InfluxDB v2 Dashboard Example\n\nThe following is an example dashboard in InfluxDB v2:\n\u003cimg src=\"assets/envirosnoop_influxdb2_dashboard_screenshot.png\" width=\"800px\" /\u003e\n\n## Logo\n\nThe logo was generated by OpenAI's DALL-E 3 using an input prompt created by myself.\n\n## License\n\nEnviroSnoop is being release under the GNU GENERAL PUBLIC LICENSE VERSION 3. Please see the LICENSE file for more information. \n\n## Disclaimer\n\nThis code is probably extremely unstable and full of bugs. Like everything else on the internet, run at your own risk.\n\n---\n\n*EnviroSnoop - Precision Environmental Analytics in Real-Time*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fageagainstthemachine%2Fenvirosnoop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fageagainstthemachine%2Fenvirosnoop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fageagainstthemachine%2Fenvirosnoop/lists"}