{"id":33933114,"url":"https://github.com/pixix4/ev3dev-lang-rust","last_synced_at":"2026-04-04T12:58:04.090Z","repository":{"id":45469710,"uuid":"136737530","full_name":"pixix4/ev3dev-lang-rust","owner":"pixix4","description":"Rust language bindings for http://ev3dev.org","archived":false,"fork":false,"pushed_at":"2026-03-02T17:22:38.000Z","size":230,"stargazers_count":86,"open_issues_count":6,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-03-02T20:50:03.423Z","etag":null,"topics":["ev3","ev3dev","lego","mindstorms","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixix4.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-06-09T15:59:32.000Z","updated_at":"2026-03-02T17:20:47.000Z","dependencies_parsed_at":"2024-12-27T12:27:58.507Z","dependency_job_id":null,"html_url":"https://github.com/pixix4/ev3dev-lang-rust","commit_stats":{"total_commits":69,"total_committers":9,"mean_commits":7.666666666666667,"dds":0.3913043478260869,"last_synced_commit":"913aee5b1425a6af4081c088c025473e05275ed4"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/pixix4/ev3dev-lang-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixix4%2Fev3dev-lang-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixix4%2Fev3dev-lang-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixix4%2Fev3dev-lang-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixix4%2Fev3dev-lang-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixix4","download_url":"https://codeload.github.com/pixix4/ev3dev-lang-rust/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixix4%2Fev3dev-lang-rust/sbom","scorecard":{"id":735995,"data":{"date":"2025-08-18","repo":{"name":"github.com/pixix4/ev3dev-lang-rust","commit":"7cb3080f4bc452f2cedf2d55b944d3c7c685c40f"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3.6,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/23 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":1,"reason":"1 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/pixix4/ev3dev-lang-rust/build.yml/master?enable=pin","Warn: containerImage not pinned by hash: docker/Dockerfile:1: pin your Docker image by updating debian:12-slim to debian:12-slim@sha256:b1a741487078b369e78119849663d7f1a5341ef2768798f7b7406c4240f86aef","Warn: downloadThenRun not pinned by hash: docker/Dockerfile:11","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T15:51:09.956Z","repository_id":45469710,"created_at":"2025-08-22T15:51:09.956Z","updated_at":"2025-08-22T15:51:09.956Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31400460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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":["ev3","ev3dev","lego","mindstorms","rust"],"created_at":"2025-12-12T13:02:33.839Z","updated_at":"2026-04-04T12:58:04.085Z","avatar_url":"https://github.com/pixix4.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust language bindings for ev3dev\n\n![Build](https://github.com/pixix4/ev3dev-lang-rust/workflows/Build/badge.svg)\n[![Latest version](https://img.shields.io/crates/v/ev3dev-lang-rust.svg)](https://crates.io/crates/ev3dev-lang-rust)\n\n## Notice\n\nTo use this project with the BrickPi platform the corresponding feature has to be enabled. The features `ev3`, `brickpi` and `brickpi3` are mutual exclusive.\n```toml\n[dependencies]\nev3dev_lang_rust = { version=\"0.13.0\" default-features=false, features=[\"brickpi\"] }\n```\n\n## Usage\n\n```rust\nextern crate ev3dev_lang_rust;\n\nuse ev3dev_lang_rust::Ev3Result;\nuse ev3dev_lang_rust::motors::{LargeMotor, MotorPort};\nuse ev3dev_lang_rust::sensors::ColorSensor;\n\nfn main() -\u003e Ev3Result\u003c()\u003e {\n\n    // Get large motor on port outA.\n    let large_motor = LargeMotor::get(MotorPort::OutA)?;\n\n    // Set command \"run-direct\".\n    large_motor.run_direct()?;\n\n    // Run motor.\n    large_motor.set_duty_cycle_sp(50)?;\n\n    // Find color sensor. Always returns the first recognized one.\n    let color_sensor = ColorSensor::find()?;\n\n    // Switch to rgb mode.\n    color_sensor.set_mode_rgb_raw()?;\n\n    // Get current rgb color tuple.\n    println!(\"Current rgb color: {:?}\", color_sensor.get_rgb()?);\n\n    Ok(())\n}\n```\n\nThere is a [template repository](https://github.com/pixix4/ev3dev-lang-rust-template/) that contains all the required configurations for cross-compilation and performance/binary-size optimizations for this \"Hello World\" example.\n\n## Supported features\n\n- Motors:\n  - `LargeMotor` [`lego-ev3-l-motor`, `lego-nxt-motor`]\n  - `MediumMotor` [`lego-ev3-m-motor`]\n  - `TachoMotor`: Useful wrapper around `LargeMotor` and `MediumMotor` to make common functions easier to use\n- Sensors:\n  - `ColorSensor` [`lego-ev3-color`]\n  - `CompassSensor` [`ht-nxt-compass`]\n  - `GyroSensor` [`lego-ev3-gyro`]\n  - `InfraredSensor` [`lego-ev3-ir`]\n  - `IrSeekerSensor` [`ht-nxt-ir-seek-v2`]\n  - `LightSensor` [`lego-nxt-light`]\n  - `TouchSensor` [`lego-ev3-touch`, `lego-nxt-touch`]\n  - `UltrasonicSensor` [`lego-ev3-us`, `lego-nxt-us`]\n- Utility\n  - `Button`: Provides access to the integrated buttons on the ev3 brick\n  - `Led`: Provides access to the integrated led's on the ev3 brick\n  - `PowerSupply`: Provides access to the power supply information\n  - `Screen`: Provides access to the integrated display of the ev3 brick\n  - `sound`: Provides access to the integrated speakers of the ev3 brick\n\n## Cross compilation for the ev3 robot - using `musl` toolchain\n\n1. Install the `armv5te-musl` toolchain\n\n   ```bash\n   rustup target add armv5te-unknown-linux-musleabi\n   ```\n\n2. Create `.cargo/config.toml` with the following content\n\n   ```toml\n   [build]\n   target = \"armv5te-unknown-linux-musleabi\"\n\n   [target.armv5te-unknown-linux-musleabi]\n   linker = \"rust-lld\"\n   ```\n\n3. Build binary\n\n   ```bash\n   cargo build --release\n   ```\n\n   The `--release` flag is optional. However, it can speed up the execution time by a factor of 30.\n   The target binary is now in `target/armv5te-unknown-linux-musleabi/release/{application_name}`.\n\n## Cross compilation for the ev3 robot - using docker\n\nIf you need to cross compile other dependencies (eg. `openssl` or `paho-mqtt`) it is much easier to use a complete cross compile toolchain. For this you can use the provided docker image `pixix4/ev3dev-rust:latest`.\n\n1. Setup a docker environment\n\n2. Create `.cargo/config.toml` with the following content\n\n   ```toml\n   [build]\n   target = \"armv5te-unknown-linux-gnueabi\"\n\n   [target.armv5te-unknown-linux-gnueabi]\n   linker = \"/usr/bin/arm-linux-gnueabi-gcc\"\n   ```\n\n3. Build binary\n\n   ```bash\n   docker run --rm -it -v $(pwd):/build -w /build pixix4/ev3dev-rust:latest \\\n      cargo build --release\n   ```\n\n   The `--release` flag is optional. However, it can speed up the execution time by a factor of 30.\n   The target binary is now in `target/armv5te-unknown-linux-gnueabi/release/{application_name}`.\n\n   If you do this you will notice that each build gets stuck at `Updating crates.io index` for a long time. To speed up this step you can use the vendoring mechanic of cargo.\n\n   ```bash\n   cargo vendor\n   ```\n\n   Execute the above command and add this additional config to `.cargo/config`.\n\n   ```toml\n   [source.crates-io]\n   replace-with = \"vendored-sources\"\n\n   [source.vendored-sources]\n   directory = \"vendor\"\n   ```\n\n## Optimize binary size\n\n- Enable \"fat\" link time optimizations and strip debug symbols:\n  By default rust only performs lto for each crate individually. To enable global lto (which result in a much more aggressive dead code elimination) add the following additional config to your `Cargo.toml`. This also removes additional debug symbols from the binary. With this you can reduce the binary size of the \"Hello World\" example by more than 90%.\n\n  ```toml\n  [profile.release]\n  lto = true\n  strip = \"debuginfo\"\n  ```\n\n  The strip option requires rust `1.59.0`. If you are using an older version you can do this manually with docker:\n\n  ```bash\n  # Run in interactive docker shell\n  docker run -it --rm -v $(PWD):/build/ -w /build pixix4/ev3dev-rust\n  /usr/bin/arm-linux-gnueabi-strip /build/target/armv5te-unknown-linux-gnueabi/release/{application_name}\n\n  # Run directly (e.g. via Makefile)\n  docker run --rm -v $(PWD):/build/ -w /build pixix4/ev3dev-rust \\\n       /usr/bin/arm-linux-gnueabi-strip /build/target/armv5te-unknown-linux-gnueabi/release/{application_name}\n  ```\n\n## Editor support\n\nIf you have problems with code completion or inline documentation with rust analyzer it may help to enable to following settings:\n\n```json\n{\n  \"rust-analyzer.cargo.loadOutDirsFromCheck\": true,\n  \"rust-analyzer.procMacro.enable\": true\n}\n```\n\n(Example from VSCode `settings.json`)\n\n## Docs.rs documentation\n\nTo build the complete documentation (including the `screen` feature) use:\n\n```bash\nRUSTDOCFLAGS=\"--cfg docsrs\" cargo +nightly doc --features ev3,screen\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixix4%2Fev3dev-lang-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixix4%2Fev3dev-lang-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixix4%2Fev3dev-lang-rust/lists"}