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

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

LN-CB3S Module Pinout and Flashing Issues on Tuya Wall Switch – Any Documentation?

patentjyp 621 12
ADVERTISEMENT
  • #1 21815997
    patentjyp
    Level 5  
    Electronic module with labeled pins on a blue PCB, top view LN-CB3S electronic module with PCB antenna, CE marking, and QR code

    Any info on this module?

    I could not find any information by googling "LN-CB3S."

    It seems that this module has different pin labeling (and/or different pinouts) from CB3S module.

    I connected A2 and A3 pins to TX and RX (and also tried to RX and TX) of my USB-to-serial (and also CEN to GND), but I cannot get it to enter flash mode.

    This module is from a Tuya wall switch. Since I could not flash this module with any open-source firmware, I had to replace it with ESP-12F.

    Any info would be appreciated.
  • ADVERTISEMENT
  • #2 21815999
    insmod
    Level 31  
    Judging from module and pin names - LN882H.
    Default RX/TX are for flashing (and app uart, if used), log should be at B9.

    Backup can be taken with BK7231GUIFlashTool, chip enters flashing mode with A9 pulled down on boot
  • ADVERTISEMENT
  • #3 21818982
    p.kaczmarek2
    Moderator Smart Home
    Interesting, looks like LN882H CB3S version. Can you try to take a backup with our flasher?
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 21820714
    divadiow
    Level 38  
    Pinout diagram of an electronic module showing GPIO, UART, and 3.3V power connections
    Attachments:
    • CB3S_4layers.zip (262.84 KB) You must be logged in to download this attachment.
    • CB3S_2layers.zip (228.95 KB) You must be logged in to download this attachment.
  • #5 21875317
    bl00dy
    Level 6  
    any success to flash LN-CB3S ?
  • #6 21875564
    divadiow
    Level 38  
    was that aimed at @patentjyp? If it behaves like a standard LN882H then there should be no issues reading or writing to this module
  • #8 21875746
    divadiow
    Level 38  
    Cool.

    Did you take a backup first? Would you be happy to share it for addition to our collection?
  • #9 21875863
    bl00dy
    Level 6  
    Hello,

    Yes, uploaded.

    Chip: LN-CB3S_V1.0
    Model: WL2H-U-2
    Device: DS-101JL, BSEED Wifi Touch Light Switches 2 Gang Smart Wall Switch
    PinFunctionDirectionInverted
    PA0Backlight LEDOutputyes
    PA2Right indicator LEDOutputyes
    PA4Left indicator LEDOutputyes
    PA6Relay 1 — Left LightOutputno
    PA10Status LEDOutputyes
    PA11Button LeftInput PULLUPyes
    PB5Relay 2 — Right LightOutputno
    PB6Button RightInput PULLUPyes

    Ed
  • #10 21875955
    divadiow
    Level 38  
    thanks. Easy Flasher chokes on the KV extraction from that dump. Will fix.

    Screenshot of BK7231 Easy UART Flasher showing an error message and an empty JSON panel
  • ADVERTISEMENT
  • #11 21875969
    bl00dy
    Level 6  
    When comparing two flash dumps from DS-101JL light switches (Tuya WL2H-U-2 module, LN882H chip),
    I found the following:

    Firmware is 100% identical between units

    Both devices came from the factory with exactly the same firmware. The app partition
    (0x007000–0x132FFF, 1.2 MB) is bit-for-bit identical.

    Flash partition layout (2 MB total)

    
      Partition   Offset      Size    D1 vs D2
      ---------   ------      ----    --------
      boot        0x000000    24 KB   IDENTICAL
      part_table  0x006000     4 KB   IDENTICAL
      app         0x007000   1.2 MB   IDENTICAL  ← same firmware on all units
      ota         0x133000   680 KB   different  (6306 bytes — MAC   provisioning)
      nvds        0x1DD000    12 KB   different  (1146 bytes — runtime state)
      kv          0x1E0000    16 KB   different  (3069 bytes)
      kvs         0x1E4000    32 KB   different  (4095 bytes)
      user        0x1EC000    80 KB   different  (77813 bytes)
      


    All differences are in the data area above 0x133000 — device-specific info only.

    MAC address location

    Both WiFi and BLE MACs are stored in the OTA partition region at offset 0x1C543C.
    The KV key names are readable in plaintext:

    
      Key name      Offset      D1                  D2
      --------      ------      --                  --
      6_sta_mac     0x1C543C    00:33:7A:2B:86:95   BC:35:1E:BE:41:EB
      24_ble_mac    0x1C5464*   00:33:7A:2B:86:96   BC:35:1E:BE:41:EC
    
      * stored in reversed byte order
      


    BLE MAC is always WiFi MAC 1. The OUI 00:33:7A belongs to Lightning Semiconductor,
    BC:35:1E belongs to Tuya.

    KV key names visible in plaintext around the MAC area

    
      it_magic     — KV entry separator/magic marker
      6_sta_mac    — WiFi (station) MAC address
      24_ble_mac   — BLE MAC address
      ty_ada_psk   — WiFi credentials (SSID   password, plaintext!)
      
  • #12 21876010
    divadiow
    Level 38  
    Code: JSON
    Log in, to see the code
  • #13 21877066
    divadiow
    Level 38  
    boot log
    Code: Text
    Log in, to see the code

Topic summary

✨ The LN-CB3S module, found in a Tuya wall switch, appears to differ in pin labeling and pinout from the standard CB3S module, complicating attempts to flash it with open-source firmware. Attempts to enter flash mode by connecting A2 and A3 pins to TX and RX of a USB-to-serial adapter, and grounding CEN, were unsuccessful. The module is identified as based on the LN882H chip. For flashing, the default RX/TX pins are used, with logs accessible at pin B9. To enter flashing mode, the A9 pin must be pulled low during boot. Backup operations can be performed using BK7231GUIFlashTool. Due to flashing difficulties, the original module was replaced with an ESP-12F.
Generated by the language model.
ADVERTISEMENT