logo elektroda
logo elektroda
X
logo elektroda
REKLAMA
REKLAMA
Adblock/uBlockOrigin/AdGuard mogą powodować znikanie niektórych postów z powodu nowej reguły.

Problemy z resetowaniem czujnika PIR Tuya na układzie BK7231N

vitya123 12 Gru 2024 12:52 2847 22
REKLAMA
Treść została przetłumaczona angielski » polski Zobacz oryginalną wersję tematu
  • #1 21345017
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    Mam trudności z moim nowym czujnikiem PIR Tuya:
    Nie mogę go sflashować, ponieważ nie reaguje na reset na pinach CEN ani RST (zgodnie z dokumentacją ). Nie mam żadnego doświadczenia w programowaniu (jako programista) tego układu, ale w świecie ESP jestem przyzwyczajony do resetowania układu, gdy przeciągam pin EN do GND. Ten układ jednak nie reaguje na żadną próbę zresetowania go. Używając narzędzia BK7231Flasher, którego z powodzeniem używałem na kilku innych urządzeniach w niedawnej przeszłości, nie migał:
    Backup name is set to PIR-sensor.
    Starting read!
    Read parms: start 0x00 (sector 0), len 0x200000 (0 sectors)
    Now is: Thursday 12 December 2024 13:45:05.
    Flasher mode: BK7231N
    Going to open port: COM3.
    Serial port open!
    Getting bus... (now, please do reboot by CEN or by power off/on)
    Getting bus failed, will try again - 0/100!
    Getting bus failed, will try again - 1/100!
    
    .
    Nie reaguje ani na CEN pociągnięty do GND, ani na cykliczne włączanie zasilania, jak robią to inne urządzenia.

    Oto oryginalny bootlog dla odniesienia:

    [12:46:42.344] - serial type is general
    [12:46:42.393] - Open COM5 Success
    [12:46:55.820] -
    V:BK7231N_1.0.1
    REG:cpsr     spsr     r13      r14
    SVC:000000D3          00401C1C 000033AC
    IRQ:000000d2 00000010 00401e0c 80069cca
    FIR:000000d1 00000010 00401ffc 70a61b19
    SYS:000000df          0040192c 00000158
    ST:00000000
    J 0x10000
    [12:46:55.989] - [0
    [12:46:55.989] - 1-01 18:12:15 TUYA Info][lr:0xba139] mqc app init ...
    [01-01 18:12:15 TUYA Info][lr:0x9a1f3] thread_create name:sys_timer,stackDepth:4096,totalstackDepth:4096,priority:5
    [01-01 18:12:15 TUYA Info][lr:0x9a1f3] thread_create name:cmmod,stackDepth:4096,totalstackDepth:8192,priority:4
    [01-01 18:12:15 TUYA Debug][lr:0xba0e7] mq_pro:5 cnt:1
    [01-01 18:12:15 TUYA Debug][lr:0xba0e7] mq_pro:31 cnt:2
    [01-01 18:12:15 TUYA Debug][lr:0x9a07f] Thread:sys_timer Exec Start. Set to Running Stat
    [01-01 18:12:15 TUYA Err][lr:0xacde3] logseq empty
    [01-01 18:12:15 TUYA Debug][lr:0xb614b] svc online log init success
    [01-01 18:12:15 TUYA Info][lr:0x9a1f3] thread_create name:wk_th-0,stackDepth:5120,totalstackDepth:13312,priority:3
    [01-01 18:12:15 TUYA Err][lr:0x9f019] wd_protected_read fails gw_bi -1
    [01-01 18:12:15 TUYA Debug][lr:0x9f2db] gw base read finish:-1
    [01-01 18:12:15 TUYA Debug][lr:0xad0c5] ty bt cmmod regist ok:1
    [01-01 18:12:15 TUYA Debug][lr:0xad4dd] upd adv para, send conn_req beacon.
    [PLATFORM DEBUG]!!!!!!!!!!tuya_os_adapt_bt_port_init
    [01-01 18:12
    [01-01 18:12:15 TUYA Notice][lr:0xad1af] ty 1a,status:0x0
    [01-01 18:12:15 TUYA Debug][lr[PLATFORM NOTICE]STACK :
    [01-01 18:12:15 TUYA DIug][lr:0x5a7e1] bk7231ebug][lr:0x5a7e1] bk723n_lowpower_common_ty:2.1n_lowpower_common_ty:21.8
    [PLATFORM NOTICE]C.1.8
    REATE DB SUCCESS
    [PLATFORM DEBUG]!!!!!!!!!!tuya_os_adapt_bt_reset_adv
    [01-01 18:12:15 TUYA Notice][lr:0xad5f5] ble adv upd!
    [PLATFORM NOTICE]!!!!!!!!!!tuya_before_netcfg_cb
    [01-01 18:12:15 TUYA Noti[PLATFORM DEBUG]UNKNOW cNT:17
    EVENT:17
    [PLATFORM DEBUG]UNKNOW EVENT:16
    [PLATFORM DEBUG]UNKNOW EVENT:16
    [PLATFORM DEBUG]UNKNOW EVENT:16
    [PLATFORM DEBUG]UNKNOW EVENT:16
    [01-01 18:12:15 TUYA Notice][lr:0xb22e7] get key:
    0x9e 0xa0 0x7a 0xfe 0x1d 0xfa 0x21 0x40 0x7a 0x86 0x3f 0x4f 0x33 0x68 0x18 0xee
    [12:46:56.143] - [01-01 18:12:15 TUYA Inf
    [12:46:56.153] - o][lr:0x9a1f3] thread_create name:mf_test,stackDepth:5120,totalstackDepth:18432,priority:4
    [12:46:56.690] - [01-01 18:12:15 TUYA Notice][lr:0x58235] mf_init succ
    [01-01 18:12:15 TUYA Info][lr:0x9a1f3] thread_create name:ty_uart_task,stackDepth:3072,totalstackDepth:21504,priority:3
    [01-01 18:12:15 TUYA Info][lr:0x9a1f3] thread_create name:ty_record_task,stackDepth:2
    [12:46:56.690] - 048,totalstackDepth:23552,priority:3
    [01-01 18:12:15 TUYA Notice][lr:0x59e93] get baud:9600
    [12:46:56.881] - [01-01 18:12:15 TUYA Notice][lr:0xb4369] wifi mcu init. pid:rjzon9kyxpoeksj3 firmwarekey:keyr5qhaxgstx9ys v1:2.1.8 v2:1.0.0
    [PLATFORM NOTICE]bk_rst:0 tuya_rst:0
    [01-01 18:12:15 TUYA Notice][lr:0xa3677] Last reset reason: 0
    [01-
    [12:46:56.891] - 01 18:12:15 TUYA Info][lr:0x9a1f3] thread_create name:health_monitor,stackDepth:1536,totalstackDepth:25088,priority:5
    [01-01 18:12:15 TUYA Notice][lr:0xa37e7] serial_no:fc3cd734d40b
    [01-01 18:12:15 TUYA Notice][lr:0xa381f] gw_cntl.gw_wsm.stat:0
    [01-01 18:12:15 TUYA Err][lr:0xa384d] read wf start mode err:-6
    [01-01 18:12:15 TUYA Notice][lr:0xa38ad] gw_cntl.gw_wsm.nc_tp:1
    [01-01 18:12:15 TUYA Notice][lr:0xa38b5] gw_cntl.gw_wsm.md:0
    [01-01 18:12:16 TUYA Notice][lr:0xa3aa3] gw_cntl.gw_if.abi:0 input:0
    [01-01 18:12:16 TUYA Notice][lr:0xa3aaf] gw_cntl.gw_if.product_key:rjzon9kyxpoeksj3, input:rjzon9kyxpoeksj3
    [01-01 18:12:16 TUYA Notice][lr:0xa3abb] gw_cntl.gw_if.tp:9, input:9
    [01-01 18:12:16 TUYA Notice][lr:0xa3acb] gw_cntl.gw_if.firmware_key:keyr5qhaxgstx9ys, input:keyr5qhaxgstx9ys
    [01-01 18:12:16 TUYA Notice][lr:0xad203] ty bt upd product:rjzon9kyxpoeksj3 0
    [01-01 18:12:16 TUYA Notice][lr:0xad77b] upd product_id type:0 rjzon9kyxpoeksj3 42f9c0884d2e0a10 OVrk7zA81YAmzVeBlR4ddNQYy7ebkdoU
    [01-01 18:12:16 TUYA Notice][lr:0x5a793] device_init succ
    [12:46:59.292] - [01-01 18:12:18 TUYA Notice][lr:0x5a5cd] wifi status is :1
    [01-01 18:12:18 TUYA Notice][lr:0xad7ff] update boun
    [12:46:59.292] - d stat:0
    [PLATFORM DEBUG]!!!!!!!!!!tuya_os_adapt_bt_reset_adv
    [PLATFORM DEBUG]UNKNOW EVENT:19
    [PLATFORM DEBUG]UNKNOW EVENT:16
    [PLATFORM DEBUG]UNKNOW EVENT:20
    [PLATFORM DEBUG]UNKNOW EVENT:16
    [01-01 18:12:18 TUYA Notice][lr:0xad5f5] ble adv upd!


    Oto jak podłączyłem urządzenie (zielony: RX, niebieski: TX):
    Zbliżenie płytki czujnika PIR Tuya z widocznymi połączeniami przewodów.

    Jeśli ktoś ma większe doświadczenie z tymi chipami, jeśli ma jakiś pomysł, proszę nie powstrzymujcie się! :)

    Dodane po 14 [minutach]:

    Cóż, w międzyczasie użyłem drugiego adaptera USB-UART do monitorowania układu podczas próby resetowania / flashowania i widzę, że faktycznie się resetuje. Po prostu nie sądziłem, że tak jest, ponieważ czerwona dioda LED migała przed, w trakcie i po resecie....
    W każdym razie problem nadal istnieje, nie mogę go flashować, narzędzie do flashowania nie rozpoznaje resetu.
  • REKLAMA
  • #2 21345880
    p.kaczmarek2
    Moderator Smart Home
    Posty: 14512
    Pomógł: 651
    Ocena: 12518
    To wygląda jak urządzenie TuyaMCU. RX i TX (UART1) modułu WiFi łączy się z małym MCU w obudowie soic 8.
    Aby to potwierdzić, użyj multimetru, aby sprawdzić ciągłość między pinami RX / TX a niektórymi pinami MCU.
    Nie da się tego sflashować w obwodzie i tak samo będzie z ESP.

    Masz kilka opcji:
    - odlutować układ SOIC, zobacz jak ja to robię (zobacz tylko metodę lutowania, nic więcej, nie daj się zmylić):
    https://youtu.be/z9uLPo9QAY8?t=81
    - odlutować moduł WiFi
    https://www.youtube.com/watch?v=fSbeKwCCMHM (lub po prostu gorącym powietrzem)
    - odetnij ścieżki RX/TX i odtwórz je później (może mają rezystory, które możesz tymczasowo usunąć?)
    - jeśli to możliwe, znajdź arkusz danych MCU, może ma pin RESET i można go zresetować?

    Przewodnik po TuyaMCU: https://www.elektroda.com/rtvforum/topic4038151.html
    Rozbiórka podobnego urządzenia: https://www.elektroda.com/rtvforum/topic3914412.html

    Jeśli chcesz go płynnie przekonwertować, sugerowałbym również najpierw przechwycić pakiety TuyaMCU:
    https://www.elektroda.com/rtvforum/topic3970199.html
    Następnie możesz spróbować użyć tmSensor na OBK, aby go uruchomić:
    https://www.elektroda.com/rtvforum/find.php?q=tmSensor
    Oczywiście zakładam, że jest to urządzenie TuyaMCU, ale myślę, że jest spora szansa, że tak jest. Widzę RX/TX w pobliżu układu SOIC 8...

    Pamiętaj również o zrobieniu kopii zapasowej 2 MB flash, mogę pomóc więcej, jeśli ją udostępnisz.
    Pomogłem? Kup mi kawę.
  • REKLAMA
  • #3 21346222
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    Dzięki za szczegółową odpowiedź!

    Usunąłem 8-pinowy SOIC i byłem w stanie wykonać kopię zapasową oryginalnej pamięci flash, a także sflashować ją za pomocą Openbk. Flasher nie mógł uzyskać żadnej sensownej konfiguracji z fabrycznego oprogramowania układowego.
    Niestety nadal nie chce działać poprawnie: Monitorując wyjście szeregowe układu widzę, że uruchamia się OK, po czym w okolicach linii 191 resetuje się. Oto próbka bootloopa (zostawiłem 2 pełne cykle plus trochę, żeby było na co popatrzeć :) ):

    
    V:BK7231N_1.0.1
    REG:cpsr     spsr     r13      r14
    SVC:000000D3          00401C1C 000033AC
    IRQ:000000d2 00000010 00401e0c 80069cca
    FIR:000000d1 00000010 00401ffc 74861b1b
    SYS:000000df          0040192c 00000158
    ST:00000000
    J 0x10000
    bk_misc_init_start_type 0 0
    prvHeapInit-start addr:0x4144d8, size:113448
    [Flash]id:0xc84015
    sctrl_sta_ps_init
    cset:0 0 0 0
    Entering initLog()...
    Commands registered!
    initLog() done!
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 14 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 1 changes count.
    Error:CMD:lfs is absent
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    
    Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    
    Main_Init_Delay
    
    delaying start
    bandgap_calm_in_efuse=0x56
    [load]bandgap_calm=0x56->0x16,vddig=4->5
    [FUNC]rwnxl_init
    #Startup delayed 0ms#
    [bk]tx_txdesc_flush
    [FUNC]intc_init
    [FUNC]calibration_main
    gpio_level=1,txpwr_state=15
                               user define rfcali mode:1
    ge#Startup delayed 10ms#
    tartup delayed 10ms#
    #Startup delayed 20ms#
    #Startup delayed 30ms#
    #Startup delayed 40ms#
    #Startup delayed 50ms#
    #Startup delayed 60ms#
    #Startup delayed 70ms#
    #Startup delayed 80ms#
    #Startup delayed 90ms#
    #Startup delayed 100ms#
    #Startup delayed 110ms#
    #Startup delayed 120ms#
    #Startup delayed 130ms#
    #Startup delayed 140ms#
    #Startup delayed 150ms#
    #Startup delayed 160ms#
    #Startup delayed 170ms#
    #Startup delayed 180ms#
    #Startup delayed 190ms#
    #Startup delayed 200ms#
    #Startup delayed 210ms#
    #Startup delayed 220ms#
    #Startup delayed 230ms#
    #Startup delayed 240ms#
    #Startup delayed 250ms#
    #Startup delayed 260ms#
    #Startup delayed 270ms#
    #Startup delayed 280ms#
    #Startup delayed 290ms#
    #Startup delayed 300ms#
    #Startup delayed 310ms#
    #Startup delayed 320ms#
    #Startup delayed 330ms#
    #Startup delayed 340ms#
    #Startup delayed 350ms#
    #Startup delayed 360ms#
    #Startup delayed 370ms#
    #Startup delayed 380ms#
    #Startup delayed 390ms#
    #Startup delayed 400ms#
    #Startup delayed 410ms#
    #Startup delayed 420ms#
    #Startup delayed 430ms#
    #Startup delayed 440ms#
    #Startup delayed 450ms#
    #Startup delayed 460ms#
    calibration_main over
                         flash txpwr table:0xf
    dif g and n20 ID in flash:4
    dif g and n40 ID in flash:4
    read txpwr tab from flash success
    temp in flash is:245
    xtal in flash is:65
    xtal_cali:65
    --init_xtal = 65
                    [FUNC]#Startup delayed 470ms#
    pp delayed 470ms#
    [FUNC]func_init_extended OVER!!!
    
    start_type:0
    Version:
    Initializing TCP/IP stack
    #Startup delayed 480ms#
    app_init finished
    #Startup delayed 490ms#
    #Startup delayed 500ms#
    #Startup delayed 510ms#
    #Startup delayed 520ms#
    #Startup delayed 530ms#
    #Startup delayed 540ms#
    #Startup delayed 550ms#
    #Startup delayed 560ms#
    #Startup delayed 570ms#
    #Startup delayed 580ms#
    #Startup delayed 590ms#
    #Startup delayed 600ms#
    #Startup delayed 610ms#
    #Startup delayed 620ms#
    #Startup delayed 630ms#
    #Startup delayed 640ms#
    #Startup delayed 650ms#
    #Startup delayed 660ms#
    #Startup delayed 670ms#
    #Startup delayed 680ms#
    #Startup delayed 690ms#
    #Startup delayed 700ms#
    #Startup delayed 710ms#
    #Startup delayed 720ms#
    #Startup delayed 730ms#
    #Startup delayed 740ms#
    
    starting....
    Info:MAIN:Main_Init_Delay done
    
    Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID []
    Info:MAIN:Using Pass []
    Info:MQTT:MQTT_RegisterCallback called for bT obkD734D40B/ subT obkD734D40B/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens_n/ subT bekens_n/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obkD734D40B/ subT cmnd/obkD734D40B/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens_n/ subT cmnd/bekens_n/+
    Info:MQTT:MQTT_RegisterCallback called for bT obkD734D40B/ subT obkD734D40B/+/get
    Error:CMD:LFS_ReadFile: lfs is absent
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    cal_bias!
    cal dpll!
    temperature_type=1
                      temp_code:-23 - adc_code:341 - adc_trend:[13]:245->[4]:335
    Info:MAIN:Time 1, idle 259003/s, free 80728, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 2, idle 447850/s, free 80728, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 3, idle 186701/s, free 80728, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 4, idle 185567/s, free 80728, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 5, idle 188903/s, free 80728, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:no flash configuration, use default
    Info:MAIN:set ip info: 192.168.4.1,255.255.255.0,192.168.4.1
    Info:MAIN:ssid:OpenBK7231N_D734D40B  key: mode:0
    hostapd_main_exiting
    hostapd_exit_handler
    hostapd_exit_done
    Soft_AP_start
    [saap]MM_RESET_REQ
    [bk]tx_txdesc_flush
    [saap]ME_CONFIG_REQ
    [saap]ME_CHAN_CONFIG_REQ
    [saap]MM_START_REQ
    hapd_intf_add_vif,type:3, s:0, id:0
    apm start with vif:0
    me_set_ps_disable:840 0 0 1 0 0
    ------beacon_int_set:100 TU
    set_active param 0
                      [msg]APM_STOP_CFM
                                       update_ongoing_1_bcn_update
    vif_idx:0, ch_idx:0, bcmc_idx:1
    update_ongoing_1_bcn_update
    enter low level!
    mac fc:3c:d7:34:d4: a
    leave low level!
    net_wlan_add_netif done!, vif_idx:0
    uap_ip_start
    
    configuring interface uap (with Static IP)WARN: TCPIP mutex is NOT locked (1) caller 53C9F
    def netif is no ap's netif, sending boardcast or no-subnet ip packets may failed
    sending broadcast_deauth:5
    Info:MAIN:Time 6, idle 181100/s, free 73008, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 178893/s, free 73008, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:Time 8, idle 187360/s, free 73008, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:Time 9, idle 185044/s, free 73008, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    
    V:BK7231N_1.0.1
    REG:cpsr     spsr     r13      r14
    SVC:000000D3          00401C1C 000033AC
    IRQ:000000d2 00000010 00401e0c 80068cca
    FIR:000000d1 00000010 00401ffc 74a6191b
    SYS:000000df          0040192c 00000158
    ST:00000000
    J 0x10000
    bk_misc_init_start_type 0 0
    prvHeapInit-start addr:0x4144d8, size:113448
    [Flash]id:0xc84015
    sctrl_sta_ps_init
    cset:0 0 0 0
    Entering initLog()...
    Commands registered!
    initLog() done!
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 15 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 1 changes count.
    Error:CMD:lfs is absent
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    
    Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    
    Main_Init_Delay
    
    delaying start
    bandgap_calm_in_efuse=0x56
    [load]bandgap_calm=0x56->0x16,vddig=4->5
    [FUNC]rwnxl_init
    [bk]tx_txdes#Startup delayed 0ms#
    cyed 0ms#
    [FUNC]intc_init
    [FUNC]calibration_main
    gpio_level=1,txpwr_state=15
                               user define rfcali mode:1
    get rfca#Startup delayed 10ms#
    ldelayed 10ms#
    #Startup delayed 20ms#
    #Startup delayed 30ms#
    #Startup delayed 40ms#
    #Startup delayed 50ms#
    #Startup delayed 60ms#
    #Startup delayed 70ms#
    #Startup delayed 80ms#
    #Startup delayed 90ms#
    #Startup delayed 100ms#
    #Startup delayed 110ms#
    #Startup delayed 120ms#
    #Startup delayed 130ms#
    #Startup delayed 140ms#
    #Startup delayed 150ms#
    #Startup delayed 160ms#
    #Startup delayed 170ms#
    #Startup delayed 180ms#
    #Startup delayed 190ms#
    #Startup delayed 200ms#
    #Startup delayed 210ms#
    #Startup delayed 220ms#
    #Startup delayed 230ms#
    #Startup delayed 240ms#
    #Startup delayed 250ms#
    #Startup delayed 260ms#
    #Startup delayed 270ms#
    #Startup delayed 280ms#
    #Startup delayed 290ms#
    #Startup delayed 300ms#
    #Startup delayed 310ms#
    #Startup delayed 320ms#
    #Startup delayed 330ms#
    #Startup delayed 340ms#
    #Startup delayed 350ms#
    #Startup delayed 360ms#
    #Startup delayed 370ms#
    #Startup delayed 380ms#
    #Startup delayed 390ms#
    #Startup delayed 400ms#
    #Startup delayed 410ms#
    #Startup delayed 420ms#
    #Startup delayed 430ms#
    #Startup delayed 440ms#
    #Startup delayed 450ms#
    calibration_main over
                         flash txpwr table:0xf
    #Startup delayed 460ms#
    dif g and n20 ID in flash:4
    dif g and n40 ID in flash:4
    read txpwr tab from flash success
    temp in flash is:245
    xtal in flash is:65
    xtal_cali:65
    --init_xtal = 65
                    [FUNC]ps_init
    [FUNC#Startup delayed 470ms#
    ]up delayed 470ms#
    start_type:0
    Version:
    Initializing TCP/IP stack
    app_init finished
    #Startup delayed 480ms#
    #Startup delayed 490ms#
    #Startup delayed 500ms#
    #Startup delayed 510ms#
    #Startup delayed 520ms#
    #Startup delayed 530ms#
    #Startup delayed 540ms#
    #Startup delayed 550ms#
    #Startup delayed 560ms#
    #Startup delayed 570ms#
    #Startup delayed 580ms#
    #Startup delayed 590ms#
    #Startup delayed 600ms#
    #Startup delayed 610ms#
    #Startup delayed 620ms#
    #Startup delayed 630ms#
    #Startup delayed 640ms#
    #Startup delayed 650ms#
    #Startup delayed 660ms#
    #Startup delayed 670ms#
    #Startup delayed 680ms#
    #Startup delayed 690ms#
    #Startup delayed 700ms#
    #Startup delayed 710ms#
    #Startup delayed 720ms#
    #Startup delayed 730ms#
    #Startup delayed 740ms#
    
    starting....
    Info:MAIN:Main_Init_Delay done
    
    Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID []
    Info:MAIN:Using Pass []
    Info:MQTT:MQTT_RegisterCallback called for bT obkD734D40B/ subT obkD734D40B/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens_n/ subT bekens_n/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obkD734D40B/ subT cmnd/obkD734D40B/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens_n/ subT cmnd/bekens_n/+
    Info:MQTT:MQTT_RegisterCallback called for bT obkD734D40B/ subT obkD734D40B/+/get
    Error:CMD:LFS_ReadFile: lfs is absent
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    cal_bias!
    cal dpll!
    temperature_type=1
                      temp_code:-22 - adc_code:340 - adc_trend:[13]:245->[4]:335
    Info:MAIN:Time 1, idle 263603/s, free 80640, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 2, idle 190364/s, free 80640, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 3, idle 188279/s, free 80640, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 4, idle 187986/s, free 80640, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 5, idle 189377/s, free 80640, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:no flash configuration, use default
    Info:MAIN:set ip info: 192.168.4.1,255.255.255.0,192.168.4.1
    Info:MAIN:ssid:OpenBK7231N_D734D40B  key: mode:0
    hostapd_main_exiting
    hostapd_exit_handler
    hostapd_exit_done
    Soft_AP_start
    [saap]MM_RESET_REQ
    [bk]tx_txdesc_flush
    [saap]ME_CONFIG_REQ
    [saap]ME_CHAN_CONFIG_REQ
    [saap]MM_START_REQ
    hapd_intf_add_vif,type:3, s:0, id:0
    apm start with vif:0
    me_set_ps_disable:840 0 0 1 0 0
    ------beacon_int_set:100 TU
    set_active param 0
                      [msg]APM_STOP_CFM
                                       update_ongoing_1_bcn_update
    vif_idx:0, ch_idx:0, bcmc_idx:1
    update_ongoing_1_bcn_update
    enter low level!
    mac fc:3c:d7:34:d4: a
    leave low level!
    net_wlan_add_netif done!, vif_idx:0
    uap_ip_start
    
    configuring interface uap (with Static IP)WARN: TCPIP mutex is NOT locked (1) caller 53C9F
    def netif is no ap's netif, sending boardcast or no-subnet ip packets may failed
    sending broadcast_deauth:5
    Info:MAIN:Time 6, idle 180896/s, free 72920, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 180729/s, free 72920, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:Time 8, idle 188663/s, free 72920, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:Time 9, idle 187749/s, free 72920, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    
    V:BK7231N_1.0.1
    REG:cpsr     spsr     r13      r14
    SVC:000000D3          00401C1C 000033AC
    IRQ:000000d2 00000010 00401e0c 80048cca
    FIR:000000d1 00000010 00401ffc 74a61919
    SYS:000000df          0040192c 00000158
    ST:00000000
    J 0x10000
    bk_misc_init_start_type 0 0
    prvHeapInit-start addr:0x4144d8, size:113448
    [Flash]id:0xc84015
    sctrl_sta_ps_init
    cset:0 0 0 0
    Entering initLog()...
    Commands registered!
    initLog() done!
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 16 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 1 changes count.
    Error:CMD:lfs is absent
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    
    Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    
    Main_Init_Delay
    
    delaying start
    bandgap_calm_in_efuse=0x56
    [load]bandgap_calm=0x56->0x16,vddig=4->5
    [FUNC]rwnxl_init
    [bk]tx_txdesc_flush
    #Startup delayed 0ms#
    [FUNC]intc_init
    [FUNC]calibration_main
    gpio_level=1,txpwr_state=15
                               user define rfcali mode:1
    get rfcali_mode:1
    #Startup delayed 10ms#
    #Startup delayed 20ms#
    #Startup delayed 30ms#
    #Startup delayed 40ms#
    #Startup delayed 50ms#
    #Startup delayed 60ms#
    #Startup delayed 70ms#
    #Startup delayed 80ms#
    #Startup delayed 90ms#
    #Startup delayed 100ms#
    #Startup delayed 110ms#
    #Startup delayed 120ms#
    #Startup delayed 130ms#
    #Startup delayed 140ms#
    #Startup delayed 150ms#
    #Startup delayed 160ms#
    #Startup delayed 170ms#
    #Startup delayed 180ms#
    #Startup delayed 190ms#
    #Startup delayed 200ms#
    #Startup delayed 210ms#
    #Startup delayed 220ms#
    #Startup delayed 230ms#
    #Startup delayed 240ms#
    #Startup delayed 250ms#
    #Startup delayed 260ms#
    #Startup delayed 270ms#
    #Startup delayed 280ms#
    #Startup delayed 290ms#
    #Startup delayed 300ms#
    #Startup delayed 310ms#
    #Startup delayed 320ms#
    #Startup delayed 330ms#
    #Startup delayed 340ms#
    #Startup delayed 350ms#
    #Startup delayed 360ms#
    #Startup delayed 370ms#
    #Startup delayed 380ms#
    #Startup delayed 390ms#
    #Startup delayed 400ms#
    #Startup delayed 410ms#
    #Startup delayed 420ms#
    #Startup delayed 430ms#
    #Startup delayed 440ms#
    #Startup delayed 450ms#
    calibration_main over
                         flash txpwr table:0xf
    dif g and n20 ID in flash:4
    dif g and n40 ID in flash:4
    read txpwr tab from flash success
    temp in flash is:245
    xtal in flash is:65
    xtal_cali:#Startup delayed 460ms#
    6layed 460ms#
    --init_xtal = 65
                    [FUNC]ps_init
    [FUNC]func_init_extended OVER!!!
    
    start_type:0
    Version:
    lp delayed 470ms#layed 470ms#
    
    app_init finished
    #Startup delayed 480ms#
    #Startup delayed 490ms#
    #Startup delayed 500ms#
    #Startup delayed 510ms#
    #Startup delayed 520ms#
    #Startup delayed 530ms#
    #Startup delayed 540ms#
    #Startup delayed 550ms#
    #Startup delayed 560ms#
    #Startup delayed 570ms#
    #Startup delayed 580ms#
    #Startup delayed 590ms#
    #Startup delayed 600ms#
    #Startup delayed 610ms#
    #Startup delayed 620ms#
    #Startup delayed 630ms#
    #Startup delayed 640ms#
    #Startup delayed 650ms#
    #Startup delayed 660ms#
    #Startup delayed 670ms#
    #Startup delayed 680ms#
    #Startup delayed 690ms#
    #Startup delayed 700ms#
    #Startup delayed 710ms#
    #Startup delayed 720ms#
    #Startup delayed 730ms#
    #Startup delayed 740ms#
    
    starting....
    Info:MAIN:Main_Init_Delay done
    
    Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID []
    Info:MAIN:Using Pass []
    Info:MQTT:MQTT_RegisterCallback called for bT obkD734D40B/ subT obkD734D40B/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens_n/ subT bekens_n/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obkD734D40B/ subT cmnd/obkD734D40B/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens_n/ subT cmnd/bekens_n/+
    Info:MQTT:MQTT_RegisterCallback called for bT obkD734D40B/ subT obkD734D40B/+/get
    Error:CMD:LFS_ReadFile: lfs is absent
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    cal_bias!
    cal dpll!
    temperature_type=1
                      temp_code:-22 - adc_code:339 - adc_trend:[13]:245->[4]:335
    Info:MAIN:Time 1, idle 261995/s, free 80640, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 2, idle 190117/s, free 80640, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    


    Widzę punkt dostępowy wifi, który tworzy przez kilka sekund, ale nie mam wystarczająco dużo czasu, aby w pełni się z nim połączyć (klikam na niego, aby się połączyć, ale zanim zakończy negocjacje, resetuje się).

    Załączam również kopię zapasową fabrycznego oprogramowania układowego. Mam nadzieję, że to pomoże - daj mi znać, jeśli mogę pomóc w dalszej diagnozie.
    Załączniki:
    • readResult_BK7231N_QIO_PIR-sensor_2024-13-12-10-28-58.bin (2 MB) Musisz być zalogowany, aby pobrać ten załącznik.
  • #4 21346315
    divadiow
    Poziom 38  
    Posty: 4946
    Pomógł: 432
    Ocena: 880
    Chciałem powiedzieć, że TuyaMCU prawdopodobnie go usypia, ale widzę, że i tak zasilasz moduł bezpośrednio. Czy nadal tak jest?

    z kopii zapasowej firmware:

    obszar przechowywania po sparowaniu z Tuya

    Kod: JSON
    Zaloguj się, aby zobaczyć kod


    Tuya Dev pokazuje nazwę produktu jako P01CB3S自定义开发 co przekłada się na P01CB3S Custom Development
  • #5 21346325
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    Tak, nadal zasilam go bezpośrednio - chociaż już przylutowałem 8-pinowy SOIC z powrotem. Czy powinienem go usunąć?

    Nigdy nie sparowałem go z aplikacją Tuya ani niczym innym. Jak tylko otrzymałem go pocztą, natychmiast rozpocząłem konwersję.
  • #6 21346358
    spin55
    Poziom 17  
    Posty: 209
    Pomógł: 17
    Ocena: 41
    W urządzeniach zasilanych bateryjnie, które mają układ TuyaMCU podłączony do pinów Tx i Rx modułu Wi-Fi (w tym przypadku CB3S), cała logika sterowania jest zaimplementowana w układzie TuyaMCU.

    Po flashowaniu nie można go skonfigurować, ponieważ TuyaMCU kontroluje moc modułu WiFi i bardzo szybko ją odcina, aby przedłużyć żywotność baterii. Aby wydłużyć czas połączenia, należy przytrzymać przycisk parowania do momentu uzyskania dostępu do strony konfiguracji OpenBK.

    W tym linku można zobaczyć schemat blokowy, który pomoże zrozumieć, w jaki sposób Tuya implementuje swoje oprogramowanie układowe dla urządzeń zasilanych bateryjnie: https://developer.tuya.com/en/docs/iot/tuyacl...niversalserialaccessprotocol?id=K95afs9h4tjjh

    Odlutuj wszystkie kable od modułu WiFi i pozostaw urządzenie gotowe do pracy. Włóż do niego baterie lub zasilaj go napięciem 3V i przełącz w tryb parowania. Postępuj zgodnie z instrukcjami opisanymi powyżej.

    Pozdrowienia
  • #7 21346371
    divadiow
    Poziom 38  
    Posty: 4946
    Pomógł: 432
    Ocena: 880
    W jaki sposób TuyaMCU nadal ma kontrolę nad zasilaniem, jeśli moduł jest zasilany bezpośrednio z zasilacza?
  • #8 21346417
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    Tak, ja też tego nie rozumiem. Chociaż możliwe, że ten drugi układ kontroluje jedną z linii Enable CB3S, której (według moich pomiarów) nie kontroluje...

    Zrobiłem szybki filmik z tego co robię - bez dźwięku. W pierwszej połowie CB3S jest zasilany bezpośrednio, w drugiej połowie jest zasilany z zacisków baterii. Możesz zobaczyć wyjście debugowania CB3S i możesz zobaczyć, że naciśnięcie przycisku robi niewielką różnicę.

    Oto wideo:




    BTW: zajrzałem do podlinkowanego dokumentu (od @spin55), ale niewiele się dowiedziałem... Nie wiem nawet, jak włączyć tryb parowania. Uwaga, w tej chwili nie ma oryginalnego oprogramowania układowego. A z Openbk nie ma nic do parowania - tylko punkt dostępowy do połączenia. Albo ja coś źle rozumiem...
  • #9 21346469
    spin55
    Poziom 17  
    Posty: 209
    Pomógł: 17
    Ocena: 41
    Na filmie widać, że począwszy od minuty 1:18 i prawie na końcu, czasy utrzymywania połączenia zmieniają się z 8 lub 9 sekund do 18 sekund. Może jeśli pobawisz się czasem przytrzymania przycisku parowania, uda ci się to osiągnąć. W tej chwili te 18 sekund to za mało.
  • REKLAMA
  • #10 21346496
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    Rzeczywiście, wygląda na to, że jeśli będę naciskać (nie przytrzymywać) przycisk co kilka sekund, MCU pozostanie otwarte. BARDZO trudno jest to zrobić podczas konfigurowania urządzenia.... Do tej pory udało mi się połączyć z moim WIFi i przekląłem tylko 4869028596590 razy :) )) Czy znasz sposób na obejście tego przynajmniej tymczasowo? W moich starych czujnikach drzwi opartych na ESP po prostu zasilałem ESP bezpośrednio i miałem cały czas na konfigurację. Tutaj wydaje się, że tak nie jest.
  • #11 21346523
    spin55
    Poziom 17  
    Posty: 209
    Pomógł: 17
    Ocena: 41
    Pamiętam, że w tamtych czasach byłem w stanie zobaczyć za pomocą Realterm najlepszy czas na przełączenie urządzenia PIR NEO w tryb parowania. Myślę, że trzeba wykorzystać krótką chwilę połączenia, aby użyć przycisku parowania. Opisałem ten proces na ostatnich stronach tego wątku: https://www.elektroda.com/rtvforum/topic3937723-150.html

    Może ci to pomoże
  • #12 21346532
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    Ha! Rozgryzłem to:
    Po wykonaniu inżynierii wstecznej płytki drukowanej odkryłem, że coś innego kontroluje NIE 3,3 V MCU, ale GND... Jeśli podłączę zasilanie ORAZ GND bezpośrednio do MCU, pozostanie on włączony i teraz mogę kontynuować konfigurację. Tranzystor przełączający widać powyżej i na lewo od pinu GND:

    Płytka drukowana z modułem CB3S i przylutowanymi przewodami.

    Dodano po 1 [godzinie] 6 [minutach]:

    Teraz wpadłem w nowe kłopoty... Może powinienem otworzyć kolejny wątek?

    Spójrz na ten obrazek:
    Zbliżenie na płytkę drukowaną z komponentami elektronicznymi i zaznaczonymi punktami. .

    Zaznaczone punkty (jedna strona R14 i punkt testowy PA5) są połączone. Jest to punkt, w którym napięcie zmienia się wraz z aktywacją czujnika PIR: Normalnie jest to poziom GND, gdy następuje ruch, wzrasta do około 3 V, a następnie, po kilku sekundach, ponownie spada do GND.

    Nie znalazłem tego sygnału na żadnym z pinów MCU. Tzn. żaden z pinów MCU nie zmienia poziomu, gdy zmienia się ten punkt. Oznacza to, że obsługuje go drugi układ: Włącza MCU na kilka sekund, aby zgłosić się do serwera MQTT, prawdopodobnie wysyła do niego dane, aby MCU miał coś sensownego do wysłania, a następnie go wyłącza.

    Czy podążam we właściwym kierunku? Obawiam się, że jeśli będę musiał podłączyć się do komunikacji szeregowej między układem SOIC a MCU, nie będę w stanie kontynuować, ponieważ nie mam do tego odpowiedniego sprzętu, a także jest to trochę więcej czasu / wysiłku, który chciałem włożyć w uruchomienie tego złego chłopca....
  • #13 21346704
    spin55
    Poziom 17  
    Posty: 209
    Pomógł: 17
    Ocena: 41
    Trzeba jasno powiedzieć, że jest to urządzenie kontrolowane przez układ TuyaMCU. Sygnał pir trafia do tego układu i komunikuje się on z modułem wifi poprzez piny Tx i Rx.

    Zapomnijmy teraz o sprzęcie. Teraz należy skonfigurować układ wifi CB3S tak, aby poprawnie komunikował się z TuyaMCU. W tym celu należy utworzyć plik konfiguracyjny typu autoexec.bat w odpowiedniej zakładce Openbeken. Aby to zrobić, podaj go bezpośrednio tak, jak zaprogramowałeś go do pozostania online.

    Zawartość tego pliku to:

    startDriver TuyaMCU
    startDriver tmSensor
    //setChannelType 1 readonly
    // vincular dpid al canal 1
    //linkTuyaMCUOutputToChannel 1 val 1
    //setChannelType 4 readonly
    // vincular dpid al canal 4
    //linkTuyaMCUOutputToChannel 4 val 4
    //SetChannel 1 2
    .

    Odłącz kable Vcc i Gnd od układu WiFi, ale pozostaw kable Tx i Rx. Monitoruj linie Rx i Tx oddzielnie z Rx z modułu USB. Używam Realterm, ale możesz użyć dowolnego innego.

    Ma to na celu identyfikację DPid w komunikacji TuyaMCU/CB3S. Zobaczysz coś podobnego do tego:

    55 AA 00 01 00 24 7B 22 50 22 3A 22 4F 6B 75 72 6F 6E 6F 32 58 4C 56 52 
    56 30 66 42 22 2C 22 76 22 3A 22 31 2E 31 2E 30 22 7D 19                
    55 AA 00 02 00 00 01                                                    
    55 AA 00 02 00 00 01                                                    
    55 AA 00 02 00 00 01                                                    
    55 AA 00 05 00 0A 65 01 00 01 00 66 04 00 01 03 E3


    Jeśli dotarłeś tak daleko, kontynuujemy.
  • #14 21346748
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    Dodałem plik autoexec.bat. Skonfigurowałem również przewody zgodnie z zaleceniami, plus 3,3 V i GND na zaciskach akumulatora. Jednak nie widzę żadnej komunikacji między układami. Nie tylko terminal jest pusty, ale za pomocą oscyloskopu widzę, że nic się nie dzieje na liniach, są one stale na wysokim poziomie. Czy może to oznaczać, że układ SOIC jest uszkodzony?
  • REKLAMA
  • #18 21346794
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    Proszę bardzo:

    V:BK7231N_1.0.1
    REG:cpsr     spsr     r13      r14
    SVC:000000D3          00401C1C 000033AC
    IRQ:000000d2 00000010 00401e0c 80069cc2
    FIR:000000d1 00000010 00401ffc 74a6191b
    SYS:000000df          0040192c 00000158
    ST:00000000
    J 0x10000
    bk_misc_init_start_type 0 0
    prvHeapInit-start addr:0x4144d8, size:113448
    [Flash]id:0xc84015
    sctrl_sta_ps_init
    cset:0 0 0 0
    Entering initLog()...
    Commands registered!
    initLog() done!
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 332 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 40 changes count.
    Error:CMD:no file early.bat err -2
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    
    Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    
    Main_Init_Delay
    
    delaying start
    bandgap_calm_in_efuse=0x56
    [load]bandgap_calm=0x56->0x16,vddig=4->5
    [FUNC]rwnxl_init
    [bk]tx_txdesc_fl#Startup delayed 0ms#
    u0ms#
    [FUNC]intc_init
    [FUNC]calibration_main
    gpio_level=1,txpwr_state=15
                               user define rfcali mode:1
    get rfcali_m#Startup delayed 10ms#
    oyed 10ms#
    #Startup delayed 20ms#
    #Startup delayed 30ms#
    #Startup delayed 40ms#
    #Startup delayed 50ms#
    #Startup delayed 60ms#
    #Startup delayed 70ms#
    #Startup delayed 80ms#
    #Startup delayed 90ms#
    #Startup delayed 100ms#
    #Startup delayed 110ms#
    #Startup delayed 120ms#
    #Startup delayed 130ms#
    #Startup delayed 140ms#
    #Startup delayed 150ms#
    #Startup delayed 160ms#
    #Startup delayed 170ms#
    #Startup delayed 180ms#
    #Startup delayed 190ms#
    #Startup delayed 200ms#
    #Startup delayed 210ms#
    #Startup delayed 220ms#
    #Startup delayed 230ms#
    #Startup delayed 240ms#
    #Startup delayed 250ms#
    #Startup delayed 260ms#
    #Startup delayed 270ms#
    #Startup delayed 280ms#
    #Startup delayed 290ms#
    #Startup delayed 300ms#
    #Startup delayed 310ms#
    #Startup delayed 320ms#
    #Startup delayed 330ms#
    #Startup delayed 340ms#
    #Startup delayed 350ms#
    #Startup delayed 360ms#
    #Startup delayed 370ms#
    #Startup delayed 380ms#
    #Startup delayed 390ms#
    #Startup delayed 400ms#
    #Startup delayed 410ms#
    #Startup delayed 420ms#
    #Startup delayed 430ms#
    #Startup delayed 440ms#
    #Startup delayed 450ms#
    calibration_main over
                         flash txpwr table:0xf
    dif g and n20 ID in flash:4
    dif g and n40 ID in flash:4
    read txpwr tab from flash success
    temp in flash is:245
    #Startup delayed 460ms#
    xtal in flash is:65
    xtal_cali:65
    --init_xtal = 65
                    [FUNC]ps_init
    [FUNC]func_init_extended OVE#Startup delayed 470ms#
    R!!!
    
    start_type:0
    Version:
    Initializing TCP/IP stack
    app_init finished
    #Startup delayed 480ms#
    #Startup delayed 490ms#
    #Startup delayed 500ms#
    #Startup delayed 510ms#
    #Startup delayed 520ms#
    #Startup delayed 530ms#
    #Startup delayed 540ms#
    #Startup delayed 550ms#
    #Startup delayed 560ms#
    #Startup delayed 570ms#
    #Startup delayed 580ms#
    #Startup delayed 590ms#
    #Startup delayed 600ms#
    #Startup delayed 610ms#
    #Startup delayed 620ms#
    #Startup delayed 630ms#
    #Startup delayed 640ms#
    #Startup delayed 650ms#
    #Startup delayed 660ms#
    #Startup delayed 670ms#
    #Startup delayed 680ms#
    #Startup delayed 690ms#
    #Startup delayed 700ms#
    #Startup delayed 710ms#
    #Startup delayed 720ms#
    #Startup delayed 730ms#
    #Startup delayed 740ms#
    
    starting....
    Info:MAIN:Main_Init_Delay done
    
    Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:WiFi SSID: waiting for SSID switch 1/3 (using SSID1)
    Info:MAIN:Registered for wifi changes
    Info:MAIN:Connecting to SSID [MYSSID]
    Info:MAIN:ssid:MYSSID key:MYPASSWORD
    supplicant_main_exiting
    supplicant_exit_done
    [sa_sta]MM_RESET_REQ
    [bk]tx_txdesc_flush
    [sa_sta]ME_CONFIG_REQ
    [sa_sta]ME_CHAN_CONFIG_REQ
    [sa_sta]MM_START_REQ
    hapd_intf_add_vif,type:2, s:0, id:0
    wpa_dInit
    wpa_supplicant_req_scan
    Setting scan[retry16] request: 0.100000 sec
    MANUAL_SCAN_REQ
    enter low level!
    mac fc:3c:d7:34:d4: b
    leave low level!
    net_wlan_add_netif done!, vif_idx:0
    Info:MAIN:Using SSID [MYSSID]
    Info:MAIN:Using Pass [MYPASSWORD]
    Info:MQTT:MQTT_RegisterCallback called for bT viktak/spiti/obkD734D40B/ subT viktak/spiti/obkD734D40B/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens_n/ subT bekens_n/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/viktak/spiti/obkD734D40B/ subT cmnd/viktak/spiti/obkD734D40B/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens_n/ subT cmnd/bekens_n/+
    Info:MQTT:MQTT_RegisterCallback called for bT viktak/spiti/obkD734D40B/ subT viktak/spiti/obkD734D40B/+/get
    Info:CMD:CMD_StartScript: started autoexec.bat at the beginning
    Info:MAIN:Started TuyaMCU.
    Info:MAIN:Started tmSensor.
    Info:MAIN:Main_Init_After_Delay done
    wpa_supplicant_scan
    wpa_drv_scan
    wpa_send_scan_req
    ht in scan
    scan_start_req_handler
    cal_bias!
    cal dpll!
    temperature_type=1
                      temp_code:-23 - adc_code:341 - adc_trend:[13]:245->[4]:335
    Info:MAIN:Time 1, idle 264716/s, free 73024, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:Received: 55 AA 00 01 00 24 7B 22 70 22 3A 22 72 6A 7A 6F 6E 39 6B 79 78 70 6F 65 6B 73 6A 33 22 2C 22 76 22 3A 22 31 2E 30 2E 30 22 7D 26
    Info:TuyaMCU:ProcessIncoming[v=0]: cmd 1 (QueryProductInformation) len 43
    Info:TuyaMCU:ParseQueryProductInformation: received {"p":"rjzon9kyxpoeksj3","v":"1.0.0"}
    Info:MAIN:Time 2, idle 182390/s, free 73024, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    wpa_driver_scan_cb
    wpa_get_scan_rst:1
    cipher2security 2 2 16 16
                             Info:MAIN:Time 3, idle 68716/s, free 73352, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 4, idle 0/s, free 73352, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 5, idle 0/s, free 73352, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    wpa_supplicant_connect
    Cancelling scan request
    wpa_driver_associate
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    ssid:MYSSID, 1
    found scan rst rssi -57 < -50
    dis ht_support
    no ht in scan
    scan_start_req_handler
    aready open
    aready open
    me_set_ps_disable:840 0 0 1 0 3
    sm_auth_send:1
    sm_auth_handler
    ht NOT in assoc req
    sm_assoc_rsp_handler
    rc_init: station_id=0 format_mod=0 pre_type=0 short_gi=0 max_bw=0
                                                                     rc_init: nss_max=0 mcs_max=255 r_idx_min=4 r_idx_max=11 no_samples=8
                                                                                                                                         ---------SM_CONNECT_IND_ok
    wpa_driver_assoc_cb
    Cancelling scan request
    __l2_packet_send: ret 0
    new dtim period:2
    
    new ie: 0 : 4a 61 6e 69 63 65
    new ie: 1 : 8c 12 98 24 b0 48 60 6c
    new ie: 3 : 2
    new ie: 30 : 1 0 0 f ac 4 1 0 0 f ac 4 3 0 0 f ac 2 0 f ac 6 0 f ac 8 8c 0
    new ie: 2d : ec 1 3 ff ff 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
    
    __l2_packet_send: ret 0
    hapd_intf_add_key CCMP
    add sta_mgmt_get_sta
    sta:0, vif:0, key:0
    sta_mgmt_add_key
    add hw key idx:24
    hapd_intf_add_key CCMP
    add is_broadcast_ether_addr
    sta:255, vif:0, key:1
    add hw key idx:1
    ctrl_port_hdl:1
    me_set_ps_disable:840 0 0 0 0 3
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    sta_ip_start
    
    configuring interface mlan (with DHCP client)WARN: TCPIP mutex is NOT locked (1) caller 53C9F
    WARN: TCPIP mutex is NOT locked (1) caller 53C9F
    ip_addr: 8a7ba8c0
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MQTT:mqtt_userName homeassistant
    mqtt_pass homeassistantt
    mqtt_clientID viktak/spiti/obkD734D40B
    mqtt_host 192.168.123.42:1883
    Info:MAIN:Time 6, idle 101883/s, free 73176, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to viktak/spiti/obkD734D40B/+/set
    Info:MQTT:mqtt_subscribed to bekens_n/+/set
    Info:MQTT:mqtt_subscribed to cmnd/viktak/spiti/obkD734D40B/+
    Info:MQTT:mqtt_subscribed to cmnd/bekens_n/+
    Info:MQTT:mqtt_subscribed to viktak/spiti/obkD734D40B/+/get
    Info:TuyaMCU:Received: 55 AA 00 02 00 00 01
    Info:TuyaMCU:ProcessIncoming[v=0]: cmd 2 (MCUconf) len 7
    Info:TuyaMCU:ProcessIncoming: TUYA_CMD_MCU_CONF, TODO!
    Info:MQTT:Publishing val obkD734D40B to viktak/spiti/obkD734D40B/host retain=0
    Info:MAIN:Time 7, idle 171985/s, free 73408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:Publishing val OpenBK7231N 1.17.798 Dec 10 2024 16:02:12 to viktak/spiti/obkD734D40B/build retain=0
    Info:MAIN:Time 8, idle 360254/s, free 73408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:Publishing val fc:3c:d7:34:d4:0b to viktak/spiti/obkD734D40B/mac retain=0
    Info:MAIN:Time 9, idle 188525/s, free 73408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:Received: 55 AA 00 02 00 00 01
    Info:TuyaMCU:ProcessIncoming[v=0]: cmd 2 (MCUconf) len 7
    Info:TuyaMCU:ProcessIncoming: TUYA_CMD_MCU_CONF, TODO!
    Info:TuyaMCU:Received: 55 AA 00 08 00 0C 00 02 02 02 02 02 02 01 04 00 01 01 26
    Info:TuyaMCU:ProcessIncoming[v=0]: cmd 8 (QueryState) len 19
    Info:TuyaMCU:V0_ParseRealTimeWithRecordStorage: processing id 1, dataType 4-enum and 1 data bytes
    Info:TuyaMCU:V0_ParseRealTimeWithRecordStorage: byte 1
    Info:MQTT:Publishing val 34.46 to viktak/spiti/obkD734D40B/temp retain=0
    Info:MAIN:Time 10, idle 373905/s, free 73160, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.123.138 gate=192.168.123.6 mask=255.255.255.0 mac=fc:3c:d7:34:d4:0b
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-58,ssid=MYSSID,bssid=64:64:4a:e2:df:96,channel=2,cipher_type:CCMP
    Info:TuyaMCU:Received: 55 AA 00 05 00 05 03 04 00 01 02 13
    Info:TuyaMCU:ProcessIncoming[v=0]: cmd 5 (WiFiSelect) len 12
    Info:TuyaMCU:V0_ParseRealTimeWithRecordStorage: processing id 3, dataType 4-enum and 1 data bytes
    Info:TuyaMCU:V0_ParseRealTimeWithRecordStorage: byte 2
    Info:MQTT:Publishing val MYSSID to viktak/spiti/obkD734D40B/ssid retain=0
    Info:MAIN:Time 11, idle 181529/s, free 73160, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:Publishing val 2 to viktak/spiti/obkD734D40B/sockets retain=0
    Info:MAIN:Time 12, idle 191192/s, free 73408, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:Publishing val -58 to viktak/spiti/obkD734D40B/rssi retain=0
    Info:MAIN:Time 13, idle 188435/s, free 73408, MQTT 1(1), bWifi 1, secondsWithNo▒UUDD▒
    
    .
  • #19 21346841
    spin55
    Poziom 17  
    Posty: 209
    Pomógł: 17
    Ocena: 41
    Działa prawidłowo.

    55 AA 00 05 00 05 03 04 00 01 02 13

    Masz już DPId baterii.
    Dp: 03
    Typ Enum: 04
    Wartość: 02 (0,1,2)

    Brak czujnika ruchu DP

    Wykonaj testy ruchu, monitorując pin 11.

    Gdy masz DP, będziesz musiał wykonać autoexec.bat.
  • #20 21346871
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    Pin 11 to UART (monitorowanie). Czy to znaczy, że powinienem coś tam zobaczyć podczas testu ruchu? Próbowałem, ale żaden ruch nie ma na to żadnego wpływu. Ciągle się restartuje, a teraz uruchamia się ponownie po kilku sekundach, nawet jeśli nacisnę przycisk.... Obawiam się, że układ SOIC zniknął...
  • #21 21346874
    spin55
    Poziom 17  
    Posty: 209
    Pomógł: 17
    Ocena: 41
    Czy możesz zrobić zdjęcie płyty w takim stanie?

    Nie wydaje mi się, żeby SOIC Tuya była zła

    Dodano po 12 [minutach]: .

    Możesz również spróbować tego autoexec.bat:

    startDriver TuyaMCU
    startDriver tmSensor
    setChannelType 1 readonly
    //Link dpid to channel 1
    linkTuyaMCUOutputToChannel 1 val 1
    setChannelType 3 readonly
    ///Link dpid to channel 3
    linkTuyaMCUOutputToChannel 3 val 3
    SetChannel 1 2


    Zobaczmy, czy mamy szczęście i ruch DP wynosi 01.

    Po odłączeniu wszystkich kabli z wyjątkiem pinu 11 do monitorowania. Zasil urządzenie napięciem 3 V lub bateriami.

    Dodano po 9 [minutach]: .

    To pokazuje, że SOIC nie jest zły:

    Info:TuyaMCU:Received: 55 AA 00 05 00 05 03 04 00 01 02 13
  • #22 21346918
    vitya123
    Poziom 6  
    Posty: 51
    Pomógł: 1
    Ocena: 10
    OK, oto zdjęcie obecnej konfiguracji:
    Zbliżenie na płytkę drukowaną z przylutowanymi przewodami i modułem oznaczonym CB3S.
    Widać, że urządzenie jest zasilane z zacisków baterii. Na każdej linii UART są przylutowane przewody, ale tylko biały wypluwa użyteczne informacje.

    Zaktualizowałem plik autoexec.bat.

    Aaaaaaa i działa!!!! Kiedy aktywuję go jakimś ruchem, publikuje 0/1 w temacie get :
    Zrzut ekranu z danymi diagnostycznymi urządzenia OpenBK7231N. .

    Doskonale!!!! Dziękuję za wytrwałość - nawet po tym, jak straciłem nadzieję :)

    Dokumentowałem każdy krok - więc za kilka dni napiszę poradnik w nowym temacie sprzętowym.

    Jeszcze raz dziękuję!!!

Podsumowanie tematu

✨ Użytkownik miał problemy z resetowaniem czujnika PIR Tuya na układzie BK7231N, nie mogąc go sflashować ani zresetować za pomocą pinów CEN i RST. Po odlutowaniu układu SOIC, udało mu się wykonać kopię zapasową pamięci flash i sflashować ją za pomocą OpenBK, jednak urządzenie nadal nie działało poprawnie, resetując się w trakcie uruchamiania. W trakcie dyskusji zaproponowano różne metody, takie jak odłączenie modułu WiFi, monitorowanie linii Tx i Rx oraz tworzenie pliku konfiguracyjnego autoexec.bat. Ostatecznie, po inżynierii wstecznej, użytkownik odkrył, że zasilanie GND kontroluje inny układ, co pozwoliło mu na poprawną konfigurację i uzyskanie komunikacji z czujnikiem.
Wygenerowane przez model językowy.
REKLAMA