Skip to content

gk7202v300_lite_xm-rm1: support the RTL8188EUS variant, fix pan/tilt order - #207

Open
brunoamui wants to merge 1 commit into
OpenIPC:masterfrom
brunoamui:xm-rm1-rtl8188eus
Open

brunoamui wants to merge 1 commit into
OpenIPC:masterfrom
brunoamui:xm-rm1-rtl8188eus

Conversation

@brunoamui

@brunoamui brunoamui commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #205.

RTL8188EUS variant. A second IPC-RM1-BLK7202V3-M43A-WIFI board came with a Realtek RTL8188EUS (0bda:8179) instead of the iComm SV6115C. The profile now builds both ssv6x5x and rtl8188eus-openipc; wlandev gk7202v300-xm-rm1 loads the driver that matches the enumerated USB vendor (8065 → ssv6x5x, 0bda → 8188eu).

Space. To make room for the second driver (8188eu.ko is ~350 KB compressed), mac80211, mt7601u and tun are excluded as well: neither Wi-Fi driver uses mac80211 and the board has no VPN packages. Rootfs is 4956 KB of 5120 KB.

Pan/tilt. The pan and tilt GPIO groups were swapped and both axes turned the wrong way. ptz_gpio is now 52 53 54 55 12 14 15 13 (pan first), checked on hardware for axis and direction.

Tested on the RTL8188EUS board: after a reboot the image autoloads 8188eu and joins WPA2; majestic streams; pan and tilt move the correct way from the web UI. IR and audio still untested.

🤖 Generated with Claude Code

…order

The same board ships with either an iComm SV6115C or a Realtek RTL8188EUS
(0bda:8179) USB Wi-Fi module. Build both drivers and pick one at boot from
the enumerated USB vendor (wlandev gk7202v300-xm-rm1).

To make room for the second driver, also exclude mac80211/mt7601u/tun:
neither Wi-Fi driver uses mac80211 and the board has no VPN packages.

Pan and tilt GPIO groups were swapped and both turned the wrong way;
ptz_gpio is now verified on hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Support RTL8188EUS RM1 boards and correct pan/tilt GPIOs

✨ Enhancement 🐞 Bug fix ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Support both RM1 Wi-Fi variants by selecting their driver from the enumerated USB vendor.
• Exclude unused kernel modules to fit both drivers in the firmware image.
• Correct pan/tilt axis and direction mapping using hardware-verified GPIO order.
Diagram

graph TD
  B["Build profile"] --> C["Board customizer"] --> S["USB selector"] --> V{"USB vendor"} --> I["ssv6x5x"]
  V --> R["8188eu"]
  C --> P["PTZ GPIO"]
  B --> I
  B --> R
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Rely on USB modalias autoloading
  • ➕ Could remove the board-specific vendor-selection script.
  • ➖ Would require confirming module aliases and boot integration for both drivers; it does not directly control the existing wlandev startup path.

Recommendation: Keep the board-specific selector for this change: it works with the existing wlandev configuration and preserves one firmware image for both variants. Modalias autoloading is worth considering only if it can be verified across both boards.

Files changed (5) +32 / -11

Enhancement (1) +20 / -6
usbSelect the RM1 Wi-Fi driver by USB vendor +20/-6

Select the RM1 Wi-Fi driver by USB vendor

• Polls USB vendor IDs for up to five seconds, then loads ssv6x5x for 8065 or 8188eu for 0bda. Retains the ssv6x5x generic profile and adds an 8188eu generic profile.

devices/gk7202v300_lite_xm-rm1/general/overlay/etc/wireless/usb

Bug fix (1) +5 / -4
customizer.shConfigure variant-aware Wi-Fi and correct motor GPIOs +5/-4

Configure variant-aware Wi-Fi and correct motor GPIOs

• Sets wlandev to the new RM1 selector instead of the SSV-only profile. Reorders the pan and tilt GPIO groups and coil phases to correct their axes and directions.

devices/gk7202v300_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh

Documentation (1) +1 / -1
README.mdDocument both RM1 Wi-Fi variants and verified pan/tilt +1/-1

Document both RM1 Wi-Fi variants and verified pan/tilt

• Lists SV6115C and RTL8188EUS as supported Wi-Fi hardware and marks pan/tilt as tested. IR and audio remain untested.

README.md

Other (2) +6 / -0
gk7202v300_lite_xm-rm1_defconfigInclude the RTL8188EUS driver in the RM1 build +1/-0

Include the RTL8188EUS driver in the RM1 build

• Enables the RTL8188EUS OpenIPC package alongside the existing SSV635X package so one image supports either board variant.

devices/gk7202v300_lite_xm-rm1/br-ext-chip-goke/configs/gk7202v300_lite_xm-rm1_defconfig

gk7202v300_lite.listRemove unused modules to make room for both Wi-Fi drivers +5/-0

Remove unused modules to make room for both Wi-Fi drivers

• Excludes mt7601u, mac80211, and tun kernel modules from the RM1 lite image to reduce its size.

devices/gk7202v300_lite_xm-rm1/general/scripts/excludes/gk7202v300_lite.list

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Upgrades leave pan and tilt reversed 🐞 Bug ≡ Correctness
Description
customizer.sh writes the corrected ptz_gpio value with fw_setenv, but the customizer does not
rerun when an existing installation upgrades. Those cameras retain the previous mapping in their
preserved bootloader environment, so the direction fix reaches fresh installations but not ordinary
upgrades.
Code

devices/gk7202v300_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh[24]

+fw_setenv ptz_gpio '52 53 54 55 12 14 15 13'
Evidence
The changed mapping is written to the bootloader environment by the customizer, while the release
workflow explicitly states that upgrades keep that environment and the customizer runs once. No
other board-specific ptz_gpio assignment appears in the repository.

devices/gk7202v300_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh[20-25]
.github/workflows/master.yml[687-696]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Existing installations preserve the old `ptz_gpio` environment value during upgrades, so changing the first-boot customizer alone does not correct their pan/tilt direction.

## Fix Focus Areas
- devices/gk7202v300_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh[20-25]

## Recommended Fix
Add an upgrade-time or boot-time migration that replaces the previous `ptz_gpio` value with the corrected value. Match the old value before changing it so user-customized mappings remain intact.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: Auto: ⚖️ Balanced: Runtime driver selection, module exclusions, and hardware GPIO behavior carry meaningful risk.

Grey Divider

Tip of the day
💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

#
fw_setenv ptz_control gpio
fw_setenv ptz_gpio '13 15 14 12 55 54 53 52'
fw_setenv ptz_gpio '52 53 54 55 12 14 15 13'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

1. Upgrades leave pan and tilt reversed 🐞 Bug ≡ Correctness

customizer.sh writes the corrected ptz_gpio value with fw_setenv, but the customizer does not
rerun when an existing installation upgrades. Those cameras retain the previous mapping in their
preserved bootloader environment, so the direction fix reaches fresh installations but not ordinary
upgrades.
Agent Prompt
## Issue description
Existing installations preserve the old `ptz_gpio` environment value during upgrades, so changing the first-boot customizer alone does not correct their pan/tilt direction.

## Fix Focus Areas
- devices/gk7202v300_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh[20-25]

## Recommended Fix
Add an upgrade-time or boot-time migration that replaces the previous `ptz_gpio` value with the corrected value. Match the old value before changing it so user-customized mappings remain intact.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

This branch has not been deployed

No deployments
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