Library / SDK
eclipse-mraa/mraa avatar
eclipse-mraa/mraa

Eclipse MRAA for Portable Linux GPIO and Bus Access

Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js & Java. Supports generic io platforms, as well as Intel Edison, Intel Joule, Raspberry Pi and many more.

1,409 stars616 forksCMIT

At a glance

What is it?
Eclipse MRAA is a C library for GNU/Linux platforms that exposes board I/O pins and communication buses through a structured API, with bindings for C++, Java, Python, and JavaScript. It suits developers building portable sensor and actuator applications, but its platform scope and build dependencies require early verification.
Who is it for?
Adopt Eclipse MRAA when an application must address low-level I/O across supported GNU/Linux boards and can accommodate the platform-specific setup. Do not choose it when the required board, bus, operating system, or language binding is not documented.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 69 days ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Why Eclipse MRAA Exists for Sensor and Actuator Code

Eclipse MRAA addresses a recurring problem in embedded Linux applications: the same program often needs to run on boards whose pin names, numbering, and hardware access paths differ. The README says that MRAA provides a structured API whose port names and numbering match the board in use. That abstraction is aimed at developers who need to map sensors and actuators over supported hardware without hard-coding every board's physical layout into the application.

The intended users include sensor manufacturers, application developers, and teams supporting multiple Intel, ARM, MIPS, FPGA, USB, or simulated platforms. The repository lists boards such as Raspberry Pi, Banana Pi, Beaglebone Black, Intel Edison, Intel Joule, Galileo, Radxa boards, Rock Pi 4, VisionFive, FT4222, Firmata, GrovePi, and a generic simulated board. This is a broad compatibility list, but it is not the same as a promise that every board has identical feature coverage. A project that depends on a particular bus, pin count, voltage level, or peripheral still needs board-specific verification.

MRAA is specifically about low-level I/O communication. Its topic list includes GPIO, I2C, SPI, Intel Joule, board support, and related I/O concerns. The documentation presents it as a way to control low-level communication protocols from higher-level languages and constructs. It does not describe a sensor catalog, a device driver model, or a complete application framework.

The C Core and Language Binding Architecture

MRAA's primary implementation is a C library, with the README identifying bindings for C++, Java, Python, and JavaScript. That arrangement places the hardware-facing interface in a lower-level library while allowing application code to use languages selected by the project. The repository layout supports this interpretation. It contains `src/`, `include/`, `api/`, language examples, Java and Doxygen configuration files, and directories associated with bindings.

The platform is selected at runtime, according to the README. This is the central architectural mechanism behind portability: application code can use MRAA's board-oriented interface instead of selecting a board implementation itself. The repository also includes a JSON platform feature and documentation for platform loading, which suggests that board or platform definitions can be handled through configuration rather than only compiled board-specific code. The README does not give enough detail to claim the exact lookup order, JSON schema, or fallback behavior, so those details should be checked in `docs/jsonplatform.md` and the platform source files.

The language layers are not interchangeable without checking their build status. The repository includes examples for C, C++, Java, JavaScript, Python, and platform-related code. The Docker Compose file exposes build options such as `BUILDSWIG`, `BUILDSWIGPYTHON`, `BUILDSWIGJAVA`, `BUILDSWIGNODE`, `BUILDDOC`, `BUILDTESTS`, `ENABLEEXAMPLES`, and `INSTALLTOOLS`. This indicates that the native library and its bindings can be assembled selectively, but the repository's default build settings should be treated as the source of truth for a particular deployment.

Installing MRAA on Ubuntu and Supported Package Systems

The README provides package-based installation instructions for Ubuntu Xenial and Bionic. Add the MRAA Personal Package Archive, refresh the package index, and install the runtime, development, language, Java, Node.js, and tool packages. The command below is copied from the project instructions. After it completes, the system should contain the `libmraa2`, `libmraa-dev`, `python-mraa`, `python3-mraa`, `node-mraa`, and `mraa-tools` packages named by the project.

bash
sudo add-apt-repository ppa:mraa/mraa
sudo apt-get update
sudo apt-get install libmraa2 libmraa-dev libmraa-java python-mraa python3-mraa node-mraa mraa-tools

The README says that running MRAA tools or applications on Ubuntu requires elevated permissions, for example by using `sudo`. That detail matters because access to GPIO, buses, and other low-level interfaces is commonly permission-sensitive. The instruction is explicit, but it does not explain which operations require privileges or whether a dedicated group can be used on a particular distribution.

Arch Linux users are directed to the AUR package. For current openSUSE and SLE systems, the project uses native repositories:

bash
sudo zypper install mraa mraa-devel

For ARM boards, the README provides a repository-selection sequence. It assigns `openSUSE_Tumbleweed` to the default case and selects `openSUSE_Factory_ARM` when `arch` reports `aarch64`.

bash
REPO="openSUSE_Tumbleweed"
if test "$(arch)" == "aarch64"; then
  REPO="openSUSE_Factory_ARM"
fi
sudo zypper ar http://download.opensuse.org/repositories/hardware/$REPO/hardware.repo
sudo zypper in mraa

For distributions without official binaries, the project directs developers to compile from source using `docs/building.md`. That is an important distinction. Ubuntu and named openSUSE or SLE targets have documented package paths, while other Linux distributions require source preparation and dependency discovery.

A First MRAA Application Through Repository Examples

The README does not include a complete device-access program or a command for detecting the current board. It points developers to the `examples/` directory and its language-specific subdirectories. That makes the repository examples the appropriate first real use, rather than an invented API call or a guessed command.

Start by confirming that the package installation completed and that the chosen language package is present. Then open the relevant example directory: `examples/c/`, `examples/c++/`, `examples/java/`, `examples/javascript/`, or `examples/python/`. The repository's `examples/CMakeLists.txt` indicates that examples are integrated into the CMake project. The exact first invocation is not given in the README, so build and execution commands must come from the selected example and `docs/building.md`.

For a real hardware use, the sequence should remain tied to MRAA's documented design: initialize the platform, request the board or interface, open the required I/O resource, perform the operation, and close it. The README confirms the concepts of board detection, I/O pins, buses, and low-level communication, but it does not provide the function signatures in the visible instructions. Consult `include/`, `api/`, and the selected example before adding device code.

The generic simulated board is especially useful for a first exercise because it appears in the supported platform list. It does not prove behavior on a physical Raspberry Pi, Intel Joule, or other board, however. It can only validate code paths that the simulation supports. The README does not document which pins or buses the mock board emulates, so that boundary needs confirmation in `docs/mock.md`.

Where MRAA's Portability Claims Meet Platform Limits

MRAA's strongest premise is portability across supported platforms, but portability does not remove hardware constraints. The README describes runtime board detection and a common interface, yet it does not claim that all boards expose the same buses or peripheral capabilities. The supported-board list is broad, while bus availability depends on the board, kernel, device tree, firmware, and system configuration. Those dependencies are not fully described in the README, so they should be verified against the relevant board document under `docs/`.

Another limitation is the documentation state. The README labels its API documentation section `UNDER CONSTRUCTION` and says that the linked documentation does not work while the project re-hosts its documentation. It directs developers to the Markdown files under `docs/` instead. That is workable for a developer willing to read source documentation, but it increases the cost of understanding binding-specific APIs and platform behavior.

The debugging instructions also state that the project has a debugging page and invite users to file GitHub issues or contact the `#mraa` IRC channel on freenode. The same paragraph warns that contributors are not necessarily present at all times. This is not evidence of response guarantees, and the README does not document a support SLA. For production adoption, the relevant limitation is therefore procedural as well as technical: source inspection and board-specific validation may be necessary when official API links are unavailable.

Finally, the README does not document rollback procedures, a release artifact policy, or a GitHub Releases page. The repository has no recent GitHub releases according to the repository facts. Package installation is documented for selected distributions, but upgrade behavior and artifact retention are not.

MRAA Compared with Direct Linux Interfaces

The practical alternative is to access GPIO, I2C, and SPI through board-specific Linux interfaces directly. A C application can use the kernel's user-space interfaces and board documentation, while Python, Node.js, or Java applications can call native libraries or operating-system tools for the particular board. This approach avoids adding MRAA's platform abstraction, but it places board detection, pin mapping, device permissions, and bus handling in the application or its own platform layer.

MRAA takes a different approach by centralizing supported-board knowledge behind a structured API and providing language bindings. That is useful when one application is expected to move among multiple supported boards. The cost is an additional abstraction and a dependency on MRAA's platform definitions, bindings, and board support files. A direct Linux interface can be a better fit for a single known board when the application already has accurate pin mappings and does not need cross-platform portability.

MRAA is also not the same as a high-level robotics framework. It exposes low-level communication primitives; it does not replace sensor drivers, timing policy, calibration, device control logic, or application-level error handling. Those concerns remain with the project using MRAA.

Maintenance, License, and Upgrade Boundaries for MRAA

The repository is not archived, and its last push was on 2026-08-15. The repository facts do not include GitHub releases, so the README's package instructions should not be read as a release schedule. Upgrade cost therefore depends on the distribution package, the local board configuration, and the language bindings enabled during the build.

The project uses the MIT license. That permits use and modification under the license's conditions, but this review does not provide legal advice. The repository also contains `LICENSE.md`, `NOTICE.md`, and `SECURITY.md`, which are the relevant files to inspect for exact obligations, notices, and security-reporting information.

The Docker Compose file provides a build-oriented environment. Its `minimal` service runs CMake, `make`, and `ctest -R unit --output-on-failure`, while its `all` service uses a different image and the `doc` service enables documentation and all listed SWIG bindings. These commands show that tests and optional bindings are build concerns, not evidence that a particular physical board is supported. The visible file excerpt is truncated, so it should be read directly before relying on the complete service definitions.

The maintenance picture is factual but limited. There is a recent push, no archive marker, and no recent GitHub releases. For an embedded deployment, verify the package source, binding version, board documentation, and test configuration before upgrading an existing installation.

Editorial conclusion

Adopt Eclipse MRAA when an application must address low-level I/O across supported GNU/Linux boards and can accommodate the platform-specific setup. Do not choose it when the required board, bus, operating system, or language binding is not documented. Verify board support, package availability, permissions, and the matching build documentation before writing production device code.

Frequently asked questions

What platforms does Eclipse MRAA support?

The README lists supported boards across x86, ARM, MIPS, FPGA, USB, I2C, and a generic simulated board. Examples include Raspberry Pi, Intel Edison, Intel Joule, Beaglebone Black, Radxa boards, VisionFive, FT4222, and Firmata. Availability of a particular bus or feature still depends on the specific platform.

How do I install Eclipse MRAA on Ubuntu?

The README provides a PPA-based installation for Ubuntu Xenial and Bionic. It instructs users to add the PPA, update the package index, and install `libmraa2`, `libmraa-dev`, `libmraa-java`, `python-mraa`, `python3-mraa`, `node-mraa`, and `mraa-tools`. The README also says that running MRAA tools or applications requires elevated permissions.

Does Eclipse MRAA have bindings for Python and Node.js?

Yes. The README identifies bindings for C++, Java, Python, and JavaScript. The repository contains examples for these languages, and the Docker Compose configuration exposes build options including `BUILDSWIGPYTHON` and `BUILDSWIGNODE`. Whether a binding is included in a particular installation depends on the selected package or build configuration.

Official sources

  1. eclipse-mraa/mraa on GitHub
  2. Issues
  3. License: MIT
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/eclipse-mraa-mraa.svg)](https://hysenlabs.com/projects/eclipse-mraa-mraa)