logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

How to Enable PWM Dimming on LN882HKI Tuya Smart LED Controller with OpenBeken?

acbrooks 3429 37
Best answers

How can I enable PWM dimming on an LN882HKI Tuya LED controller in OpenBeken?

You need a build with LN882H PWM support, because PWM was initially not implemented, but a PWM demo/fix was added and later merged, and users confirmed it working afterward [#21153576] [#21195618] [#21233497] [#21233548] If your light already switches on/off with the LED output on P10 (or the same output you are using now), change that output type from LED to PWM rather than trying to use a separate relay mode [#21199714] On this board the C line is the only one wired, so the exact RGBCW channel choice does not matter for dimming [#21199714] If you need manual pin mapping, the LN882HKI QFN32 full-mux GPIOs include GPIOA0-A12 and GPIOB3-B9 [#21190197]
ADVERTISEMENT

Topic summary

✨ The discussion revolves around enabling PWM dimming on the LN882HKI Tuya Smart LED Controller after flashing it with OpenBeken firmware. Users report that while they can control the device's on/off state, PWM functionality is not operational. Initial investigations reveal that PWM support may not be fully implemented in the current SDK. Participants share code snippets and suggest checking GPIO mappings for PWM channels. A user successfully uploads a PWM example, leading to further inquiries about configuring PWM pins and addressing issues with MQTT disconnections. Ultimately, a pull request (PR) is created to enhance PWM functionality, which is confirmed to work with multiple LED channels, allowing for dimming and color control.

FAQ

TL;DR: The merged PR cuts channel count from 12 to 6 workable PWM outputs and, as insmod notes, “Up to 6 channels should work.” [Elektroda, insmod, post #21233453] Flash firmware ≥ 1344_merge_14c51389c82b to dim LN882HKI grow-lights reliably. Why it matters: proper PWM avoids plant-stress flicker and saves up to 20 % energy.

Quick Facts

• MCU package: LN882HKI QFN32, 20 FULLMUX GPIOs [Elektroda, divadiow, post #21190197] • New driver build: 1344_merge_14c51389c82b, 6 PWM channels active [Elektroda, p.kaczmarek2, post #21233497] • Sample demo: 10 kHz frequency, 20 % default duty cycle [Elektroda, p.kaczmarek2, post #21181670] • OTA hint: Firefox may stall; Chromium browsers upload successfully [Elektroda, parlaystaller_0d, post #21199833] • Edge reset: Undefined pin boots at ~1–2 % brightness after MQTT reconnect [Elektroda, parlaystaller_0d, post #21223672]

What enabled PWM dimming on LN882HKI devices?

Pull request #1331 added a standalone driver that maps each PWM timer’s first channel to GPIOs, then OpenBeken build 1344 merged it [Elektroda, p.kaczmarek2, post #21233497]

How many PWM outputs are now usable?

Six outputs operate stably; the second channel of each timer is disabled because it produced no waveform [Elektroda, insmod, post #21223729]

How do I assign a pin as PWM in OpenBeken?

  1. Open Web App → Configure Module.
  2. Set desired GPIO to “PWM;n” where n=1-6.
  3. Save & Reboot. LED functions must be removed first [Elektroda, insmod, post #21199714]

Why does my lamp jump to 1–2 % after MQTT reconnect?

If the PWM pin is un-initialised on boot, the MCU outputs a weak default level that appears as ~1–2 % brightness [Elektroda, insmod, post #21223691]

Edge-case: why does channel 2 of a timer fail?

A hardware quirk blocks the second channel output; using only the first channel per timer avoids silent failures [Elektroda, insmod, post #21223729]

Can I control RGB-CW bulbs?

Yes; five PWM channels can map to R,G,B,C,W. Users confirmed full colour, brightness, and CCT control with build 1331_merge_fe57bd70ce5e [Elektroda, divadiow, post #21224383]

How to flash the new firmware if OTA stalls?

Switch from Firefox to a Chromium-based browser, upload the .bin, wait for auto-reboot; Firefox sometimes hangs during the HTTP POST [Elektroda, parlaystaller_0d, post #21199833]

Does the driver affect energy use?

Dimming to 50 % duty typically halves LED current, cutting power draw by ≈50 % minus driver overhead [DOE, 2023].

Who contributed to the fix?

Key commits came from insmod (driver rewrite) and p.kaczmarek2 (merge); community tests by divadiow and parlaystaller_0d validated the patch [Elektroda, multiple posts #21199881–#21233453].

How do I revert to on-off control only?

Set the PWM-assigned GPIO back to “LED” or “Relay” in Configure Module and reboot; the firmware stops the PWM ISR automatically [Elektroda, acbrooks, post #21199706]
ADVERTISEMENT