Skip to content

Add support to LN882X family #4967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions all_automations.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@
"esp32",
"esp8266",
"host",
"ln882x",
"max6956",
"mcp23016",
"mcp23xxx",
Expand Down
1 change: 1 addition & 0 deletions components/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Supported Microcontrollers
RP2040, components/rp2040, rp2040.svg
BK72xx, components/libretiny, bk72xx.svg
RTL87xx, components/libretiny, rtl87xx.svg
LN882x, components/libretiny, ln882x.svg
Host, components/host, host.svg, dark-invert

Microcontroller Peripherals
Expand Down
15 changes: 14 additions & 1 deletion components/libretiny.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ It provides support for the following microcontrollers, commonly used in Tuya de

- **BK72xx**: BK7231T, BK7231N
- **RTL87xx**: RTL8710BN, RTL8710BX
- **LN882x**: LN882HKI

Since different microcontrollers are supported, you need to include the appropriate ESPHome component,
depending on which processor your device has.
Expand All @@ -26,6 +27,10 @@ Refer to `LibreTiny/Boards <https://docs.libretiny.eu/link/boards>`__ to find yo
rtl87xx:
board: generic-rtl8710bn-2mb-788k

# Example configuration entry for LN882x
ln882x:
board: generic-ln882hki

Configuration variables:
------------------------

Expand All @@ -50,7 +55,7 @@ Configuration variables:
- :ref:`Advanced options <advanced-options>`

- **family** (*Optional*, string): The family of LibreTiny-supported microcontrollers that is used on this board.
One of ``bk7231n``, ``bk7231t``, ``rtl8710b``, ``rtl8720c``, ``bk7251``, ``bk7231q``.
One of ``bk7231n``, ``bk7231t``, ``rtl8710b``, ``rtl8720c``, ``bk7251``, ``bk7231q``, ``ln882hki``.
Defaults to the variant that is detected from the board, if a board that's unknown to ESPHome is used,
this option is mandatory. **It's recommended not to include this option**.

Expand All @@ -77,6 +82,7 @@ Here are a few useful links:

- `Flashing BK72xx by UART <https://docs.libretiny.eu/link/flashing-beken-72xx>`__
- `Flashing RTL8710B by UART <https://docs.libretiny.eu/link/flashing-realtek-ambz>`__
- `Flashing LN882x by UART <https://docs.libretiny.eu/docs/platform/lightning-ln882x/#flashing>`__
- `UPK2ESPHome <https://upk.libretiny.eu/>`__ - generating ESPHome YAML automatically, from Cloudcutter profiles or Kickstart firmware (also BK72xx only)

GPIO Pin Numbering
Expand Down Expand Up @@ -109,6 +115,13 @@ Some notes about the pins on RTL8710BN/BX:
- ``TX2 (PA30)`` is additionally used to determine the boot mode on startup (similar to ESP32).
Pulling it LOW on startup will enter "download mode".

Some notes about the pins on LN882H:

- ``TX0 (PA2)`` and ``RX0 (PA3)`` are used for flashing the firmware,
as well as the default :doc:`/components/logger` UART port.
- ``BOOT1 (PA9)`` is additionally used to determine the boot mode on startup (similar to ESP32).
Pulling it LOW on startup will enter "download mode".

Example configuration entries using various naming styles:

.. code-block:: yaml
Expand Down
53 changes: 53 additions & 0 deletions images/ln882x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Which microcontrollers does ESPHome support?
<div class="feature-card">
<div class="feature-icon"><i aria-hidden="true" class="fas fa-bolt"></i></div>
<div class="feature-text">Others</div>
<p>Realtek RTL87xx and Beken BK72xx chips are supported.</p>
<p>Realtek RTL87xx and Beken BK72xx and LN882H chips are supported.</p>
</div>
<div class="feature-card">
<div class="feature-icon"><i aria-hidden="true" class="fas fa-computer"></i></div>
Expand Down