fix(aio): hold V2 enable GPIOs via systemd service (config.txt gpio= is not enough) - #6
Merged
Merged
Conversation
…is not enough) On real hardware the AIO V2 RTL-SDR enumerates at boot then USB-disconnects ~8s in: the firmware config.txt `gpio=...=op,dh` directive is released once the kernel GPIO subsystem initialises, powering the GPS/LoRa/SDR/internal-USB rails back off. Re-assert and HOLD them from userspace. - customize.sh (v2 only): install libgpiod and a uconsole-aio-gpio.service that runs `gpioset` holding BCM 7/16/23/27 high (libgpiod v2 keeps the lines while the process lives); enable it. Lives under /etc, so it survives on-device kernel updates. - build.sh: clarify the appended config.txt gpio= comment (early power only; the service does the persistent hold). - Docs (README/MAINTAINING, EN+JA): document the v2 GPIO-hold service, that it survives updates (only the config.txt overlays get reset), and that the RTL-SDR needs `rtl-sdr`/librtlsdr (SDR++'s rtl_sdr_source plugin dlopens it; also provides rtl_test + the udev uaccess rule). Verified on the uConsole (CM4, Arch, kernel 6.12.94-v8+): after installing rtl-sdr and enabling the service, `rtl_test -t` detects "HackerGadgets, AIO_V2 Ext" (RTL2832U + R820T) and the device node gets a uaccess ACL. Co-Authored-By: Claude Opus 4.8 <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
PR #5 で入れた AIO V2 対応は config.txt の
gpio=7,16,23,27=op,dhだけで電源イネーブルを賄っていましたが、実機検証で不十分と判明しました。実機(uConsole CM4 / Arch / kernel 6.12.94-v8+)の dmesg:
firmware の
gpio=…=op,dhはカーネルの GPIO サブシステム初期化時に解除されるため、GPS/LoRa/SDR/内部USB のラインがオフに戻ります(ベンダ手順が userspace のpinctrl … op/dhを使う理由)。修正 / Fix
scripts/customize.sh(v2 のみ):libgpiodを導入し、gpiosetで BCM 7/16/23/27 を high 保持するuconsole-aio-gpio.serviceを作成・enable。libgpiod v2 のgpiosetはプロセス生存中ラインを保持するため、フォアグラウンドType=simple+Restart=alwaysで常時保持。/etc配下なので実機のカーネル更新後も残存します。build.sh: 追記する config.txt のgpio=コメントを「早期電源のみ・永続保持はサービス側」と明確化。rtl-sdr/librtlsdr が必要(SDR++ のrtl_sdr_sourceプラグインが dlopen、rtl_test・udev uaccess も提供)を追記。検証 / Verification
実機で本サービス+
rtl-sdr導入後:uconsole-aio-gpio.service= enabled/active、gpiosetがラインを保持user:fabio:rw-(udev uaccess)ACL 付与を確認bash -n build.sh scripts/*.shOKRTC(
/dev/rtc0)・LoRa(/dev/spidev1.0) も動作。実機で確認済み。🤖 Generated with Claude Code