Here's a step by step guide showing LN882HKI flashing process along with soldering. LN882HKI can be easily flashed with OpenBeken port and run cloudfree, it can be also paired with Home Assistant. Our LN882H firmware also supports new features and sensors, like DHT11 or SSDP discovery, that can be later enabled via OBK scripting.
LN882 flashing is very similiar to ESP8266, you just need to ground one BOOT pin and then new firmware can be flashed via UART.
Here's detailed guide:
Let us know if you have encountered any LN882 devices and how the flashing went! We can also help you with firmware change process, feel free to ask any questions.
That's very nice! How did you know the UART protocol details? I didn't research it yet, so I don't know if it's documented, or available somewhere, or did you have to reverse-engineer it?
@divadiow , do you have LN882H to give his tool a try?
I've checked his code futher and it seems that LN882H is using YMODEM protocol for UART communication:
https://en.wikipedia.org/wiki/YMODEM It may be relatively easily to implement it in our flasher as we....
Well, there are at least 3 options, he could have:
- captured communication with UART sniffer or separate USB to UART tool or Sigrok etc etc
- decompiled flashing tool that runs on PC with IDA pro or Ghidra etc
- or maybe decompiled LN882H firmware
I am looking for help with the Wemo driver for the LN88H. I have started the service and it shows in the setup.xml file but Alexa will not discover it. Wemo support has been successfully discovered by Alexa on some devices I have with the BL602 clip.
The attached, coupled with the rest of the git content, appears to work downloading from LN882H to a file called dump.hex
This is a paired-down test that will only dump
Code: Python
Log in, to see the code
fdump address range expanded to cover 2mb. It takes approximately 14 minutes to dump 2mb, despite self.ser.baudrate = 115200 being set. Any higher and the script errors with:
I erased my LN after dump, flashed Tuya factory, then reflashed the LN882Loader backup back to the board - it booted OpenBK in AP mode and contained the small customisations I made before dump - a working backup - the state it was left before backup.
So I guess:
-is 115200 (2mb/14 mins= ~20,000bps?) really the fastest we can get
-how can the OPs loader.py be modified to offer the user the option to backup flash and choose a filename
-is the way in this modified script even good? it was done with GPT
out of curiosity I tried the dumper script with what looks like the boot file for LN8825x using this test device. Sadly no joy though I do see mention of fdump in the bin. Feel free to have a look through it
I have been trying to flash using this USB to uart adapter. It has a 3.3 v output. I didn't use a 3.3v supply like originally done in the tutorial. I keep getting this error
>>21377443 Sorry for the late response and yes you answered me before in the old thread and I provided some info but then the thread was moved so I asked again. So I saw your proposed change to enable SSDP. I guess I would have to compile against that change? I'm currently not setup to do that. I flashed the latest firmware but SSDP still isn't an option.
$ strings tyutool_cli | grep import
import sys; sys.stdout.flush(); (sys.__stdout__.flush if sys.__stdout__ is not sys.stdout else (lambda: None))()
import sys; sys.stderr.flush(); (sys.__stderr__.flush if sys.__stderr__ is not sys.stderr else (lambda: None))()
there's even some traces of python
It turns out it's just python byte-compiled and packaged into an executable.
$ git clone https://github.com/extremecoders-re/pyinstxtractor.git
$ cd pyinstxtractor
# it only worked partially with a different python version, it has to match the python used in the binary
$ python38 pyinstxtractor.py tyutool_cli
[+] Processing tyutool_cli
[+] Pyinstaller version: 2.1+
[+] Python version: 3.8
[+] Length of package: 9832132 bytes
[+] Found 55 files in CArchive
[+] Beginning extraction...please standby
[+] Possible entry point: pyiboot01_bootstrap.pyc
[+] Possible entry point: pyi_rth_inspect.pyc
[+] Possible entry point: pyi_rth_multiprocessing.pyc
[+] Possible entry point: pyi_rth_pkgutil.pyc
[+] Possible entry point: tyutool_cli.pyc
[+] Found 798 files in PYZ archive
[+] Successfully extracted pyinstaller archive: tyutool_cli
You can now use a python decompiler on the pyc files within the extracted directory
$ cd tyutool_cli_extracted
$ ls
base_library.zip importlib_metadata-8.5.0.dist-info lib-dynload liblzma.so.5 libssl.so.1.1 pyiboot01_bootstrap.pyc pyimod03_ctypes.pyc pyi_rth_pkgutil.pyc struct.pyc
certifi libbz2.so.1.0 libexpat.so.1 libmpdec.so.2 libuuid.so.1 pyimod01_archive.pyc pyi_rth_inspect.pyc PYZ-00.pyz tyutool_cli.pyc
charset_normalizer libcrypto.so.1.1 libffi.so.7 libpython3.8.so.1.0 libz.so.1 pyimod02_importers.pyc pyi_rth_multiprocessing.pyc PYZ-00.pyz_extracted yaml
For decompiling .pyc files, decompyle3 worked well (2 files failed to decompile):
>>21377443 Sorry for the late response and yes you answered me before in the old thread and I provided some info but then the thread was moved so I asked again. So I saw your proposed change to enable SSDP. I guess I would have to compile against that change? I'm currently not setup to do that. I flashed the latest firmware but SSDP still isn't an option.
@niterian Are you looking for other tools because flashing does not work for you? Then please show your connections. I don't think that the tool is at fault.
The discussion centers on flashing the LN882H (specifically LN882HKI) module using open-source tools and firmware such as OpenBeken and OpenBK7231T_App, with detailed guides and video tutorials available. Flashing involves grounding the BOOT pin and using UART communication, which employs ASCII commands and the YMODEM protocol for data transfer. Several tools have been developed and shared, including LN882Loader (Linux-based) and Windows GUI wrappers, with ongoing improvements to support faster flash reading and dumping via commands like "fdump." Users report challenges with UART adapters, power supply stability, and correct COM port usage, highlighting the importance of proper hardware setup (e.g., CH340G vs. FTDI232 UART adapters). SSDP support and Home Assistant integration are discussed, with SSDP requiring IGMP flag enabling and driver activation in firmware. GPIO pin behavior and limitations are examined, noting that certain pins (A13 to B2) are reserved for QSPI flash and should not be used as GPIO outputs. Firmware versions and SDK updates are tracked, with reverse engineering efforts revealing internal flash structures and configuration data. WiFi stability issues on LN882H modules are reported, potentially linked to power supply quality or environmental factors, distinct from BK7231N platform behavior. Pinout details for LN882HK1 modules are clarified, identifying UART TX and RX pins and the BOOT pin for flashing mode entry. Overall, the community collaborates on improving flashing tools, firmware features, and hardware understanding to enable cloud-free operation and integration with smart home systems. Summary generated by the language model.