logo elektroda
logo elektroda
X
logo elektroda

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

divadiow 2316 3
ADVERTISEMENT
  • 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

    Cool? Ranking DIY
    About Author
    divadiow
    Level 34  
    Offline 
    divadiow wrote 2776 posts with rating 481, helped 249 times. Live in city Bristol. Been with us since 2023 year.
  • ADVERTISEMENT
  • #2 21060441
    divadiow
    Level 34  
    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 fixture with solder.

    The ESP downloader boards are so cheap that it may as well be dedicated to a specific module. Also it was delivered with some of the springs slightly bent.

    I started by clamping the ESP board so I could hold the soldering iron on one side to melt the solder while pulling the spring out the other with tweezers.

    ESP-12F board clamped in a vice with visible pins and components. Close-up of an ESP-12F PCB with soldered contacts and flux residues.

    when all the springs were out I fluxed the underside to soak remaining solder up with copper braid

    then using 99.9% IPA isopropyl alcohol I cleaned both sides using an old toothbrush

    PCB with slots for ESP-01, ESP-12, and ESP32 modules.

    Close-up of a PCB with the text 2021 8 10 ESP 通用下载器 and soldered pins. ESP-12F board during soldering process with visible copper braid.
    Bottle of isopropyl alcohol with safety label.

    with the module held in place with blu-tac I fluxed the bottom row of module pins

    Image of an ESP-12F module mounted on a printed circuit board with visible pins and connectors.

    then I used a small amount of solder to flow the bottom pins to fix the module in place so the blu-tac could be removed

    Close-up of a PCB with a soldered ESP-12F module and a yellow connector.

    I fluxed and did the same with the other contacts and the holes underneath, filling each hole with solder as I did.

    I thought I could stretch the solder nicely from the module contact -> hole beneath -> hole where the spring used to be because it turns out both need to be connected - the traces for some of the duplicate pin assignments come off the oval AND separately, the spring pin hole to different locations. But creating a bridge across them all was too messy and inconsistent.

    In hindsight the springs didn't need to be removed but could have been pushed down through the back so they could be bent around, trimmed and soldered to the underside of the oval holes.

    So I went about soldering each spring back into the holes they had just come from!

    They were then trimmed and pushed down into the oval recesses

    Close-up of a printed circuit board with visible solder connections. Photo of a circuit board with protruding pins and technical markings.

    then more flux to cover each bridge and both ends and finally a dob of solder at each end of the pin bridge

    Image of an ESP-12F board with soldered pins. Close-up of a circuit board with numerous pins and soldered traces.

    Perhaps not the neatest but it is secure, strong and each has a good contact.

    Each pin/pad/contact was tested with a multimeter from the module through to the jumper pegs on the ESP board. I can confirm the pin diagram above with GPIO/A#/B# mapping is correct.

    and the final result - 100% powering up and booting into OpenBeken just fine.

    ESP32 module connected to a circuit board. Close-up of ESP-01 PCB with soldered pins. A black ESP downloader board on a blue background with Chinese writing and the date 2021 8 10.

    For next time, probably a WB3S BK7231T, I'll not bother removing the spring pins.

    Added after 9 [hours] 1 [minutes]:

    some more information about the MQ-12F chip itself can be found here http://info.mqlinks.com:1888/dokuwiki/doku.php/mq-12fusermanual

    Screenshot of a user manual titled MQ-12F SMD WI-FI/BLE Dual Mode User Manual

    including AT command use and a module design reference diagram

    Diagram of ESP module wiring with electronic components

    Table showing the functions and descriptions of module pins.

    Added after 37 [minutes]:

    offline dump of that manual in case it disappears
  • ADVERTISEMENT
  • #3 21083442
    divadiow
    Level 34  
    curious to confirm the chip package, I decided to remove the RF shield

    Close-up of LN882HKI QFN-32 integrated circuit on a printed circuit board.

    QFN-32 integrated circuit on a circuit board with visible pins and markings.

    It is the familiar QFN32

    LN882HKI QFN-32, 5mm pitch 2MB Flash

    QFN32 LN882HKI chip diagram with pin layout. Specification table for LN882HKI QFN-32 chip with memory and pin description.
  • #4 21197784
    divadiow
    Level 34  
    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 the chip used, so it was a little gamble. Lucky-dip.

    View of the M0L200PX WiFi module on the Superbuy webpage.

    The module is the M0L200PX and is listed alongside the MQ-12F here http://mqlinks.tpddns.cn:1888/dokuwiki/doku.php/index

    The pad layout does not follow the common ESP-12F style layout with VCC and GND at the bottom left and right contacts, so no using it with the common ESP universal adaptors.

    Diagram of the M0L200PX Wi-Fi module with pin descriptions. Diagram of the M0L200PX module with component labels and connections. Pin layout table of the M0L200PX wifi module with functions and descriptions.

    M0L200PX WiFi Module with Metal Shield on White Background Top view of the M0L200PX wifi module with visible pin labels. M0L200PX wifi module with pad markings M0L200PX WiFi module with metal shield and PCB antenna MQLinks wifi module on a wooden surface.

    After removing its hat we see it's another LN882HKI

    Electronic module with LN882HKI chip. View of the M0L200PX Wi-Fi module with visible LN882HKI chip.

    I expected to see an AP broadcasting when powered on and guessed the module might ship with the same MQ Links test firmware as seen in the first post https://www.elektroda.com/rtvforum/topic4050274.html#21055914

    It does.

    Computer screen showing Wi-Fi network named M0L2_54CE6AUser interface of the M0L1 Series module displaying network details.

    Boot log out is almost identical to that of the MQ-12F

    Code: Text
    Log in, to see the code

    Using the command line method I dumped this firmware before connecting to it. Attached. Dump time was 18 minutes. IOA9 pulled low to get into UART download mode.
    M0L200PX wifi module on a blue mat with several connected wires.

    After that a quick flash to OpenBeken
    Computer screen displaying software for flashing devices.

    OpenBeken user interface with LN882H device information
ADVERTISEMENT