logo elektroda
logo elektroda
X
logo elektroda

Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide

DeDaMrAz 936 17
ADVERTISEMENT
  • Helpful post
    #1 21588187
    DeDaMrAz
    Level 20  
    This is supposed to be a WIP thread for converting a Smart Gateway, Model: RSH-GW006 to OBK

    Purpose is to create a centralized place with descriptions, tools, files and setup for full conversion.

    AliExpress link for the device in question - https://www.aliexpress.com/item/1005005591253403.html

    Teardown pictures of the device:

    Device has 4 small screws hidden under the rubber feet

    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide

    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide
    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide
    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide
    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide

    Board pinout:

    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide

    Board schematic:

    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide

    IMPORTANT!!! in order to set the WBRG1 module into download/bootloader mode, connect UART (GND, 3V3, Rx and Tx) to P1 , pull ENABLE pin to GND, pull LogTX pin to GND via 2k2-4k7 resistor, disconnect ENABLE pin, then disconnect the resistor from LogTX line - device will be in bootloader mode!!

    Tools:

    Python tool, to download a full backup of firmware, named RTL872xDx python tool.rar attached.
    Put the device in download mode and run fr_ff.cmd. If you are having problems with error "import serial" edit rf_ff.cmd from:

    python rtltool.py -p COM5 -b1000000 rf 0 0x8000000 ff.bin


    to

    py -3.12 rtltool.py -p COM5 -b1000000 rf 0 0x8000000 ff.bin


    where 3.12 is the python installation you have on your machine. To find that out open up command prompt (aka CMD) and type "python -V" also play around with number after -b (for baud rate) to see which one will work for you, everything up to 1500000 should work (!?!) This will provide you with full module backup in case you want to revert back if anything goes wrong. ff.bin is the output file and it should be 8Mb after the script is done. (note this is a windows version of instructions obviously change COM5 to whatever COM port you are using, on linux it will be /dev/ttyS0 for example or again whatever you are using)

    AmebaD image tool named Ameba-ImageTool_v2.3.2_AmebaD.zip attached. Use the latest build file and add it to the first field as in the picture, don't change anything else, put the device in bootloader mode and click "Download" button. Reboot the device afterwards and it will should appear in you WiFi list as every OBK device does. Connect to it and via address 192.168.4.1 configure to your needs.

    Pin setup for OBK:

      ],
      "pins": {
        "25": "LED;1",
        "54": "WifiLED;0",
        "55": "Btn_n;0"
      },


    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide

    Simplicity commander for flashing ZS3L module via J-Link (also attached) - https://www.silabs.com/documents/public/software/SimplicityCommander-Windows.zip

    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide

    J-Link Pinout and link for first AliExpress listing if you need one - https://www.aliexpress.com/item/1005006412575470.html

    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide

    Another method to flash ZS3L is with universal-silabes-flasher that can be found here (also attached) - https://github.com/NabuCasa/universal-silabs-flasher

    universal-silabs-flasher --device socket://<OBK_IP>:8888 flash --firmware zs3l_zigbee_ncp_8.2.0.0_115200.gbl


    ***I tried all possible combinations and tools but could not flash ZS3L via UART, if I find the solution I will update the post.

    Files:

    Latest build can be found here, look for RTL8720D UART flash - https://github.com/openshwprojects/OpenBK7231T_App/releases/

    TESTED - ZS3L FW 8.0.2.0 located here - https://www.elektroda.com/rtvforum/download.php?id=1253241

    UNTESTED newer firmware's attached and named

    firmware-build-zs3l_zigbee_ncp_8.1.1.0_115200.zip
    and
    firmware-build-zs3l_zigbee_ncp_8.2.0.0_115200.zip

    After flashing:

    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide


    WBRG1 unpaired boot log caputure:

    [TY BOOT2] Images check crc ok, run to application
    
    
    #example_sw_pta_init success.
    
    sys_thread_new CreatedTask:0x21235a0
    
    interface 0 is initialized
    
    interface 1 is initialized
    
    
    
    Initializing WIFI ...Into tuya config loade.
    
    [01-01 18:12:15 TUYA D][uf_flash_file_app.c:215] uf shrink...
    
    [01-01 18:12:15 TUYA I][mqc_app.c:350] mqc app init ...
    
    [01-01 18:12:15 TUYA I][uni_thread.c:228] thread_create name:sys_timer,stackDepth:4096,totalstackDepth:4096,priority:5
    
    [01-01 18:12:15 TUYA I][uni_thread.c:228] thread_create name:cmmod,stackDepth:5120,totalstackDepth:9216,priority:4
    
    [01-01 18:12:15 TUYA D][mqc_app.c:144] mq_pro:5 cnt:1
    
    [01-01 18:12:15 TUYA D][mqc_app.c:144] mq_pro:31 cnt:2
    
    [01-01 18:12:15 TUYA D][svc_online_log.c:295] svc online log init success
    
    [01-01 18:12:15 TUYA D][log_seq.c:887] read m:1 f:0 l:0
    
    [01-01 18:12:15 TUYA I][uni_thread.c:228] thread_create name:wk_th-0,stackDepth:5120,totalstackDepth:14336,priority:3
    
    [01-01 18:12:15 TUYA E][ws_db_gw.c:80] wd_protected_read fails gw_bi -23
    
    [01-01 18:12:15 TUYA D][ws_db_gw.c:208] gw base read finish:-23
    
    [01-01 18:12:15 TUYA D][tuya_bt_sdk.c:92] ty bt cmmod regist ok:1
    
    [01-01 18:12:15 TUYA D][tuya_ble_api.c:312] upd adv para, send conn_req beacon.
    
    [TOS_NOTICE]tuya_os_adapt_param_init mode:0x01
    
    [TOS_DBG]tuya_os_adapt_bt_mode_set ability 0x1 enable, force:1, real_bt_mode:0x1, expect_bt_mode:0x1
    
    [01-01 18:12:15 TUYA N][tuya_ble_api.c:647] ble sdk re_inited
    
    [01-01 18:12:15 TUYA D][tuya_ble_active.c:523] bt active init
    
    [01-01 18:12:15 TUYA N][tuya_bt_sdk.c:141] ty bt sdk init success finish
    
    
     zigbee_boot_pin(TY_GPIOB4) init output high.
    
    
    
    WIFI initialized
    
    
    
    init_thread(58), Available heap 0x28d620[01-01 18:12:15 TUYA D][uni_thread.c:250] Thread:sys_timer Exec Start. Set to Running Stat
    
    [01-01 18:12:15 TUYA D][uni_thread.c:250] Thread:cmmod Exec Start. Set to Running Stat
    
    [01-01 18:12:15 TUYA D][uni_thread.c:250] Thread:wk_th-0 Exec Start. Set to Running Stat
    
    [01-01 18:12:15 TUYA N][uni_log.c:197] SetLogManageAttr 2
    
    [01-01 18:12:15 TUYA N][tuya_device.c:155] SDK INFO: < TUYA IOT SDK V:3.1.8 BS:40.00_PT:2.2_LAN:3.4_CAD:1.0.4_CD:1.0.0 >
    
    < BUILD AT:2023_12_11_11_03_30 BY ci_manage FOR ty_iot_gw_wr_wf_sdk AT rtl8720dn >
    
    IOT DEFS < WIFI_GW:1 DEBUG:1 KV_FILE:0 SHUTDOWN_MODE:0 LITTLE_END:1 TLS_MODE:2 ENABLE_CLOUD_OPERATION:0 OPERATING_SYSTEM:98 ENABLE_SYS_RPC:0 RELIABLE_TRANSFER:1 ENABLE_LAN_ENCRYPTION:1 ENABLE_LAN_LINKAGE:1 ENABLE_LAN_DEV:1 >
    
    
    [01-01 18:12:15 TUYA N][tuya_device.c:156] SDK_ID: TuyaOS2.3.2_ty_iot_gw_wr_wf_sdk_feature-3.1.8-beta.28_rtl8720dn_mini_muli_gw_config_uf_1.0.70-beta.10
    
    [01-01 18:12:15 TUYA N][tuya_device.c:157] [keym557nqw3p8p7m 8721csm_bt_zg_gw 1.7.2] at Dec 11 2023 15:19:06
    
    [01-01 18:12:15 TUYA N][tuya_device.c:158] subdev_max_cnt[128]
    
    [01-01 18:12:15 TUYA N][tuya_device.c:142] ble version:bluetooth_mgr:1.2.2-beta.105 1
    
    [01-01 18:12:15 TUYA N][simple_flash.c:459] key_addr: 0x7d7000   block_sz 4096
    
    [01-01 18:12:15 TUYA N][simple_flash.c:548] get kvs:
    
    0x8c 0xea 0xc 0x12 0xe5 0x43 0xd8 0xba 0xe8 0xbd 0x74 0xe7 0x7a 0xdc 0x1 0xc6 
    
    [01-01 18:12:16 TUYA N][tuya_main.c:272] mf_init succ
    
    [01-01 18:12:16 TUYA N][tuya_main.c:273] firmware compiled at Dec 11 2023 15:19:04
    
    [01-01 18:12:16 TUYA N][tuya_device.c:173] cad_ver:1.0.4,sw_ver:1.7.2
    
    [01-01 18:12:16 TUYA E][tuya_gw_prod_test_auth_info.c:553] wd_common_read tptk_mac_need_update ret:-6
    
    [01-01 18:12:16 TUYA E][tuya_gw_prod_test_auth_info.c:31] need not update wifi mac. has not prodtest
    
    
    [01-01 18:12:16 TUYA E][tuya_ws_db.c:728] kvs_read err:-6
    
    [01-01 18:12:16 TUYA E][tuya_device.c:217] read mf config fail! set to default!
    
    [01-01 18:12:16 TUYA N][user_led.c:458] led_hardware_init,pin -> TY_GPIOA25
    
    [01-01 18:12:16 TUYA N][user_led.c:458] led_hardware_init,pin -> TY_GPIOB22
    
    [01-01 18:12:16 TUYA N][tuya_gw_mgr.c:1014] current gw_cap_full_attr: 0x00000002
    
    [01-01 18:12:16 TUYA N][user_key.c:91] key_init success,key pin -> TY_GPIOB23
    
    [01-01 18:12:16 TUYA N][tuya_device.c:255] WatchDog init OK!
    
    [01-01 18:12:16 TUYA N][tuya_device.c:258] tuya_z3_intf_init......
    
    [01-01 18:12:16 TUYA E][tuya_iot_ext_api.c:168]  /tuya/engineer_dev_flag.ini is not exist
    
    [01-01 18:12:16 TUYA N][rcd_flash_app.c:701] maxlen 131072, pagesz 64, sec_num :1, 5 65535 0 
    
    
    bit map len[32] 0xe0 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
    
    [01-01 18:12:16 TUYA N][rcd_flash_app.c:701] maxlen 131072, pagesz 64, sec_num :1, 6 65535 0 
    
    
    bit map len[32] 0xe0 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
    
    [01-01 18:12:16 TUYA N][rcd_flash_app.c:701] maxlen 131072, pagesz 64, sec_num :1, 7 65535 0 
    
    
    bit map len[32] 0xe0 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
    
    [01-01 18:12:16 TUYA N][tuya_z3_uf_file.c:68] =====devFileInit=====
    
    
    [01-01 18:12:16 TUYA N][af-main-host.c:659] >>>Normal UART bootup with FLOWCTRL<<<
    
    rsy value=5srsy value=2srsy value=1srsy value=5srsy value=2srsy value=2srsy value=2srsy value=7680srsy value=30srsy value=32768srsy value=1srsy value=30000srsy value=32srsy value=16srsy value=10srsy value=32srsy value=120srsy value=12srsy value=250srsy value=8srsy value=0srsy value=65408srsy value=180s------------0000000000emAfTaskId:0
    
    [01-01 18:12:18 TUYA E][uf_flash_file_app.c:300] uf_open devices.txt err 8
    
    [01-01 18:12:18 TUYA N][device-table.c:944] read devices.txt
    
    [01-01 18:12:18 TUYA E][device-table.c:951] ufopen devices txt error
    
    [01-01 18:12:18 TUYA E][uf_flash_file_app.c:300] uf_open zb_up_file_num err 8
    
    [01-01 18:12:18 TUYA E][ota-storage-linux.c:383] fail to open upgrade number flag file.
    
    [01-01 18:12:18 TUYA E][uf_flash_file_app.c:300] uf_open zb_up_file_num err 8
    
    [01-01 18:12:18 TUYA E][ota-storage-linux.c:383] fail to open upgrade number flag file.
    
    [01-01 18:12:19 TUYA N][tuya_gw_mgr.c:710] current gw_protocol_full_attr: 0x00000002
    
    [01-01 18:12:19 TUYA N][tuya_gw_mgr.c:710] current gw_protocol_full_attr: 0x00000002
    
    [01-01 18:12:19 TUYA N][tuya_device.c:271] tuya_z3_intf_init success.
    
    [01-01 18:12:19 TUYA N][tuya_device.c:276] tuya_z3_intf_get_coo_ver success[2.4.1]
    
    [01-01 18:12:19 TUYA N][tuya_gw_pt_app.c:428] tuya_testframe_register_uart_func success
    
    PT DEBUG:[tuya_prod_test.c]:[tuya_prodtest_print_sdkInfo:1893]:###########################################
    
    PT DEBUG:[tuya_prod_test.c]:[tuya_prodtest_print_sdkInfo:1894]:###########################################
    
    PT DEBUG:[tuya_prod_test.c]:[tuya_prodtest_print_sdkInfo:1895]:#######PROTOCOL VERSION:1.0.0##############
    
    PT DEBUG:[tuya_prod_test.c]:[tuya_prodtest_print_sdkInfo:1896]:#######SDK      VERSION:1.0.2##############
    
    PT DEBUG:[tuya_prod_test.c]:[tuya_prodtest_print_sdkInfo:1897]:###########################################
    
    PT DEBUG:[tuya_prod_test.c]:[tuya_prodtest_print_sdkInfo:1898]:###########################################
    
    PT DEBUG:[tuya_prod_test.c]:[tuya_prodtest_init:2014]:####tuya_prodtest_init success####
    
    
    [01-01 18:12:19 TUYA W][tuya_gw_pt_app.c:129] #####PRODTEST UART REV TIMEOUT
    
    PT DEBUG:[tuya_prod_test.c]:[tuya_prodtest_thread_process:1871]:***************TUYA TEST THREAD EXIT****************
    
    PT DEBUG:[tuya_prod_test.c]:[tuya_prodtest_deinit:2037]:####tuya_prodtest_deinit process####
    
    
    [TOS_DBG]set_wifi_work_mode:2
    
    
    
    
    LwIP_DHCP: dhcp stop.
    
    
    Deinitializing WIFI ...
    
    
    WIFI deinitialized
    
    
    Initializing WIFI ...
    
    
    WIFI initialized
    
    [TOS_DBG]tuya_os_adapt_bt_stack_init:0x01
    
    
    
    
    BT BUILD Date: 2023/12/11-15:18:12 
    
    
    BT Reset...
    
    
    physical efuse: has data hci_tp_phy_efuse[1]= 9e 
    
    
    
    hci_tp_phy_efuse[0]=0,
    
    
    bt_iqk_dump:    DUMP,
    
    
    the IQK_xx  data is 0xe8,
    
    
    the IQK_yy  data is 0x3fc,
    
    
    the QDAC  data is 0x23,
    
    
    the IDAC  data is 0x20,
    
    
    hci_read_rom_check: rom_version 0x0002, bt_hci_chip_id 0x0003
    
    
    BT ADDRESS: f8:17:2d:43:99:a3
    
    
    
     WRITE  physical FLATK=tx_flatk=ff 
    
    
    Set baudrate to 921600
    
    
    
    hci_tp_config:BT INIT success 7
    
    
    Start upperStack
    
    [TOS_DBG]bt_dev_state_evt init:1, adv:0, scan:0, cause:0x0
    
    
    [TOS_DBG][BLE peripheral] GAP stack ready
    
    
    
    [TOS_DBG]le_adv_start success
    
    [TOS_DBG]bt_dev_state_evt init:1, adv:1, scan:0, cause:0x0
    
    
    [TOS_DBG]bt_dev_state_evt init:1, adv:2, scan:0, cause:0x0
    
    
    [TOS_DBG]GAP adv start
    
    
    [01-01 18:12:21 TUYA N][tuya_main.c:207] current product ssid name:tuya_zg_bt_gw_scan
    
    [TOS_ERR]not find scan ssid (tuya_zg_bt_gw_scan)
    
    
    [TOS_DBG]not connected yet
    
    [TOS_DBG]tuya_os_adapt_bt_mode_set ability 0x4 enable, force:1, real_bt_mode:0x5, expect_bt_mode:0x5
    
    [TOS_DBG]tuya_os_adapt_bt_mode_set ability 0x2 enable, force:1, real_bt_mode:0x7, expect_bt_mode:0x7
    
    [01-01 18:12:22 TUYA N][tuya_gw_mgr.c:710] current gw_protocol_full_attr: 0x00000043
    
    [01-01 18:12:22 TUYA N][tuya_gw_mgr.c:1014] current gw_cap_full_attr: 0x00000003
    
    [01-01 18:12:22 TUYA N][tuya_gw_mgr.c:710] current gw_protocol_full_attr: 0x0000004b
    
    [01-01 18:12:22 TUYA N][tuya_device.c:344] --> tuya_bluetooth_srv_init success, support beacon dev.
    
    [01-01 18:12:22 TUYA N][user_home_security.c:184] --> user_home_security_init success
    
    [01-01 18:12:22 TUYA N][user_app.c:334] get local.dbglog fail
    
    [01-01 18:12:22 TUYA E][tuya_device.c:359] call user_app_load_debug_file() return -6
    
    [01-01 18:12:22 TUYA N][rcd_flash_app.c:701] maxlen 131072, pagesz 64, sec_num :1, 8 65535 0 
    
    
    bit map len[32] 0xe0 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
    
    [01-01 18:12:22 TUYA N][rcd_flash_app.c:701] maxlen 131072, pagesz 64, sec_num :1, 9 65535 65535 
    
    
    bit map len[32] 0xe0 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
    
    boot_reason : 180000 
    
    [01-01 18:12:22 TUYA N][tuya_devos_entry.c:1798] Last reset reason: 170
    
    [01-01 18:12:22 TUYA N][tuya_devos_entry.c:1162] serial_no:f8172d4399a3
    
    [01-01 18:12:22 TUYA N][tuya_devos_entry.c:1193] gw_cntl.gw_wsm.stat:1
    
    [01-01 18:12:22 TUYA N][tuya_devos_netcfg.c:1345] gw_cntl->gw_wsm.nc_tp:2
    
    [01-01 18:12:22 TUYA N][tuya_devos_netcfg.c:1346] gw_cntl->gw_wsm.md:0
    
    [01-01 18:12:22 TUYA N][tuya_devos_entry.c:1252] gw_cntl.gw_if.abi:1 input:1
    
    [01-01 18:12:22 TUYA N][tuya_devos_entry.c:1254] gw_cntl.gw_if.tp:0, input:0
    
    [01-01 18:12:22 TUYA E][rcd_flash_app.c:1271] __read_entry_with_key fail. -10114
    
    [01-01 18:12:22 TUYA E][gw_kv_db.c:116] rcd_entry_kv_read fails lp_off_dev -10114
    
    [01-01 18:12:22 TUYA E][subdev_sigmesh.c:1319] sigmesh key null
    
    [01-01 18:12:22 TUYA N][tuya_bt_sdk.c:162] ty bt upd product:keym557nqw3p8p7m 1
    
    [01-01 18:12:22 TUYA N][tuya_device.c:373] --> tuya_gw_srv_init_wf success
    
    [01-01 18:12:22 TUYA N][tuya_device.c:377] --> tuya_iot_reg_get_wf_nw_stat_cb success.
    
    [TOS_DBG]set_wifi_work_mode:3
    
    
    [TOS_DBG]tuya_os_adapt_bt_stack_deinit
    
    
    bt_main_task_del_in_task
    
    [01-01 18:12:22 TUYA N][tuya_ble_api.c:482] Ble Disonnected
    
    [01-01 18:12:22 TUYA N][tuya_ble_data_handler.c:64] ble reset sn
    
    [01-01 18:12:22 TUYA N][tuya_ble_data_handler.c:78] ble clear pair rand
    
    [01-01 18:12:22 TUYA N][tuya_ble_api.c:1461] ble set conn stat:2
    
    [BT Mesh Provisioner] BT Stack deinitalized
    
    
    
    LwIP_DHCP: dhcp stop.
    
    [rtw coex]: pcoex is null!
    
    
    Deinitializing WIFI ...
    
    
    WIFI deinitialized
    
    
    Initializing WIFI ...
    
    
    WIFI initialized
    
    [TOS_DBG]tuya_os_adapt_bt_stack_init:0x07
    
    
    
    
    BT BUILD Date: 2023/12/11-15:18:12 
    
    
    BT Reset...
    
    >> Hello MeshProvisioner <<
    
    >
    physical efuse: has data hci_tp_phy_efuse[1]= 9e 
    
    
    
    hci_tp_phy_efuse[0]=0,
    
    
    bt_iqk_dump:    DUMP,
    
    
    the IQK_xx  data is 0xe8,
    
    
    the IQK_yy  data is 0x3fc,
    
    
    the QDAC  data is 0x23,
    
    
    the IDAC  data is 0x20,
    
    
    hci_read_rom_check: rom_version 0x0002, bt_hci_chip_id 0x0003
    
    
    BT ADDRESS: f8:17:2d:43:99:a3
    
    
    
     WRITE  physical FLATK=tx_flatk=ff 
    
    
    Set baudrate to 921600
    
    
    
    hci_tp_config:BT INIT success 7
    
    
    Start upperStack
    
    ms addr: 0x0000
    
    >[TOS_DBG]bt_dev_state_evt init:1, adv:0, scan:0, cause:0x0
    
    
    [TOS_DBG]ble mesh use rtl key
    
    [TOS_DBG][BLE peripheral] GAP stack ready
    
    
    
    [TOS_DBG]bt_dev_state_evt init:1, adv:0, scan:1, cause:0x0
    
    
    [TOS_DBG]mesh_le_adv_start
    
    mesh le_adv_start
    
    [TOS_DBG]bt_dev_state_evt init:1, adv:0, scan:2, cause:0x0
    
    
    [TOS_DBG]GAP scan start
    
    
    [TOS_DBG]Start scan
    
    
    
    [TOS_DBG]bt_dev_state_evt init:1, adv:0, scan:3, cause:0x0
    
    
    [TOS_DBG]bt_dev_state_evt init:1, adv:0, scan:0, cause:0x0
    
    
    [TOS_DBG]GAP scan stop
    
    
    [BT_MESH] mesh_provisioner_cmd_thread(): mesh cmd thread enter !
    
    [TOS_DBG]bt_dev_state_evt init:1, adv:0, scan:1, cause:0x0
    
    
    [TOS_DBG]bt_dev_state_evt init:1, adv:0, scan:2, cause:0x0
    
    
    [TOS_DBG]GAP scan start
    
    
    
    wlan1: 1 DL RSVD page success! DLBcnCount:01, poll:00000001
    
    [01-01 18:12:23 TUYA N][tuya_ble_api.c:436] update bound stat:0
    
    [TOS_DBG]mesh_le_adv_start
    
    mesh le_adv_start
    
    [01-01 18:12:23 TUYA N][tuya_ble_api.c:724] ble adv && resp changed
    
    [01-01 18:12:23 TUYA N][device-table.c:855] save table.
    
    [01-01 18:12:23 TUYA N][tuya_device.c:299] __gw_wf_nw_stat_cb:2
    
    [01-01 18:12:23 TUYA N][user_led.c:505] ******* gw wifi_stat:[2]
    
    [01-01 18:12:25 TUYA N][z3_slabs.c:154] nodeEuiStr = c4d8c8fffe004b62.
    
    [01-01 18:12:25 TUYA N][z3_slabs.c:155] nodeId = 0xfffe.
    
    [01-01 18:12:25 TUYA N][z3_slabs.c:156] panId = 0x007d.
    
    [01-01 18:12:25 TUYA N][z3_slabs.c:157] channel = 0x0f.
    
    [01-01 18:12:25 TUYA N][z3_slabs.c:158] ver = 2.4.1.
    
    [01-01 18:12:25 TUYA N][z3_slabs.c:159] netStatus = 0x00.
    
    [01-01 18:12:25 TUYA N][z3_slabs.c:160] extendedPanId: f0c9d05929a0e144
    
    [01-01 18:12:25 TUYA N][z3_slabs.c:161] manufacturerId: 0x2020
    
    [01-01 18:12:25 TUYA N][z3_slabs.c:167] netWorkKey: b6 5f 20 60 ea 58 91 37 67 fa 58 16 c0 f8 1c 63 
    
    
    [01-01 18:12:27 TUYA N][z3_slabs.c:154] nodeEuiStr = c4d8c8fffe004b62.
    
    [01-01 18:12:27 TUYA N][z3_slabs.c:155] nodeId = 0x0000.
    
    [01-01 18:12:27 TUYA N][z3_slabs.c:156] panId = 0xe0de.
    
    [01-01 18:12:27 TUYA N][z3_slabs.c:157] channel = 0x14.
    
    [01-01 18:12:27 TUYA N][z3_slabs.c:158] ver = 2.4.1.
    
    [01-01 18:12:27 TUYA N][z3_slabs.c:159] netStatus = 0x02.
    
    [01-01 18:12:27 TUYA N][z3_slabs.c:160] extendedPanId: 0930a9d15c2e170e
    
    [01-01 18:12:27 TUYA N][z3_slabs.c:161] manufacturerId: 0x2020
    
    [01-01 18:12:27 TUYA N][z3_slabs.c:167] netWorkKey: 8d f8 26 ae 78 5a 87 d9 24 de 87 b5 73 aa 34 23 
    
    
    8d f8 26 ae 78 5a 87 d9 24 de 87 b5 73 aa 34 23 
    
    
    [01-01 18:12:28 TUYA N][device-table.c:757] get partition[TableSave]:0
    
    [01-01 18:12:29 TUYA N][device-table.c:760] write devices1.txt
    
    [01-01 18:12:29 TUYA E][uf_flash_file_app.c:363] uf_write err 1
    
    [01-01 18:12:29 TUYA N][device-table.c:832] ufwrite table fail.
    
    [01-01 18:12:37 TUYA N][tuya_gw_mgr.c:710] current gw_protocol_full_attr: 0x000000cb
    
    [01-01 18:12:37 TUYA N][tuya_gw_beacon_mgmt.c:264] tuya_beacon_dev_mgmt_start success.
    
    [01-01 18:12:37 TUYA E][tyua_gw_bt_comm_http.c:459] ret:-6
    
    [01-01 18:12:37 TUYA E][subdev_sigmesh.c:1428] key is null.
    
    [01-01 18:12:37 TUYA E][tuya_gw_mesh_mgmt.c:182] tuya_iot_sigmesh_get_net_info op_ret:-1
    
    [01-01 18:12:37 TUYA N][tuya_gw_ble_mgmt.c:1365] bt dev join, permit:0 timeout:0,fp_fail_cnt:0
    
    [01-01 18:12:37 TUYA N][user_app.c:214] ble server mgr init ok!
    
    [01-01 18:12:37 TUYA N][tuya_gw_mgr.c:1014] current gw_cap_full_attr: 0x00000007
    
    [01-01 18:12:37 TUYA N][tuya_device.c:420] [free mem:2066368 Bytes, 2066368 Bytes], dev_num:[0,0]
    
    [01-01 18:12:37 TUYA N][tuya_device.c:405] device_init success.start app...
    
    [01-01 18:12:37 TUYA E][tuya_gw_mesh_mgmt.c:724] get net info err:-1
    
    [01-01 18:12:52 TUYA E][subdev_sigmesh.c:1428] key is null.
    
    [01-01 18:12:52 TUYA E][tuya_gw_mesh_mgmt.c:182] tuya_iot_sigmesh_get_net_info op_ret:-1
    
    [01-01 18:12:52 TUYA E][tuya_gw_mesh_mgmt.c:724] get net info err:-1


    autoexec.bat

    startdriver uarttcp 115200 512 1 1
    SetChannelLabel 1 "Bridge Connection"
    SetChannelVisible 1 0
    SetChannelType 1 OpenClosed_Inv



    Setup and basic HA integration:

    Use ZigBee Home Automation (ZHA) integration, it can be found under Setting -> Devices & services -> Add Integration in the bottom right corner of the screen.

    When adding a device for port select:
    tcp://<OBK_IP>:8888

    meaning whatever IP OBK has been assigned by DHCP on your network or if statis IP is set use that
    and if you flashed the latest ZS3L firmware select Hardware flow control, if not leave it as is, default it no selection

    @p.kaczmarek2 feel free to chime in and let's keep this post up to date.

    Special thanks to @insmod for porting OBK to RTL8720D and compiling FW for ZS3L module and @divadiow for testing initial releases!!
  • ADVERTISEMENT
  • Helpful post
    #2 21588192
    insmod
    Level 26  
    >>21588187
    Firmware for WBRG1 is a release version of OpenRTL8720D. Stable, i've got a month uptime.
    Firmware for ZS3L attached. Built with HW flow offload. Can be updated right through TCP (even if not always on the first try).
    My autoexec.bat
    startdriver uarttcp 115200 512 1 1
    SetChannelLabel 1 "Bridge Connection"
    SetChannelVisible 1 0
    SetChannelType 1 OpenClosed_Inv
  • #3 21588392
    DeDaMrAz
    Level 20  
    @insmod

    Any convenient tool you have used for flashing ZS3L module? I got the python script in preparation for WBRG1 module reading/writing that I can share if you can test maybe?

    Also any other useful info to compile this thread better and try to reduce the information fragmentation for this device, is so please share and thanks!!

    Pinging @divadiow to chime in as well with anything he has to add in.

    If you know anybody else who can contribute please ping him as well.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #7 21588713
    DeDaMrAz
    Level 20  
    insmod wrote:
    Not tested. Newer does not mean better.


    Will test of course after reversing the schematic, assembling the device back and capturing initial UART logs.

    Will have to prepare or make user friendly flashing scripts and post them as well.

    I plan to test it on some BLE devices as well does that portion work? (guess not as we don't have any BT stack in OBK but had to ask)
  • #8 21588894
    insmod
    Level 26  
    I tried to get bluetooth working as it was an adapter, connected via UART to Linux PC.
    Without kernel patches, it didn't work. And even with them, it was only shown as connected in hcitool, but nothing worked. Bluetoothctl didn't see it.

    I will later try to add support for BTHome in OBK
  • #9 21589068
    DeDaMrAz
    Level 20  
    insmod wrote:
    I will later try to add support for BTHome in OBK


    BTHome would be a perfect addition for this device.

    Spent entire night troubleshooting communication problems only to discover that 1 out of 11 UART's I have can actually work fine with 1500000bps setting.... 😐
  • #10 21589890
    insmod
    Level 26  
    @DeDaMrAz
    You posted wrong 8.1.1.0 firmware (not for ZS3L).

    I successfully updated my ZS3L via TCP from 8.0.2.0 to 8.2.0.0
    universal-silabs-flasher --device socket://192.168.1.132:8888 flash --firmware zs3l_zigbee_ncp_8.2.0.0_115200.gbl
    2025-06-26 10:59:40.221 DESKTOP-QRMSCIH universal_silabs_flasher.flash INFO Extracted GBL metadata: NabuCasaMetadata(metadata_version=2, sdk_version='2025.6.0', ezsp_version='8.2.0.0', ot_rcp_version=None, cpc_version=None, fw_type=<FirmwareImageType.ZIGBEE_NCP: 'zigbee_ncp'>, fw_variant=None, baudrate=115200)
    2025-06-26 10:59:40.222 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Probing ApplicationType.GECKO_BOOTLOADER at 115200 baud
    2025-06-26 10:59:42.406 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Probing ApplicationType.EZSP at 115200 baud
    2025-06-26 10:59:44.715 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Detected ApplicationType.EZSP, version '8.0.2.0 build 397' (8.0.2.0.397) at 115200 baudrate (bootloader baudrate None)
    2025-06-26 10:59:51.919 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Probing ApplicationType.GECKO_BOOTLOADER at 115200 baud
    2025-06-26 10:59:51.985 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Detected bootloader version '1.9.2'
    2025-06-26 10:59:51.985 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Detected ApplicationType.GECKO_BOOTLOADER, version '1.9.2' at 115200 baudrate (bootloader baudrate 115200)
    zs3l_zigbee_ncp_8.2.0.0_115200.gbl  [####################################]  100%

    My Z2M (2.1.1) version couldn't handle 8.2.0 firmware. After update to 2.4.0 it wasn't fixed.
    [2025-06-26 11:02:20] error:    z2m: Error: Adapter EZSP protocol version (17) is not supported by Host [13-16].

    Works in latest-dev container.

    It can be downgraded with universal-silabs-flasher by adding --allow-downgrades
    universal-silabs-flasher --device socket://192.168.1.132:8888 flash --firmware zs3l_zigbee_ncp_8.1.1.0_115200.gbl --allow-downgrades
    2025-06-26 11:12:05.413 DESKTOP-QRMSCIH universal_silabs_flasher.flash INFO Extracted GBL metadata: NabuCasaMetadata(metadata_version=2, sdk_version='2024.12.2', ezsp_version='8.1.1.0', ot_rcp_version=None, cpc_version=None, fw_type=<FirmwareImageType.ZIGBEE_NCP: 'zigbee_ncp'>, fw_variant=None, baudrate=115200)
    2025-06-26 11:12:05.413 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Probing ApplicationType.GECKO_BOOTLOADER at 115200 baud
    2025-06-26 11:12:07.463 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Probing ApplicationType.EZSP at 115200 baud
    2025-06-26 11:12:09.613 DESKTOP-QRMSCIH bellows.ezsp WARNING Protocol version 17 is not supported, using version 14 instead
    2025-06-26 11:12:09.704 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Detected ApplicationType.EZSP, version '8.2.0.0 build 191' (8.2.0.0.191) at 115200 baudrate (bootloader baudrate None)
    2025-06-26 11:12:11.852 DESKTOP-QRMSCIH bellows.ezsp WARNING Protocol version 17 is not supported, using version 14 instead
    2025-06-26 11:12:16.907 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Probing ApplicationType.GECKO_BOOTLOADER at 115200 baud
    2025-06-26 11:12:16.949 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Detected bootloader version '1.9.2'
    2025-06-26 11:12:16.949 DESKTOP-QRMSCIH universal_silabs_flasher.flasher INFO Detected ApplicationType.GECKO_BOOTLOADER, version '1.9.2' at 115200 baudrate (bootloader baudrate 115200)
    zs3l_zigbee_ncp_8.1.1.0_115200.gbl  [####################################]  100%

    8.1.1.0 works
    8.2.0.0 will be supported in next Zigbee2MQTT update (required changes are already merged in dev branch).
  • Helpful post
    #11 21590140
    DeDaMrAz
    Level 20  
    @insmod

    Thanks for proof reading the post, I've added all the relevant info in the first post as it will be moved once completed and changed the wrongly uploaded file (it was 5AM I got my excuse)

    Btw funny how help section of then universal-silabs-flashed doesn't mention anything about arguments in their help:

    PS C:\Users\DeDaMrAz> universal-silabs-flasher --help
    Usage: universal-silabs-flasher [OPTIONS] COMMAND [ARGS]...
    
    Options:
      -v, --verbose
      --device PATH_OR_URL
      --bootloader-baudrate NUMBERS   [default: 115200]
      --cpc-baudrate NUMBERS          [default: 460800, 115200, 230400]
      --ezsp-baudrate NUMBERS         [default: 115200]
      --router-baudrate NUMBERS       [default: 115200]
      --spinel-baudrate NUMBERS       [default: 460800]
      --probe-method TEXT             [default: bootloader, cpc, ezsp, spinel,
                                      router]
      --bootloader-reset [yellow|ihost|slzb07|rts_dtr|sonoff]
      --help                          Show this message and exit.
    
    Commands:
      dump-gbl-metadata
      flash
      probe
      write-ieee
    PS C:\Users\DeDaMrAz>


    just to add them for future reference here:

    If the provided firmware image type does not match the running image type, the firmware will not be flashed. Cross-flashing can be enabled with 
    --allow-cross-flashing
    If the provided firmware image is a lower version than the currently running image, the downgrade will not be allowed. Downgrades can be enabled with
    --allow-downgrades
    To always upgrade/downgrade firmware to a specific version (i.e. as the entry point for an addon bundling firmware), use:
     --ensure-exact-version
    All of the above logic can be skipped with 
    --force


    I consider this topic completed @p.kaczmarek2 if you think so too you can move it now. Or if any of you @insmod, @divadiow have anything to add feel free and we can update it. Goal was to create a beginner user friendly post with everything in one place and explained somewhat decently.

    Thanks!

    P.S. two more topics I want to add as I am dealing with them right now are adding a BT proxy for HA via ESP32 and eWeLink remote for their BT devices via Tasmota integration.

    BT Proxy teaser picture 🙂

    Photo of an ESP32 on a black breadboard with USB cables, placed on a desk in front of a monitor.
  • #12 21590159
    insmod
    Level 26  
    Single core ESPs, like ESP32-C3 is worse for bluetooth than ESP32 and ESP32-S3. They might miss some advertisements packages.

    I once tried to use ESP32-C2, and it didn't work. As soon as bluetooth turned on, wifi connection was lost. Perhaps it works now, but to even enable it on 2MB device was a pain.

    Pins for my GW
    PA25 is red led (i use it for zigbee connection status, linked to channel 1)
    PB22 is blue led (i use as WifiLED)
    PB23 is button (i use as Btn_n)
  • #13 21590166
    DeDaMrAz
    Level 20  
    >>21590159
    insmod wrote:
    Pins for my GW
    PA25 is red led (i use it for zigbee connection status, linked to channel 1)
    PB22 is blue led (i use as WifiLED)
    PB23 is button (i use as Btn_n)



    Yes I forgot that part, thanks.

    I got several of those small ESP32 boards incoming, so I'll try them all and post results when that thread is created, idea is to hide BT proxy inside (or outside as the board is tiny) a charger that will also power the GW so I got al the devices covered.

    Added after 2 [minutes]:

    @p.kaczmarek2

    BTW I've noticed that the webapp can't set the pin roles at least on this RTL device?

    Added after 2 [hours] 23 [minutes]:

    insmod wrote:
    Single core ESPs, like ESP32-C3 is worse for bluetooth than ESP32 and ESP32-S3. They might miss some advertisements packages.


    I will certainly test that but for now I picked an S3 from the bin and it is working nicely, only draw back is module gets a bit toasty 🙂


    Smart Gateway RSH-GW006 to OBK Conversion: Tools, Files, Setup, and Integration Guide
  • ADVERTISEMENT
  • #14 21590310
    insmod
    Level 26  
    >>21590166 You can underclock it to reduce temperature.
    I have an ESP32-S3 module transplanted onto ESP32-CAM, and at 240mhz it can get up to 85C.
    From what i understand tasmota has CpuFrequency command. Set frequency to 80 or 160mhz if you're worried about temperature.
  • #17 21590341
    DeDaMrAz
    Level 20  
    insmod wrote:
    I don't really know, i don't use tasmota.


    Me neither, the only thing I found was a compile time option for it. Will think of something after tests.
ADVERTISEMENT