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

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

Creating Lightning Semiconductor LN882H Development Board Using MQ-12F Module

divadiow  3 2922 Cool? (+1)
📢 Listen (AI):

TL;DR

  • An MQ-12F module for Lightning Semiconductor LN882H was fitted to an ESP-12F-style universal downloader board and turned into a temporary development platform.
  • Continuity testing mapped the MQ-12F pads to ESP pins, then pulling A9/GPIO0 low during power-up entered LN882H download mode for firmware dump and flashing.
  • The module exposed SSID MQ_C0DAFA, used admin/admin on 192.168.4.1, and the factory firmware dump took about 25 minutes at 2,000,000 baud.
  • OpenBeken flashed successfully, rebooted with a new AP, and the board could then be joined to Wi‑Fi for further testing.
  • Limitations included a discontinued LN8825B, no official dev-board shipping outside China, and a USB-C port that worked only with USB-A to USB-C cables.
A contact at Lightning Semiconductor, who has been very helpful on Gitee and email, pointed me to this module on Taobao when I asked about getting an LN882H and/or LN8825B development board. LN8825B has been discontinued and is no longer in production and Lightning Semi do not ship dev boards outside of China.

Despite my best efforts I was not able to get a functioning/verified Taobao personal or business account so I could purchase the module for direct shipment to the UK.

Googling around it seemed there were companies that will purchase from such restrictive sites on your behalf then ship them onward to you. Pandabauy.com is one such site. Using the whole Taobao URL in the search field it seemed like it could be a success. Very cheap, but I expected shipping and taxes would be a lot more than the cost of the modules.

Green MQ-12F WiFi/BLE module on PandaBuy page.

I signed up and purchased 2 modules and a W800 Winner Micro board. First the items will be shipped to the PandaBuy warehouse. When they arrive they are photographed and stored in the warehouse against your account. Photographs are added to your order for inspection.

Screenshot of a PandaBuy order featuring IoT products.

this was the tracking/time taken from order to storage at PandaBuy warehouse

Order status with tracking information and delivery stages

when your items are all received you get to choose an onward postal service. I went with one of the cheapest - China Post/Royal Mail. The expected time to arrival was 2-3 weeks. There was an initial cost but later a partial refund when final weight and parcel dimensions were calculated. In total I think the whole order end to end was ~£10 including the W800. The order arrived today, 22nd April, so a total of 3 weeks from first order.

Pandabuy shipping fee details with refund.

With the modules finally in hand and lifting inspiration from my previous NodeMCU/CB3S transplant and this post here about a universal ESP board, which I got from Ali Express, I fit the module ready for analysis.

Photo of an ESP board with soldered pins and a wireless module.

Close-up of an ESP32 module mounted on a development board with soldered pins.

Not knowing if the module would come with any development/testing software pre-flashed, I looked out for any new wireless APs broadcasting. Sure enough SSID "MQ_C0DAFA" appeared. On connection my wireless adaptor was DHCP assigned an IP of 192.168.4.2 from server 192.168.4.1, like Tasmota/OpenBeken. Browsing 192.168.4.1 prompts for a username/password. My second guess was admin/admin, which was correct.

The home page of what comes up

User interface of a network module on the configuration page.

and Chrome translation to English

Screenshot of the MOL1 series module user interface.

and the remaining main tabs

Screenshot of the ML01 series module administration interface at 192.168.4.1.
Settings panel for M0L1 series modules with various network options
M0L1 series module configuration interface with network and serial port settings

you can drill down further to customise most areas, for example AP/STA/Null wifi mode

Screenshot showing mode selection in a network interface.

On B9/GPIO2 (UART_TX1 pin for log printing, corresponding to pin 30) we get the following (had to use 2000000 baud)

Code: Text
Log in, to see the code


All good stuff, but I want OpenBeken on it. Before erasing and flashing with OBK I want to dump the firmware that it shipped with. The LN modules have their own GPIO/pad name/numbering system so I need to know exactly to which pins on the ESP board each is linked. Using these images as a reference point, and the use of a multi-meter to confirm continuity, we can map the pins.

Front view of the MQ-12F module with pin labels. Bottom view of the MQ-12F module with pin labels ESP-12F module pin layout with pin labels.
Top view of a universal ESP programming board with empty solder pads and labeled GPIO points.

The mappings are:

ESP-12F - MQ-12F
TXD - A2
RXD - A3
GPIO5 - A12
GPIO4 - B3
GPIO0 - A9
GPIO2 - B9
GPIO15 - B8
GND - GND
SCLK - B4
MOSI - B5
GPIO10 - B6
GPIO9 - B7
MISO - A5
CS0 - A4
VCC - VCC
GPIO13 - A11
GPIO12 - A10
GPIO14 - A7
GPIO16 - A1
EN - CHIP EN
ADC - A0
RST - A6/RST

Top view of the MQ-12F development board with LN882H chip and pin mappings.

To get LN882H into download mode we need to ground A9 as it's being powered. With the GPIO0/A9 button on the dev board held down as the USB-C cable is inserted, the desired state is obtained. This is the exact method as described in the LN882H flashing guide. It appears you *can* actually release A9 once in download mode. I also achieved the same by bridging GND and GPIO0 pins on the underside of the dev board with a jumper cable.

ESP module with buttons and connectors labeled with yellow descriptions.

Now the python script can be used with LN882H_CMD_Tool.exe to download the factory firmware. The ESP universal board has a built-in Winchiphead CH340 USB-TTL chip, which for me was COM6, so my command to begin dump was:

Code: Text
Log in, to see the code


This took ~25 mins. I attach the result.

Then, as explained here and in the flashing guide referenced above (for the command line experience), I flashed OBK using the GUI flasher.

Graphical interface of a microcontroller programming tool with COM6 port and binary file selected.

After a reboot, the AP broadcasts as expected

Screenshot of an available WiFi network named OpenLN882H_C25E1088.

From 192.168.4.1 http you can then join it to your wifi ready for any testing you may wish to do on the LN882H in OpenBeken!

Screenshot of the OpenLN882H_C25E1088 web application.

and the LN OBK boot log (921600 baud):

Code: Text
Log in, to see the code


A couple of things of note:

-The factory fw boot log contains the title "at_mqlinks_ln882h" which looks like it might mean it support AT commands. I have not explored this.

-The bottom row of pads on the ESP universal board don't appear to be linked to any pins. I assume the solder pads are there only to hold the module in place.

-The ESP dev board does not have a proper USB-C compliant connector/controller. It is supplying power and standard USB signals, so a USB-C to USB-C cable doesn't work. I used USB-A to USB-C. More on this here.

-Not all same-numbered GPIOs on the ESP board are connected to each other

-The ESP universal downloader board did not ship with pins soldered. These were added by me
Attachments:
  • LN882Hmodule_flash.bin (2 MB) You must be logged in to download this attachment.

About Author
divadiow
divadiow wrote 4676 posts with rating 830 , helped 409 times. Live in city Bristol. Been with us since 2023 year.

Comments

divadiow 26 Apr 2024 08:41

I wasn't happy always wondering if the pins on the PCB were 100% connecting with the module so I decided to remove the retention spring pins from the ESP-12F area so I could make the MQ-12F a permanent... [Read more]

divadiow 15 May 2024 17:16

curious to confirm the chip package, I decided to remove the RF shield https://obrazki.elektroda.pl/4975141100_1715785783_thumb.jpg https://obrazki.elektroda.pl/1114833900_1715796986_thumb.jpg... [Read more]

divadiow 20 Aug 2024 20:05

To flesh out another order of some random bits from Taobao, this time through superbuy.com instead of PandaBuy, I added another MQLinks wifi module to the basket. I couldn't find any information about... [Read more]

FAQ

TL;DR: Firmware dump finishes in 25 minutes, "100% powering up and booting into OpenBeken" [Elektroda, divadiow, post #21055914] This DIY guide shows you how to source, map pins, dump stock firmware, and flash OpenBeken on Lightning Semiconductor LN882H modules.

Why it matters: You can repurpose low-cost Chinese Wi-Fi modules for open-source firmware without waiting for official dev boards.

Quick Facts

• LN882HKI: QFN-32, 2 MB flash [Elektroda, divadiow, post #21083442] • GPIO0 (A9) must be held low at power-up for download mode [Elektroda, divadiow, post #21055914] • Firmware dump time: 18 – 25 min @ 2 Mbps UART [Elektroda, divadiow, post #21197784] • Total landed cost for two modules + W800 board ≈ £10 [Elektroda, divadiow, post #21055914] • Stock SSID “MQ_C0DAFA”, login admin/admin [Elektroda, divadiow, post #21055914]

Can I buy an official Lightning Semi dev board outside China?

No. Lightning Semiconductor confirmed that it does not ship dev boards abroad; you must buy bare modules via third-party agents such as PandaBuy or SuperBuy [Elektroda, divadiow, post #21055914]

How long does international delivery usually take?

The first order reached the UK in exactly three weeks using China Post/Royal Mail economy service—about 21 days door-to-door [Elektroda, divadiow, post #21055914]

What is the pin mapping between MQ-12F and ESP-12F pads?

Key lines: TXD→A2, RXD→A3, GPIO5→A12, GPIO0→A9, GPIO2→B9, GPIO15→B8, EN→CHIP EN, ADC→A0. Full 22-pin table is provided in the post and was continuity-tested with a multimeter [Elektroda, divadiow, post #21055914]

How do I enter LN882H download (flashing) mode?

Hold A9 (GPIO0) low while powering the board. You may release it once the chip enters download mode; bridging A9 to GND also works [Elektroda, divadiow, post #21055914]

Quick 3-step guide to flashing OpenBeken?

  1. Put the module in download mode.
  2. Open the GUI flasher, select OpenBK7231N_QIO_2MB.bin.
  3. Click Flash; reboot and join the OpenLN882H_xxxx AP [Elektroda, divadiow, post #21055914]

What are the default credentials of the factory test firmware?

Wi-Fi SSID appears as MQ_C0DAFA (or M0L2_xxxxxx on other modules); HTTP login is admin/admin [Elektroda, divadiow, post #21055914]

Does the stock image support AT commands?

The boot banner reads “at_mqlinks_ln882h”, indicating AT-command capability, but the thread author has not explored the command set [Elektroda, divadiow, post #21055914]

What common failure stops flashing?

Edge-case: the ESP downloader’s USB-C socket is not standards-compliant; a USB-C ↔ USB-C cable carries no 5 V and the board stays unpowered. Use USB-A ↔ USB-C instead [Elektroda, divadiow, post #21055914]

How can I make the module permanent on the universal board?

Remove the pogo-pin springs, tin the oval pads, push the springs back as bridges, and solder both ends. Confirm continuity to header pins; the author achieved “each has a good contact” after this fix [Elektroda, divadiow, post #21060441]
%}