Skip to content

Gpiod v2 migration#23

Open
aldrineeinsteen wants to merge 6 commits intoradxa:masterfrom
aldrineeinsteen:gpiod-v2-migration
Open

Gpiod v2 migration#23
aldrineeinsteen wants to merge 6 commits intoradxa:masterfrom
aldrineeinsteen:gpiod-v2-migration

Conversation

@aldrineeinsteen
Copy link

See GPIOD_V2_MIGRATION.md for details

- Updated fan.py: Migrated Gpio class to use GPIOD v2 API
  - Replaced gpiod.Chip().get_line() with gpiod.request_lines()
  - Updated line request to use LineSettings with Direction and Value enums
  - Changed set_value() calls to use line offset and Value.ACTIVE/INACTIVE

- Updated misc.py: Migrated read_key function to use GPIOD v2 API
  - Replaced gpiod.Chip().get_line() with gpiod.request_lines()
  - Updated button GPIO configuration for v2 API
  - Changed get_value() to use line offset parameter

- Updated DEBIAN/control:
  - Bumped version from 0.2 to 0.3
  - Added minimum version requirement for python3-libgpiod (>= 2.0)
  - Updated description to indicate GPIOD v2 support

- Added GPIOD_V2_MIGRATION.md with comprehensive migration notes
  - Documented all API changes
  - Included testing requirements
  - Added rollback instructions and benefits of v2
- Fix TypeError: get_value() returns Value enum, not int
  Convert Value.ACTIVE to 1 and Value.INACTIVE to 0 properly

- Fix button GPIO direction: INPUT instead of OUTPUT
  Buttons should be read (INPUT), not written to (OUTPUT)
  Added PULL_UP bias for proper button reading

This fixes the runtime error:
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'Value'
- Updated GitHub Actions workflow to extract version from DEBIAN/control
- Added build-deb.sh for local DEB package building
- Added install.sh for automated installation
- Added BUILD_DEB.md and RELEASE_GUIDE.md documentation
- All version references now dynamic (no hardcoding)
- Workflow automatically attaches DEB to GitHub releases
- Add comprehensive comments to all env files (7 boards)
- Convert chip numbers to /dev/gpiochipX paths for GPIOD v2
- Add safe default for HARDWARE_PWM environment variable
- Update documentation with env file examples
- Organize env files with clear sections

Fixes: FileNotFoundError with GPIOD v2
Improves: User understanding of hardware configuration
Version: 0.3 -> 0.4

Changes:
- Add comprehensive comments to all env files (7 boards)
- Convert chip numbers to /dev/gpiochipX paths for GPIOD v2
- Add safe default for HARDWARE_PWM environment variable
- Update documentation with env file examples
- Organize env files with clear sections (OLED, Button, Fan, PWM)

Fixes:
- FileNotFoundError when GPIOD v2 tries to open GPIO chips
- Missing HARDWARE_PWM causing KeyError
- Improves user understanding of hardware configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant