{"id":14963402,"url":"https://github.com/maspetsberger/rust-esp32-bme280","last_synced_at":"2026-02-05T05:32:37.142Z","repository":{"id":147098024,"uuid":"477861118","full_name":"maspetsberger/rust-esp32-bme280","owner":"maspetsberger","description":"Measuring temperature, humidity, and pressure with an BME280 on an ESP32 in Rust.","archived":false,"fork":false,"pushed_at":"2022-04-04T22:15:44.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T05:03:29.950Z","etag":null,"topics":["bme280","embedded","esp32","esp32c3","humidity-sensor","i2c","i2c-sensors","pressure-sensor","rust-lang","temperature-sensor"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/maspetsberger.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":"2022-04-04T20:23:37.000Z","updated_at":"2024-04-19T13:32:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b400b69-68ac-4306-9c5c-8a32baa9a8ac","html_url":"https://github.com/maspetsberger/rust-esp32-bme280","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"1f8d7179a4c4e06175ecd6bf22b6fc5ce796f6df"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maspetsberger/rust-esp32-bme280","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maspetsberger%2Frust-esp32-bme280","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maspetsberger%2Frust-esp32-bme280/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maspetsberger%2Frust-esp32-bme280/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maspetsberger%2Frust-esp32-bme280/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maspetsberger","download_url":"https://codeload.github.com/maspetsberger/rust-esp32-bme280/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maspetsberger%2Frust-esp32-bme280/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29113627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"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":["bme280","embedded","esp32","esp32c3","humidity-sensor","i2c","i2c-sensors","pressure-sensor","rust-lang","temperature-sensor"],"created_at":"2024-09-24T13:31:27.423Z","updated_at":"2026-02-05T05:32:37.128Z","avatar_url":"https://github.com/maspetsberger.png","language":"Rust","readme":"# Rust on ESP32 with BME280 sensor\n\nThis repository holds a minimal example for reading the BME280 sensor on an ESP32 using Rust instead of the C++/Arduino.\n\n## Components used in this example\n\n* [Waveshare ESP32-C3](https://www.waveshare.com/wiki/ESP-C3-32S-Kit)\n* Bosch BME280 sensor on a breakout-board (can't remember which one exactly)\n\nUnlike the other ESP32 chips, which are built on the Xtensa architecture, the ESP32-C3 is using a RISC-V instruction set. Therefore, the latest Rust nightly chain on llvm can build binaries directly for the ESP32-C3. The specific Waveshare chip listed above does have only 2MB flash, so it does need some customization here and there.\n\nI am not sure what the default I2C pins are on the board I used, so I ended up to manually configure GPIO 8 and 9 for SDA and SCL respectively. According to the docu you could use any GPIO for this. The BME's VIN and GND is connected to the board's `3V3` and `GND` respectively.\n\n## How to build\n\nThe example was derived from the [esp-idf-template](https://github.com/esp-rs/esp-idf-template), it holds general build instructions for the various ESP32 chips and how to get the rust nightly chain for RISC-V, or the Xtensa llvm fork for all others.\n\nSpecifically for ESP32-C3:\n\n1. `cargo build` (or `cargo build --release`...)\n1. `espflash ./target/risv32imc-esp-espidf/debug/rust-esp32-bme280` (or `.../release/...` or `cargo flash`)\n1. `espmonitor /dev/ttyUSB0` (or whatever usb port the board is connected to)\n\nNote, the Waveshare ESP32-C3 board only has 2MB flash on board. The 1.3.0 release of [espflash](https://github.com/esp-rs/espflash) is not yet compatible with this, but the latest master is.\n\n## Output\n\n```\n\u003e espmonitor /dev/ttyUSB0\n...\nI (290) cpu_start: Starting scheduler.\nstarting...\ncreating I2C bus...\nI (298) gpio: GPIO[8]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 \nI (308) gpio: GPIO[9]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 \ncreating BME280...\ninitializing BME280...\nstarting measurements...\nRelative Humidity = 52.61 %,   Temperature = 23.30 °C,   Pressure = 974.11 hPa\nRelative Humidity = 52.59 %,   Temperature = 23.30 °C,   Pressure = 974.11 hPa\nRelative Humidity = 52.60 %,   Temperature = 23.30 °C,   Pressure = 974.10 hPa\nRelative Humidity = 52.60 %,   Temperature = 23.30 °C,   Pressure = 974.10 hPa\n...\n```\n\n## Noteworthy\n\nI stumbled over the following issues throughout development:\n\n* `E (259) spi_flash: Detected size(2048k) smaller than the size in the binary image header(4096k). Probe failed.`\n  * Outdated version of `espflash` is used. Either use a more recent version (or master), or switch to `esptool.py`\n* `initializing BME280... Guru Meditation Error: Core  0 panic'ed (Illegal instruction). Exception was unhandled.`\n  * Double check the SDA and SCL pins, they might need to be swapped in the code.\n* `esp-idf-hal` provides several `Delay` providers, they all seem to work.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaspetsberger%2Frust-esp32-bme280","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaspetsberger%2Frust-esp32-bme280","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaspetsberger%2Frust-esp32-bme280/lists"}