GPIO (General Purpose Input/Output)
Integrates GPIO (General Purpose Input/Output) ports into OpenEMS for digital input and output control on ARM-based single-board computers using Linux filesystem communication.
Overview
This bundle provides integration for GPIO (General Purpose Input/Output) ports available on ARM-based computing platforms. The component communicates with GPIO ports via Linux filesystem interfaces (/sys/class/gpio), enabling digital input and output control for automation and IoT applications.
The GPIO integration supports multiple hardware platforms, with primary focus on ModBerry X500 CM4 models based on the Raspberry Pi Compute Module 4. The component provides dynamic GPIO pin discovery and management, with configurable input and output channels for flexible system integration.
All GPIO operations are performed through the Linux kernel GPIO subsystem, providing reliable and standardized access to GPIO pins across compatible hardware platforms.
Supported Devices
-
ModBerry X500 CM4 Max - Compute Module 4 industrial platform - IO GPIO
-
ModBerry X500 CM4 WB - Compute Module 4 with WiFi/Bluetooth - IO GPIO
-
ModBerry X500 CM4S - Compact Compute Module 4 variant - IO GPIO
-
ModBerry X500 CM4S-F - Compact Compute Module 4 fanless variant - IO GPIO
-
ModBerry X500 CM3 - Compute Module 3 legacy support - IO GPIO
Components
This bundle implements the following OpenEMS Component:
IO GPIO
Name: IO GPIO
Factory-PID: io.openems.edge.io.gpio
-
DigitalInput
-
DigitalOutput
-
OpenemsComponent
-
id(String): Component ID for unique identification (default: "io0") -
alias(String): Human-readable alias for the component -
enabled(Boolean): Enable/disable this component (default: true) -
gpioPath(String): Path to the GPIOs on the Linux filesystem (default: "/sys/class") -
hardwareType(HardwareType): The hardware platform type (required) - Supported values: MODBERRY_X500_M40804_MAX, MODBERRY_X500_M40804_WB, MODBERRY_X500_M4S, MODBERRY_X500_M4S_F, MODBERRY_X500_M3
Hardware Platform Information
ModBerry X500 CM4 Models
The module supports all ModBerry X500 CM4 models. Each variant provides different features and form factors:
-
M40804 Max: Full-sized Compute Module 4 with maximum GPIO availability
-
M40804 WB: Compute Module 4 with integrated WiFi and Bluetooth connectivity
-
M4S: Compact form factor variant of Compute Module 4
-
M4S-F: Fanless compact variant for passive cooling environments
-
M3: Legacy support for Compute Module 3 (older generation)
Pin-out descriptions and GPIO mappings are available in the ModBerry documentation: ModBerry X500 CM4 Datasheet
Prerequisites / Dependencies
System Requirements
-
Linux-based operating system with GPIO support (kernel 4.8 or later)
-
Proper GPIO kernel module loaded (
gpio-bcm2835on Raspberry Pi) -
File system access to
/sys/class/gpiodirectory (typically requires root or GPIO group permissions) -
ARM-based processor (Raspberry Pi Compute Module 3 or 4)
Hardware Setup
-
Ensure the GPIO kernel module is loaded:
lsmod | grep gpio -
Verify GPIO filesystem is accessible:
ls /sys/class/gpio -
Configure appropriate user permissions for GPIO access:
-
Option 1: Run OpenEMS as root user
-
Option 2: Add OpenEMS user to
gpiogroup:usermod -a -G gpio openems -
Option 3: Configure
udevrules for GPIO device access
-
-
Identify the correct hardware type from your ModBerry platform documentation
-
Connect GPIO devices (LEDs, switches, sensors, etc.) to appropriate GPIO pins