Repository navigation
Find the GPIO chip by label so kernel renumbering cannot break activation - #8
Open
cavers-travers wants to merge 4 commits into
Open
cavers-travers wants to merge 4 commits into
cavers-travers wants to merge 4 commits into
Conversation
…tion On a current Raspberry Pi 5 Bookworm kernel the 40-pin header is /dev/gpiochip15 [pinctrl-rp1]; neither /dev/gpiochip4 from rpi5.json nor /dev/gpiochip0 exists, so mandeye-activate stops with "missing character device" (reproduced on real hardware: RPi 5, 2x Mid-360, fake_pps). device.json "gpiochip" now accepts a chip label as well as a device path. The controller, demos and FakePPS open it with gpiod_chip_open_lookup, and mandeye-activate resolves the label through GPIO_GET_CHIPINFO_IOCTL before its permission checks. The examples use pinctrl-rp1 (Pi 5, CM5) and pinctrl-bcm2711 (Pi 4, CM4); existing path-based configurations still work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem (found on real hardware)
Tested the field package
mandeye-multisensor-bookworm-arm64-b0ee7d1…-a1.debon:Raspberry Pi 5 8 GB, Raspberry Pi OS Bookworm 64-bit (after
apt full-upgrade, 2026-12-04), 2× Livox Mid-360 via a switch on eth0, fake_pps, standard RPi 5 wiring.sudo mandeye-activatewithrpi5.jsonstops with:gpiodetecton this kernel:There is no
/dev/gpiochip4(orgpiochip0) and no compatibility symlink. The Pi 5 header number has been 4, 0 and now 15 across kernels, but the labelpinctrl-rp1is stable. The number stayed at 15 across reboots on this unit.Change
device.json"gpiochip"accepts a chip label as well as a device path (validator:gpioChip()indevice_config.cpp).gpios.cpp) and FakePPS open the chip withgpiod_chip_open_lookup(libgpiod 1.6: path, name, number or label). Their errors now point togpiodetect.mandeye-activateresolves a label throughGPIO_GET_CHIPINFO_IOCTLbefore the permission checks, prints the resolved device, and lists available chips if the label is not found.pinctrl-rp1(rpi5, cm5-direct),pinctrl-bcm2711(rpi4, pro-cm4-bookworm).tests/package/test-device-config.pycovers labels, paths and an invalid value. One README sentence added.Testing
"gpiochip": "/dev/gpiochip15"set manually, activation succeeds. LEDs, buzzer and buttons work, both Mid-360 record, and data is saved in both modes. Once this PR's package is built, it will be retested with the unmodifiedpinctrl-rp1example.Other field observation (not in this PR)
Booting without the USB drive:
RequiresMountsFor=/media/usbmakes the controller fail withDependency failedafter ~90 s, and it does not start when the drive is inserted later. There is no LED or buzzer signal, so the scanner looks dead. It might be worth starting without the drive and signalling its absence.🤖 Generated with Claude Code