ssc377_lite: add TP-Link Tapo C120 device profile - #162
Conversation
SSC377, SmartSens SC430AI, 16 MB NOR, RTL8188FTV on USB. The generic ssc377_lite defconfig with the 16 MB layout, the rtl8188fu driver and the SAE-capable wpa_supplicant-openipc; the Wi-Fi module's power gate (GPIO 42) in the wireless/usb entry; IR-cut, backlight and IR LED pins; the SC430AI IQ file. Depends on OpenIPC/sensors#7 (driver), OpenIPC/firmware#2445 (loader entry) and OpenIPC/firmware#2449 (supplicant package).
openipc-ai
left a comment
There was a problem hiding this comment.
All three dependencies are merged: OpenIPC/sensors#7 (0294a00), OpenIPC/firmware#2445 (e155691a) and OpenIPC/firmware#2449 (4d145e6c). Taking this out of draft so it can build.
On sc430ai.bin: keep it. It is the right thing here for the reason you gave — ssc335_lite_tp-link-tapo-c310-v220 already ships sc3335.bin and sc3338.bin at the same path, and this repository's own notes describe kc110-board-support shipping a device-specific binary through SITE_METHOD = local. Per-device vendor assets are what devices/ is for; the firmware tree's binary gate is about what reaches every camera, which is exactly why keeping it out of #2445 was correct. Both halves of that were right.
The rest reads well:
- The defconfig is a three-line delta from generic
ssc377_lite— flash size, the driver, the supplicant — and nothing else, which is the shape a device profile should have. excludes/ssc377_lite.listresolves against${OPENIPC_SOC_MODEL}_${OPENIPC_VARIANT}.list, which is the namerootfs_script.shlooks for, and every one of its 16 entries matches a real file, sotest_excludes_report.shwill stay quiet.wireless/usbcallsgpioandmodprobeonly;gpiois a shell script in the shared overlay, so it is on the image. Thegpio setidiom matches five other devices here.S96irledexplains why it exists in its header — majestic has one backlight pin and this board has two LED banks — which is the comment style this tree wants.
Merging once CI is green.
PR Summary by QodoAdd TP-Link Tapo C120 profile for SSC377 Lite
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1. Wi-Fi failures are reported as success
|
| modprobe 8188fu | ||
| exit 0 |
There was a problem hiding this comment.
1. Wi-fi failures are reported as success 🐞 Bug ☼ Reliability
The wireless USB script runs modprobe 8188fu and then unconditionally returns zero instead of preserving the command's status. When the module is missing or cannot load, wireless initialization receives a successful result even though no interface was created.
Agent Prompt
## Issue description
The C120 wireless profile returns success even when `modprobe 8188fu` fails, masking a failed Wi-Fi initialization.
## Fix Focus Areas
- devices/ssc377_lite_tp-link-tapo-c120/general/overlay/etc/wireless/usb[12-13]
## Recommended Fix
Replace the `modprobe` followed by unconditional `exit 0` with `exec modprobe 8188fu`, or explicitly capture and return the command's exit status.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| stop) | ||
| [ -f $PID ] && kill "$(cat $PID)" 2>/dev/null; rm -f $PID |
There was a problem hiding this comment.
2. Stopping leaves ir illuminators on 🐞 Bug ☼ Reliability
The stop branch of S96irled kills the polling process without driving GPIOs 12 and 13 low or releasing them. If the service is stopped while night mode is active, both illuminator banks retain their last asserted output after the service has supposedly stopped.
Agent Prompt
## Issue description
Stopping the IR LED service leaves GPIOs 12 and 13 at their previous values, which can keep both illuminator banks enabled.
## Fix Focus Areas
- devices/ssc377_lite_tp-link-tapo-c120/general/overlay/etc/init.d/S96irled[7-10]
- devices/ssc377_lite_tp-link-tapo-c120/general/overlay/etc/init.d/S96irled[24-25]
## Recommended Fix
After terminating the worker, explicitly drive GPIOs 12 and 13 low and unexport the lines owned by this service so stopping establishes a safe off state.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| ) & | ||
| echo $! > $PID |
There was a problem hiding this comment.
3. Repeated starts leave hidden workers 🐞 Bug ☼ Reliability
The start branch of S96irled always launches another infinite polling subshell and overwrites the single PID file without checking for an existing worker. After multiple starts, stop terminates only the newest PID while older loops continue polling and controlling both LED GPIOs.
Agent Prompt
## Issue description
Every `start` invocation creates another infinite IR LED polling worker, but only the newest process remains addressable through the PID file.
## Fix Focus Areas
- devices/ssc377_lite_tp-link-tapo-c120/general/overlay/etc/init.d/S96irled[11-22]
- devices/ssc377_lite_tp-link-tapo-c120/general/overlay/etc/init.d/S96irled[24-25]
## Recommended Fix
Before launching, validate the PID file with `kill -0` and treat an existing live worker as already started; remove stale PID files before creating a new worker. Alternatively, move the loop into an executable managed by `start-stop-daemon` with a PID file.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Adds
devices/ssc377_lite_tp-link-tapo-c120for the TP-Link Tapo C120: SSC377, SmartSens SC430AI (4 MP), 16 MB NOR (XM25QH128C), RTL8188FTV on USB.What the device carries, and why each piece is here rather than in firmware:
ssc377_lite_tp-link-tapo-c120_defconfig— the genericssc377_litedefconfig withBR2_OPENIPC_FLASH_SIZE="16",BR2_PACKAGE_RTL8188FU_OPENIPC=y, andBR2_PACKAGE_WPA_SUPPLICANT_OPENIPC=yin place of the stock supplicant (wpa_supplicant-openipc: 2.11 with WPA3-SAE on mbedtls firmware#2449; WPA3-SAE, needed for WPA3-only networks). Kernel config is the stockinfinity6c-ssc027a.config, unchanged:cfg80211as a module is fine with8188fu.general/overlay/etc/wireless/usb— thertl8188fu-tapo-c120entry: the Wi-Fi module's power is gated by GPIO 42, so it is driven high beforemodprobe 8188fu.customizer.sh— upgrade URL,wlandev,sensor, and majestic's IR-cut (GPIO 81, single wire, inverted), backlight (GPIO 14) and opus audio.S96irled— mirrors the IR-cut state onto the two IR LED GPIOs (12, 13); majestic has one backlight pin and this board has two LED banks.sigmastar-osdrv-infinity6c/files/sensor/configs/sc430ai.bin— the SC430AI IQ file, from the camera's own stock firmware. Same arrangement asssc335_lite_tp-link-tapo-c310-v220(sc3335.bin,sc3338.bin); it was deliberately kept out of sigmastar: infinity6c: load the SmartSens SC430AI (TP-Link Tapo C120) firmware#2445 under that repo's binary policy. If it is not wanted here either, say so and I will drop it and keep the "take it from your own dump" instruction on the wiki.excludes/ssc377_lite.list— the other infinity6c sensor modules and IQ files.Depends on OpenIPC/sensors#7 (driver, built by
sigmastar-osdrv-sensorsat HEAD), OpenIPC/firmware#2445 (load_sigmastarentry) and OpenIPC/firmware#2449 (the supplicant package). Until those merge, CI here cannot build this device, so this is a draft until they do.Built and tested locally against those three branches, on the camera (flashed with
sysupgrade --kernel --rootfs):uImage.ssc3772039304 B (cap 2048 KB),rootfs.squashfs.ssc3775513216 B (cap 8192 KB at 16 MB).lsmod:cfg80211 184320 1 8188fu;wpa_cli status:key_mgmt=SAE pmf=2 wpa_state=COMPLETEDon a WPA3-only AP; DHCP.ipcinfo -s→sc430ai; majesticSensor index 0: 2688x1520@30fps,Load api bin Success - /etc/sensors/sc430ai.bin(found by sensor name, nosensorConfigset); RTSP and JPEG fine, colour correct with IR-cut in the day position.customizer.shran on first boot:upgrade,wlandev,sensorset in the environment.ci-matrix.py --self-testpasses (116 devices).Known limitation, from OpenIPC/firmware#2449: the stock
wlan0script still writes a WPA2-PSK block, so a WPA3-only network needskey_mgmt=SAEin the config by hand until the follow-up lands there.Flash layout is the standard OpenIPC 16 MB map (
3072k(kernel),10240k(rootfs)); the U-Boot image is the stocku-boot-ssc377-nor.bin. The wiki page (OpenIPC/wiki#549) is being updated to point at this device.