logo elektroda
logo elektroda
X
logo elektroda

Tuya TYBL1 Bluetooth Gateway: CR3L/RTL8720CM [W701M-VT2-CG] Flash Backup, Boot Log - Info Dump

divadiow 4302 23
ADVERTISEMENT
  • Helpful post
    #1 21413940
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    Tuya TYBL1 Bluetooth Gateway bits:

    White Tuya TYBL1 Bluetooth module in a rectangular shape with two small holes on the front.White Tuya Smart Gateway hub with a promotion on the AliExpress page.

    https://www.aliexpress.us/item/1005005986939367.html

    Smart Gateway packaging with technical information. Box of Tuya Smart Gateway Hub Bluetooth ZigBee product. Label on a box with information about eVAtmasterConsulting GmbH, CE and recycling symbols. Tuya TYBL1 packaging with connection options and power outlets. White square router in an open cardboard box on a wooden table. Tuya BLE Gateway user manual with USB cable on a wooden surface. BLE Gateway user manual with Smart Life app instructions on wooden background. BLE Smart Gateway instruction and FAQ with cable. Opened case of Tuya TYBL1 Smart Gateway showing internal components and screws. Back of a blue circuit board with visible traces and mounting holes. Circuit board with CR3L module on a wooden background

    App interface showing no added devices. Screen showing instructions for pairing child devices, with icons for sensors, sockets, and light sources, and a confirmation button. Device update screen showing no updates available, version V1.17.5.

    https://developer.tuya.com/en/docs/iot/cr3l-module-datasheet?id=Ka3gl6ria8f1t

    Block diagram of Tuya CR3L module with pins and connections Bottom view pin layout of CR3L module

    A_13/RX and A_0 pull high to get into uart DL mode. Within ESP adaptor only A_0 needs pulling high it seems.

    de-soldered CR3L module mapping for my flavour of ESP adaptor

    Tuya TYBL1 adapter with CR3L module and visible pins.

    A_16_UART_TXLOG Tuya boot log:

    Code: Text
    Log in, to see the code


    NeoProgrammer detection and dump log
    Code: Text
    Log in, to see the code


    CR3L electronic module with components clamped in a vise on a blue background.
    Close-up of a chip on a circuit board with visible markings W701M, 06GR2G4, G028T2. Close-up of a BoyaMicro 25Q32BSTIG chip on a circuit board. Close-up of a circuit board with BoyaMicro and Winbond chips.

    Tuya_TYBL1_key7mn9kc48xep73_xxx.bin dumps at https://github.com/openshwprojects/FlashDumps/tree/main/IoT/RTL8720CM

    All 3 dumps boot and pair when flashed back using AmebaZ2 PG Tool

    Added after 9 [hours] 53 [minutes]:


    User interface displaying information about the OpenRTL87X0C device.Screenshot of the AmebaZ2 PG Tool 1.2.47 with flashing settings.
  • ADVERTISEMENT
  • #2 21418020
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    Interesting device, so it basically allows you to connect Tuya Bluetooth devices to the cloud via the WiFi?
    Helpful post? Buy me a coffee.
  • #3 21418031
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    actually not tried using its official function, but yes, it would seem to be for that.
  • #4 21418038
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    Are there also Beken-based BT gateways? BK7231-based, for example?
    Helpful post? Buy me a coffee.
  • #5 21418043
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    I don't believe I've seen any variation, or even seen many internal pics of this device or others like it. I have 2 more coming and @max4elektroda has one too, so maybe we'll find out. There must be some type BK7231 bluetooth gateway somewhere.

    Added after 1 [minutes]:

    any plans to do anything with BT in OBK?

    But then maybe enabling BLE would take up too much space?

    Added after 36 [seconds]:

    1 user would like BLE :D https://community.home-assistant.io/t/tuya-bl...ay-cr3l-any-open-firmware/830195/2?u=divadiow
  • ADVERTISEMENT
  • #6 21423978
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    >>21413940

    Code: Text
    Log in, to see the code
  • ADVERTISEMENT
  • #8 21439281
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    another type. This one was advertised as Tuya Zigbee Wireless Hub Gateway For Smart Home Automation for Zigbee Devices Via Smart Life
    https://www.aliexpress.com/item/1005006837379685.html

    Advertisement of Tuya Zigbee wireless hub for home automation.

    ZigBee Wireless Gateway with packaging, circuit board, and manual on a blue surface. Close-up of a circuit board with a CR3L module and micro-USB port. Tuya Zigbee Wireless Hub circuit board with ZS3L chip and technical markings.

    Micro-USB.

    G01Y_V1.1 2023-05-27
    FLY-G01
    ShenZhen Forever Young Technology Co.,Ltd
  • ADVERTISEMENT
  • #9 21439605
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    I have recently received Tuya Bluetooth-only bulb:
    https://www.elektroda.pl/rtvforum/topic4105891.html
    I have only so far paired such Bluetooth bulb only directly with my mobile phone... maybe I should order a BT gateway to check if it's supported there?

    I wonder how much work would it take to run OBK on Bluetooth gateway so it can support such bulbs as I linked.
    Helpful post? Buy me a coffee.
  • #10 21439617
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    definitely get one or more. If only so you have a CR3L
  • #11 21439662
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21439281 Curious, a zigbee only gateway with bluetooth-capable module, and the same one as from bluetooth-only gateways at that.
    I too received a CR3L bt gateway today. Board is a little different, but overall they are like copy+paste with a little editing.
    Board is W-BG-CR3L V1.02
    I will later try to convert it to zigbee coordinator with TB-03F module.

    Added after 1 [hours] 11 [minutes]:

    Backup, made with modified ltchiptool.
    A LOT of free heap available with OBK. I thought at least some code modification would be needed to map sram, but it seems to work oob.
    Info:MAIN:Time 1, idle 0/s, free 4297224, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21 
    Attachments:
    • cr3l.zip (1.27 MB) You must be logged in to download this attachment.
  • Helpful post
    #12 21440797
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Here is my device, layout is quite different, board is labelled "NH-BLE-WIFI-GW" "V1.0.8"

    Back of a white Moes Wireless Smart Gateway device with an informational label. Printed circuit board labeled NH-BLE-WIFI-GW V1.0.8 with various components and a USB connector on a blue background. Bottom of a printed circuit board marked NH-BLE-WIFI-GW with visible traces and mounting holes.

    Ali-Link: https://www.aliexpress.com/item/1005005637088709.html

    It took me (too) much time to dump the firmware with ltchiptool - only got I/O errors.
    Finally I switched from one CH340 to another CH340 adapter, and it worked. Very strange.

    OBK installed via
    "ltchiptool flash write -f realtek-ambz2 ~/Downloads/OpenRTL87X0C_1.18.41.bin"

    Web interface of OpenRTL87X0C software on a computer screen.
    Attachments:
    • dump.zip (1.36 MB) You must be logged in to download this attachment.
  • #13 21440852
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Should pin cfg work? only getting "error" for all pins:
    Configuration page of OpenRTL87X0C interface with errors at pins.

    ... "error" should only be returned, if index is out of range.

    In "src/hal/realtek/hal_pins_realtek.c":
    
    const char* HAL_PIN_GetPinNameAlias(int index)
    {
       if(index >= g_numPins)
          return "error";
       return g_pins[index].name;
    }
    


    How can this happen here with "src/hal/realtek/rtl87x0c/hal_pins_rtl87x0c.c"

    rtlPinMapping_t g_pins[] = {
       { "PA0 (RX1)",   PA_0,   NULL, NULL },
       { "PA1 (TX1)",   PA_1,   NULL, NULL },
       { "PA2 (RX1)",   PA_2,   NULL, NULL },
       { "PA3 (TX1)",   PA_3,   NULL, NULL },
       { "PA4",      PA_4,   NULL, NULL },
       { "PA5",      PA_5,   NULL, NULL },
       { "PA6",      PA_6,   NULL, NULL },
       { "PA7",      PA_7,   NULL, NULL },
       { "PA8",      PA_8,   NULL, NULL },
       { "PA9",      PA_9,   NULL, NULL },
       { "PA10",      PA_10,   NULL, NULL },
       { "PA11",      PA_11,   NULL, NULL },
       { "PA12",      PA_12,   NULL, NULL },
       { "PA13 (RX0)",   PA_13,   NULL, NULL },
       { "PA14 (TX0)",   PA_14,   NULL, NULL },
       { "PA15 (RX2)",   PA_15,   NULL, NULL },
       { "PA16 (TX2)",   PA_16,   NULL, NULL },
       { "PA17",      PA_17,   NULL, NULL },
       { "PA18",      PA_18,   NULL, NULL },
       { "PA19",      PA_19,   NULL, NULL },
       { "PA20",      PA_20,   NULL, NULL },
       { "PA21",      PA_21,   NULL, NULL },
       { "PA22",      PA_22,   NULL, NULL },
       { "PA23",      PA_23,   NULL, NULL },
    };
    
    int g_numPins = sizeof(g_pins) / sizeof(g_pins[0]);


    Added after 1 [hours] 38 [minutes]:

    Must be some recent change - after looking at your screenshot I tried 1.18.31 and it works. Will try to find the version breaking it.

    Added after 14 [minutes]:

    It's broken from .32 to .33 will check further
  • #15 21441050
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Thanks, great!
    I wasn't that fast, but at least I was near ;-)

    Pins can be configured (to be exact, configuring a role worked before even with the missing description) and work again:


    Screenshot of the OpenRTL87XOC interface showing DS18B20 sensor information and configuration options.

    Thanks for your all your work!
  • #16 21441103
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    Hey is multi-DS18B20 available in the main tree, or is it something that I forgot to merge? Sorry, I'm just a one person, I've barely managed to do BK7238 testing today
    Helpful post? Buy me a coffee.
  • #17 21441163
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Thats my private branch I'm currently working on. Atm it's possible to have multiple sensors and even multiple GPIOs and adding a name and channel per sensor with a command, but I'm not yet satisfied with it and will do some more testing and coding. If you're interested, you might take a look here:
    https://github.com/MaxineMuster/OpenBK7231T_App/tree/1820full_3
    (Since I enabled local workflows, too, you can also download the latest firmwares from the actions here: https://github.com/MaxineMuster/OpenBK7231T_App/actions/runs/13347992548)
  • #18 21441231
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    I would really love to have your changes merged, they look interesting
    https://github.com/MaxineMuster/OpenBK7231T_A...mmit/301b625620a9b7a61b3d92bea71bd4092581a998
    let me know if there is something specific that I can check out, I don't have time for a generic testing unless you'll request checking of given feature specifically.

    Will this also have a sensor scan?
    Helpful post? Buy me a coffee.
  • #19 21441320
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    post edited. previous message was meant to be a pvt message

    I can help with small specific targeted testing :)
  • #20 21441375
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    No complaints @p.kaczmarek2 , I know about the limited time and capabilities of one person only too well. So you can be sure I'll give a hint if I ever feel you didn't see something I would expect you should be aware of ;-).
    Maybe we can/should split this DS1820 related stuff to a different thread? There are some things about what and how to implement details I would love to discuss with others users.
    This driver is the extended version of the DS18B20 driver you, @divadiow (and others?) added to the repository just before I came with the "simple" driver. So the code e.g for scanning the bus for sensors and so on was there, I only moved some stuff to a separate file for code shared between the two drivers and added code to use the functions present in an OBK driver.
  • #23 21471484
    setum
    Level 7  
    Posts: 15
    Help: 2
    Rate: 3
    Looks like an ESP32-C3 can be used as a Bluetooth Proxy with ESPHome, which is much cheaper. Check here: https://digiblur.com/wiki/ha/esphome-bluetooth-proxy-esp32c3/

    I have a few ESP32-C3 SuperMini lying around, I'll try this out there (in a few days) and report.

    Added later: It works, as a dumb bluetooth passthrough. ESP32-C3 SuperMini accepts the bluetooth signal (also 2.4GHz) and passes it on to Home Assistant which handles interfacing with device (add, remove, control etc...).

Topic summary

✨ The discussion centers on the Tuya TYBL1 Bluetooth Gateway and related devices based on the Realtek CR3L/RTL8720CM chipset, including variants like GW003-BLE / RSH-GW001-V1.1 and NH-BLE-WIFI-GW V1.0.8. Users explore hardware differences, firmware dumping challenges, and attempts to run OpenBeken (OBK) firmware on these gateways. Partition tables, boot logs, and firmware backup details are shared, highlighting the use of default encryption and hash keys. Issues with pin configuration in OBK due to missing source file inclusion were identified and resolved by updating the build system. The conversation also touches on the presence of multiple Bluetooth gateway types, including Zigbee hubs with Bluetooth modules, and the potential for BK7231-based gateways. Development efforts include extended DS18B20 sensor support with multi-sensor and multi-GPIO capabilities, with ongoing testing and pull requests to improve timing and sensor scanning. Alternative solutions such as using ESP32-C3 as a Bluetooth proxy with ESPHome are mentioned as cost-effective options for Bluetooth device integration with Home Assistant. Overall, the thread provides detailed technical insights into hardware variants, firmware manipulation, open-source firmware adaptation, and sensor integration for Tuya Bluetooth gateways and similar devices.
Generated by the language model.

FAQ

TL;DR: For Tuya TYBL1 and similar CR3L gateways, a verified 4 MB flash backup, UART download access, and a tested restore path matter most. As one poster put it, "All 3 dumps boot and pair." This FAQ helps firmware modders back up, read logs, and flash OBK on RTL8720CM/AmebaZ2 Bluetooth gateways without losing recoverability. [#21413940]

Why it matters: These gateways look simple, but their dual-image firmware layout, UART modes, and tool quirks decide whether a mod is reversible or a brick.

Option What it was used for in the thread Result Main caveat
CH341 + NeoProgrammer Raw SPI flash dump of BY25Q32 Successful 4 MB read, CRC32 verified Requires clip or desolder access
ltchiptool + CH340 UART adapter Dumping/flashing via module UART Worked, but one CH340 gave I/O errors Adapter quality mattered
AmebaZ2 PG Tool Reflashing saved dumps All 3 saved images booted and paired Needs correct Realtek target flow

Key insight: Treat the CR3L gateway as a Realtek RTL8720CM dual-image device first, and a Tuya product second. Once you have a clean backup and know the boot pins, experimentation becomes much safer. [#21413940]

Quick Facts

  • The dumped SPI flash identified as BY25Q32, rated 32 Mbits / 4 Mbytes at 3.3 V, and NeoProgrammer reported CRC32 = 0xE63F24B4 after a successful read. [#21413940]
  • The boot log exposed a Tuya build for rtl8720cm_ameba, with firmware 1.17.5 compiled on Oct 12 2024 17:09:50 and product key key7mn9kc48xep73. [#21413940]
  • The partition table showed two firmware slots, each 0x1AC000 bytes, with Boot at 0x004000 and active slot metadata stored separately. [#21423978]
  • One OBK status line on RTL8720CM reported free 4297224 bytes of heap, showing unusually large memory headroom for experiments. [#21439662]
  • A later OTA path in the thread showed a device on v1.4.2 offering upgrade to v1.13.1, confirming that hardware family and firmware revision do not always track intuitively. [#21790884]

How do I put a Tuya TYBL1 CR3L/RTL8720CM gateway into UART download mode, and which pins need to be pulled high?

Pull A_13/RX and A_0 high to enter UART download mode on the CR3L module. The poster also noted an edge case: on their ESP adapter, only A_0 needed to be pulled high. A practical 3-step method is: 1. expose the CR3L pads, 2. pull A_0 high, and if needed also A_13/RX, 3. power the module and connect your UART tool. That is the download path, not the normal log output path. [#21413940]

What is the CR3L module in Tuya Bluetooth gateways, and how is it related to the Realtek RTL8720CM/AmebaZ2 platform?

The CR3L is the Tuya radio module used in these gateways, and the thread ties it directly to Realtek RTL8720CM / AmebaZ2. "CR3L" is a Tuya Wi‑Fi/BLE module category that hosts the gateway firmware, exposes UART and GPIO pads, and in this thread runs builds tagged rtl8720cm_ameba. The boot log explicitly says gw_module is CR3L and the successful OBK flash used the realtek-ambz2 target. [#21413940]

Why does a Tuya TYBL1 boot log show two firmware slots like Fw1 and Fw2, and how does the dual-image partition table work?

It shows two slots because the device stores Fw1 and Fw2 as separate bootable images. The partition table listed Boot at 0x004000, Fw1 at 0x010000, and Fw2 at 0x1BC000, with each firmware partition sized 0x1AC000 bytes. The boot log then selects one slot using validity and serial-number metadata, such as "fw2 USE, return sn 1". That layout supports rollback or staged updates without overwriting the only image. [#21423978]

Which tools work best for backing up and restoring Tuya TYBL1 firmware: CH341 with NeoProgrammer, ltchiptool, or AmebaZ2 PG Tool?

All three worked, but each served a different role. CH341 with NeoProgrammer gave a confirmed raw SPI dump, ltchiptool worked for UART-based dumping and flashing when the adapter cooperated, and AmebaZ2 PG Tool successfully restored the saved images. The strongest recovery evidence is that all 3 dumps booted and paired when flashed back using AmebaZ2 PG Tool. Use CH341 for safest archival backup, then use UART tools for faster iteration. [#21413940]

What steps are involved in dumping the SPI flash from a Tuya Bluetooth gateway and verifying that the backup is valid?

The thread used a simple hardware-first workflow. 1. Connect a CH341 Black programmer to the flash, detected as BY25Q32 [3.3V] 32 Mbits, 4 Mbytes. 2. Read the full main memory in NeoProgrammer and record the CRC32, which was 0xE63F24B4. 3. Reflash the saved image with AmebaZ2 PG Tool and confirm the unit still boots and pairs. That final restore test is the strongest validation. [#21413940]

Why would ltchiptool give I/O errors with one CH340 adapter but work with another when dumping a CR3L gateway?

Because the UART adapter itself was the failure point in at least one test. One poster said it took too much time to dump with ltchiptool because they got only I/O errors, then switching from one CH340 adapter to another made it work immediately. That points to adapter quality, wiring tolerance, or USB-UART stability rather than a CR3L limitation. If ltchiptool fails repeatedly, swap the adapter before changing firmware settings. [#21440797]

How can I flash OpenBeken (OBK) onto a Tuya CR3L Bluetooth gateway, and what command line was used successfully in the thread?

Flash it over UART as a Realtek AmebaZ2 target. The exact command reported as successful was: ltchiptool flash write -f realtek-ambz2 ~/Downloads/OpenRTL87X0C_1.18.41.bin. "OBK" is open-source device firmware that replaces stock Tuya firmware, adds local control features, and in this thread was tested on RTL87x0C/RTL8720CM gateways. The poster showed it installed on an NH-BLE-WIFI-GW V1.0.8 board after changing CH340 adapters. [#21440797]

What does OBK mean in the context of Tuya gateway hacking, and how much free heap was reported on RTL8720CM after flashing it?

OBK means OpenBeken, the alternative firmware being tested on these Tuya gateways. After flashing it on a CR3L-based RTL8720CM device, one status line reported free 4297224 bytes of heap. That is unusually high headroom for embedded experiments and is why the poster said "A LOT of free heap available with OBK." The same post said the port appeared to work out of the box without extra SRAM mapping changes. [#21439662]

Why does the pin configuration page show only "error" on RTL87x0C builds, and what changed between OBK 1.18.31 and later versions?

It showed "error" because later RTL87x0C builds lost the pin-name mapping file from the build, even though pin roles could still work underneath. The tester verified that 1.18.31 worked, then narrowed the regression to .32 to .33. That means the breakage affected pin labels in the configuration page, not necessarily GPIO functionality itself. This is a classic UI-layer failure case: wrong metadata, working hardware. [#21440852]

How was the missing pin-name issue on Realtek RTL87x0C fixed in OpenBeken, and which source file or pull request addressed it?

It was fixed by restoring the missing Realtek pin file to the build. The thread identified the root cause as hal_pins_realtek.c not included in OpenBeken.mk, and the proposed fix was submitted as pull request #1536. After that, the tester confirmed the pins could be configured and shown correctly again. The issue affected naming and page display, not the underlying GPIO table in hal_pins_rtl87x0c.c. [#21441046]

What is UART DL mode on Tuya/Realtek modules, and how is it different from reading the normal boot log on TXLOG?

UART DL mode is the download/programming mode, while TXLOG is the normal serial debug output. In the thread, A_16_UART_TXLOG carried the Tuya boot log, including lines like == Boot Loader == and build dates. By contrast, entering UART DL mode required pulling boot pins high before power-up so tools could read or write firmware. One mode is passive observation; the other is active flashing access. [#21413940]

Are there any Beken-based Tuya Bluetooth gateways, such as BK7231 models, and how would they compare with CR3L-based devices?

The thread did not confirm any Beken-based Tuya Bluetooth gateway. One participant asked about BK7231 models, and the reply was essentially that none had been seen yet, although "There must be some type BK7231 bluetooth gateway somewhere." So the comparison stayed hypothetical. By contrast, several actual gateways in the thread used CR3L modules on Realtek hardware, including multiple board variants and even a mislabeled Zigbee product. [#21418043]

Tuya CR3L Bluetooth gateway vs ESP32-C3 Bluetooth Proxy with ESPHome — which is better for Home Assistant and cheaper to deploy?

For a simple Home Assistant Bluetooth proxy, the thread suggests ESP32-C3 is cheaper and easier. One poster noted that an ESP32-C3 SuperMini with ESPHome worked as a "dumb bluetooth passthrough" and said it was much cheaper than Tuya gateways. The Tuya CR3L gateway matters more if you want to study Tuya firmware, keep stock pairing behavior, or repurpose gateway hardware. For pure proxy duty, the ESP32-C3 route looked more practical. [#21471484]

How does a Tuya Bluetooth gateway actually bridge Bluetooth devices to the cloud over Wi‑Fi, and what kinds of devices is it meant to support?

It bridges nearby Bluetooth or Bluetooth Mesh devices to Tuya services over Wi‑Fi. The clearest evidence is the boot log and later JSON, which identify a Bluetooth Mesh(SIG) wireless gateway, show BLE stack startup, and expose gateway product data such as model W-BG003 and category wg2. In practical terms, the thread treated it as the missing link between Tuya Bluetooth devices and the cloud, including Bluetooth-only bulbs and mesh subdevices. [#21790884]

What work would be needed to add Bluetooth or BLE gateway support to OpenBeken, including support for Tuya Bluetooth-only bulbs and mesh devices?

It would take more than basic flashing because the gateway must handle BLE pairing, device management, and likely mesh functions. The thread shows interest, but also the challenge: questions were raised about supporting Bluetooth-only bulbs, adding BLE to OBK, and whether BLE would consume too much space. Stock logs already show BLE slave, BLE coexist, and MeshProvisioner paths, so matching stock behavior means implementing more than simple GPIO control. The hardware has memory headroom, but the software stack is the real work. [#21418043]
Generated by the language model.
ADVERTISEMENT