Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • L linux-gpio-java
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Departamento de Informática
  • Research
  • TaRDISTaRDIS
  • WP6WP6
  • external
  • linux-gpio-java
  • Wiki
  • Usage

Usage · Changes

Page history
jc.leitao updated page: Usage authored Jun 02, 2026 by Joao Leitao's avatar Joao Leitao
Hide whitespace changes
Inline Side-by-side
Usage.md
View page @ 1f78cd97
# Usage — Linux-GPIO
## Usage
## Requirements
Any accessed GPIO device need at least read permission (which is enough even
for writing). Typically, only the root user has access, hence permissions need
to be set. For instance, for device 0 on a Raspberry Pi (user `pi`) :
- Java 11 or later (Java 17 recommended for swarm/IoT variants)
- Apache Maven 3.6+
- Network access to the NOVA SYS Maven repository (if using pre-built artifacts)
```bash
$ chown root:pi /dev/gpiochip0
$ chmod g+r /dev/gpiochip0
```
## Installation
The [javadoc](https://javadoc.io/doc/io.helins/linux-gpio) provide all details.
_See the project README and pom.xml for build instructions._
Have a look at the [examples](../tree/masterexamples).
## Configuration
Run an example where `$EXAMPLE` is the name of an example such as
`AlternatingLeds` :
```bash
$ ./gradlew :examples:$EXAMPLE:run
_This project has no configuration parameters._
See the [Configuration](configuration) page for a complete parameter reference.
## Integration Example
```java
Properties props = new Properties();
try (InputStream in = new FileInputStream("config.properties")) {
props.load(in);
}
Host myself = new Host(InetAddress.getLocalHost(), Integer.parseInt(props.getProperty("port", "8000")));
Babel babel = Babel.getInstance();
babel.registerProtocol(new LinuxGPIO(props, myself));
babel.start(props);
```
Run tests :
## Running
```bash
$ ./gradlew test
# Build
mvn clean package -DskipTests
# Run (adjust main class and config path)
java -cp target/*.jar MainClass config.properties
```
Run tests on the Raspberry Pi 3 (or similar), will test some IO :
```bash
$ ./gradlew test -DonRaspberry=true
```
\ No newline at end of file
## Further Reading
- [Babel Interface](babel-interface) — how to subscribe to this protocol's notifications
- [Configuration](configuration) — full parameter reference
---
## License
This project is licensed under the [MIT License](LICENSE) — see the `LICENSE` file
in the repository for the full text.
Copyright © 2021–2026 [Computer Systems Group, NOVA LINCS](https://novasys.di.fct.unl.pt/)
at [FCT-UNL](https://www.fct.unl.pt/).
Developed in the context of the [TaRDIS](https://project-tardis.eu/) European Project
(EU Horizon 2020, Grant Agreement No. 101016175).
Also see: [NOVA LINCS](https://nova-lincs.di.fct.unl.pt/) |
[TaRDIS on CORDIS](https://cordis.europa.eu/project/id/101016175)
Clone repository
  • Babel Interface
  • Configuration
  • Home
  • Usage