logo elektroda
logo elektroda
X
logo elektroda

Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

caubergjef57 14076 193
ADVERTISEMENT
  • #61 20508062
    spin55
    Level 17  
    Can someone measure the traffic between MCU_Tuya and the WIFI module with Realterm or similar software and publish it to make a comparison?
    If you need help with Realterm to make the screenshots, I offer to help you.
  • ADVERTISEMENT
  • #62 20508068
    p.kaczmarek2
    Moderator Smart Home
    @spin55 good spotting, online counter was last changed by @iprak , but I think I will change this to stop counter and change page background if there was no page reply in some time.

    Sorry for late reply, I am a bit busy today, I spent few hours reverse engineering next dimmer protocol for OBK. Details will be posted on forum soon, but so far I can show few photos:
    Spoiler:

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Helpful post? Buy me a coffee.
  • #63 20508127
    spin55
    Level 17  
    @p.kaczmarek2 I appreciate all the help you give on the Forum. Please reply when you can.

    Added after 9 [minutes]:

    The wifi module sends this:

    55AA00000000FF55AA000100000055AA000200000155AA000100000055AA000800000755AA00000000FF55AA000800000755AA00020001040655AA00030001000355AA000800000755AA00000000FF55AA0008000007FEF8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F80055AA00000000FF55AA000100000055AA000200000155AA000100000055AA000800000755AA00000000FF55AA000800000755AA00020001040655AA00030001000355AA000800000755AA00000000FF55AA0008000007FEF8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8


    According to this information: https://developer.tuya.com/en/docs/iot/tuyacl...niversalserialaccessprotocol?id=K95afs9h4tjjh

    It seems that the module is correctly reporting to the MCU that it is connected:

    55AA000200010406

    However, the alleged publication of data does not reach Homeassistant nor is the website updated.



    And the MCU_Tuya chip this:

    55AA00000001000055AA000100247B2270223A226C7964776F627779717869796F623968222C2276223A22312E302E35227D6255AA000200000155AA000100247B2270223A226C7964776F627779717869796F623968222C2276223A22312E302E35227D6255AA00000001000055AA000200000155AA0005000501040001011055AA0005000804020004000000647A55AA000000010000F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8FCF8F8F8F8F8FCF8F8F8FCF8F8FCF8F8F8FCFCF8FCFCF8F8FCF8F8F8FCF8F8F8FCFCF8F8FCFC0055AA00000001000055AA000100247B2270223A226C7964776F627779717869796F623968222C2276223A22312E302E35227D6255AA000200000155AA00000001000055AA000200000155AA0005000501040001000F55AA0005000804020004000000647A55AA000000010000F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8


    Here you can see the motion detection information clearly:

    55AA00050005010400010110 --> "1"
    55AA0005000501040001000F --> "0"


    And battery level:

    5AA0005000804020004000000647A --> "100"

    I can update firmware via OTA so the wifi module can be controlled by the MCU

    Does it happen to anyone else?

    Greetings
  • #64 20508155
    p.kaczmarek2
    Moderator Smart Home
    Okay @spin55 , so first steps I would recommend is:
    - do you have tmSensor running which will ask TuyaMCU to wait and to get sensor state?
    - do you have "publish all states on connect" flag and the "publish tuyamcu vars" flag?
    - have you read topic about related improvement? https://github.com/openshwprojects/OpenBK7231T_App/issues/478
    Helpful post? Buy me a coffee.
  • #65 20508215
    spin55
    Level 17  
    - do you have tmSensor running which will ask TuyaMCU to wait and to get sensor state?

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    p.kaczmarek2 wrote:
    - do you have "publish all states on connect" flag and the "publish tuyamcu vars" flag?


    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    p.kaczmarek2 wrote:
    - have you read topic about related improvement? https://github.com/openshwprojects/OpenBK7231T_App/issues/478


    I'm reading it, but I don't think I can Do nothing because I don't have the right tools installed nor the knowledge to handle them.

    Thank you
  • #66 20508327
    p.kaczmarek2
    Moderator Smart Home
    spin55 wrote:

    And the MCU_Tuya chip this:

    55AA00000001000055AA000100247B2270223A226C7964776F627779717869796F623968222C2276223A22312E302E35227D6255AA000200000155AA000100247B2270223A226C7964776F627779717869796F623968222C2276223A22312E302E35227D6255AA00000001000055AA000200000155AA0005000501040001011055AA0005000804020004000000647A55AA000000010000F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8FCF8F8F8F8F8FCF8F8F8FCF8F8FCF8F8F8FCFCF8FCFCF8F8FCF8F8F8FCF8F8F8FCFCF8F8FCFC0055AA00000001000055AA000100247B2270223A226C7964776F627779717869796F623968222C2276223A22312E302E35227D6255AA000200000155AA00000001000055AA000200000155AA0005000501040001000F55AA0005000804020004000000647A55AA000000010000F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8


    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    What is seen by Home Assistant?

    It looks like it's first reporting 1 and later 0. Is 1 or 0 received, or nothing at all?

    Can you do a comparison between TuyaMCU data report and publishes received by HA?

    If you are saying that those publishes do not reach HA, then is device connected to MQTT? Are other publishes seen by HA? Is the IP publish seen? The one done at startup? Or nothing at all? Do you have it paired with HA?

    Here's how TuyaMCU for low power devices should work:
    https://developer.tuya.com/en/docs/iot/tuyacl...niversalserialaccessprotocol?id=K95afs9h4tjjh
    [url=https://obrazki.elektroda.pl/3632775400_1679770609.png]

    Added after 10 [minutes]:

    I modified publish code for tmsensor to do a quicker, forced all tuyamcu channels publish, can you check if it helps for you?
    You need to update to build 1.15.627
    Helpful post? Buy me a coffee.
  • #67 20508599
    spin55
    Level 17  
    I have tried these two configurations in HA:

    - unique_id: "OpenBK7231N_1F4A8B0C_binary_PIR_2"
      name: "Motion sensor_2"
      state_topic: "obk1F4A8B0C/1/get"
      qos: 1
      payload_on: 1
      payload_off: 0
    
    - unique_id: "obk1F4A8B0C_voltage"
      name: "PIR_2 voltage"
      state_topic: "obk1F4A8B0C/4/get"
      unit_of_measurement: '%'
      value_template: "{{ value }}"


    And this:

         - unique_id: "OpenBK7231N_1F4A8B0C_binary_PIR"
           name: "PIR_2"
           state_topic: "obk1F4A8B0C/1/get"
           value_template: '{{ value | replace("0", "Reposo") | replace("1", "Activado") }}'
    
         - unique_id: "obk1F4A8B0C_voltage"
           name: "PIR_2 voltage"
           state_topic: "obk1F4A8B0C/4/get"
           unit_of_measurement: '%'
           value_template: "{{ value }}"
    


    The problem is that the web does not start and therefore there is no possibility of Log TuyaMCU.

    I've updated to version 629 and it's still the same.

    Added after 17 [minutes]:

    I can only access the web when I put the pir in Update mode by pressing the button for 6 seconds until the leds turn off and repeat. Only with this sequence I can access the web and update via OTA, but it does not detect movement. In normal operation it is not possible to open the web.
    I rule out that it is an electrical fault because with a long double press on the button, the web is activated.
  • ADVERTISEMENT
  • #68 20512592
    spin55
    Level 17  
    Hello. I keep trying but I'm stuck. Any help would be well received.

    After many failed tests, I think the Tuya_MCU chip code might be failing because it only does one power-up cycle and then doesn't respond anymore.

    I have flashed the BK7321N chip several times, both by USB and via OTA without problems, so I rule out that the firmware is corrupted.

    This is the Rx communication:

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    And there is the Tx line:

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    From there the motion detector no longer changes or turns on the leds. In addition, this first change is not published on the web or on Homeassistant.

    In order to access the web I have to press the pairing button until the LEDs go off and repeat the sequence. In this way I can access the Log and keep the connection alive without time limit. In fact, it is the only way to update via OTA. But in this state, the motion sensor does not change state.

    Info:MAIN:Time 1, idle 283847/s, free 79264, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 2, idle 189486/s, free 79264, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 01 00 24 7B 22 70 22 3A 22 6C 79 64 77 6F 62 77 79 71 78 69 79 6F 62 39 68 22 2C 22 76 22 3A 22 31 2E 30 2E 35 22 7D 62 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 1 (QueryProductInformation) with 43 bytes
    Info:TuyaMCU:TuyaMCU_ParseQueryProductInformation: received {"p":"lydwobwyqxiyob9h","v":"1.0.5"}
    Info:MAIN:Time 3, idle 189892/s, free 79264, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 02 00 00 01 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF, TODO!
    Info:MAIN:Time 4, idle 183100/s, free 79264, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 187425/s, free 79264, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid:                       key:
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 6, idle 189065/s, free 74296, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 02 00 00 01 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF, TODO!
    Info:MAIN:Time 7, idle 177770/s, free 74296, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 108770/s, free 74304, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 74304, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 03 00 00 02 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 3 (WiFiState) with 7 bytes
    Info:MAIN:Time 10, idle 0/s, free 74304, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 60084/s, free 73864, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 12, idle 190875/s, free 73904, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_userName homeassistant
    mqtt_pass 
    mqtt_clientID obk1F4A8B0C
    mqtt_host 192.168.1.45:1883
    Info:MQTT:Connect error in mqtt_client_connect - code: -4 (ERR_RTE)
    Info:MAIN:Time 13, idle 196638/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 14, idle 381986/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 195923/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 16, idle 189986/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 03 00 00 02 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 3 (WiFiState) with 7 bytes
    Info:MAIN:Time 17, idle 187584/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 18, idle 189741/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 19, idle 191691/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 20, idle 189854/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.67 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-73,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 21, idle 187839/s, free 74200, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 22, idle 192080/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 23, idle 189234/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 24, idle 192937/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 25, idle 196050/s, free 73816, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 26, idle 193375/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 27, idle 189372/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 28, idle 192258/s, free 74408, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_userName homeassistant
    mqtt_pass 
    mqtt_clientID obk1F4A8B0C
    mqtt_host 192.168.1.45:1883
    Info:MAIN:Time 29, idle 192234/s, free 74320, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to obk1F4A8B0C/+/set
    Info:MQTT:mqtt_subscribed to bekens/+/set
    Info:MQTT:mqtt_subscribed to cmnd/obk1F4A8B0C/+
    Info:MQTT:mqtt_subscribed to cmnd/bekens/+
    Info:MQTT:mqtt_subscribed to obk1F4A8B0C/+/get
    Info:MQTT:Publishing val obk1F4A8B0C to obk1F4A8B0C/host retain=0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 30, idle 189097/s, free 74080, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.67 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-72,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/0/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/0/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/0/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:Publishing val Build on Mar 26 2023 13:46:19 version 1.15.631 to obk1F4A8B0C/build retain=0
    Info:MAIN:Time 31, idle 168029/s, free 74320, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Publishing val c8:47:1f:4a:8b:0c  to obk1F4A8B0C/mac retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 32, idle 189077/s, free 74320, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:Publishing val 2 to obk1F4A8B0C/sockets retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 33, idle 182412/s, free 74320, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:Publishing val -72 to obk1F4A8B0C/rssi retain=0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 34, idle 177492/s, free 74064, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:Publishing val 34 to obk1F4A8B0C/uptime retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 35, idle 178942/s, free 74320, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:Publishing val 74320 to obk1F4A8B0C/freeheap retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 36, idle 185224/s, free 74320, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:Publishing val 192.168.1.67 to obk1F4A8B0C/ip retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 37, idle 189428/s, free 74320, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 38, idle 180215/s, free 74088, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 39, idle 177179/s, free 74088, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 40, idle 359856/s, free 74088, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.67 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-73,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 41, idle 158298/s, free 74088, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MQTT:Forced channel publish! Publishing val 0 to 4
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/4/get retain=0
    Info:MQTT:Forced channel publish! Publishing val 0 to 1
    Info:MQTT:Publishing val 0 to obk1F4A8B0C/1/get retain=0
    Info:MAIN:Time 42, idle 183393/s, free 74320, MQTT 1(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:channelSet NOT 'set'


    @p.kaczmarek2, can you tell me where this tool can be downloaded?

    https://obrazki.elektroda.pl/2272847700_1679770424_thumb.jpg
    https://www.elektroda.com/rtvforum/topic3937723-60.html#gallery-10

    Greetings
  • ADVERTISEMENT
  • #69 20513796
    p.kaczmarek2
    Moderator Smart Home
    I haven't published it yet, but here's a debug build for you:
    Helpful post? Buy me a coffee.
  • #70 20513862
    spin55
    Level 17  
    Thank you so much.
    There are important news related to this thread. I am preparing a summary of the tests carried out.
    Greetings

    Added after 48 [minutes]:

    Hello.
    Yesterday I received another pir motion just like this one.
    After flashing it has the same symptoms. The captures with Realterm are identical in the Tx and Rx tracks of communication between TuyaMCU and BK7321N.
    The screenshots clearly show the motion sensor trigger reset cycles and they are correct, but the reset time is not 1 minute as the instruction manual says, but 2 minutes. That's why I thought that it only did a reset cycle and trip when it was turned on.

    This is what the manual for the device says:

    Main function
    Operate status: alarma/ normal (the device can be triggered only once 1 minute)

    Device Status-----------------LED State

    Smart Wi Fi ------------------Indicator flashes quicly
    AP mode ---------------------Indicator flashes slowly
    Triggered ---------------------LED will rapidly blink and OFF after scheduled time
    Suspend mode ---------------Indicator OFF
    Reset --------------------------Indicator lights up for 4s and after 2seconds ligths OFF. Device goes
    into configuration mode

    How to reset?

    (1) Press the reset button for 6 seconds till the indicator flash rapidly. Then device turn to smart wifi mode.
    (2) Press the reset button again for 6 seconds till the indicator flash slowly. The device turns to AP mode.

    The TuyaMCU chip detects the state changes of the motion detector and controls the BK7321N through the CEN pin, first passing through a transistor. But this activation time lasts a few seconds and I think that is the reason why the data does not reach the web or Home Assistant through MQTT.

    Without Realterm it is impossible to see what is happening because the wifi module does not have enough time to activate and transmit. The only way for the chip to transmit is to do a Reset according to the manual. The device enters AP mode and you can access the web and view the logs, but it does not respond to motion detection. This is the method I use to do firmware updates via OTA without fear of being cut off during the process.

    Does anyone have this device and can confirm if it works correctly?

    Greetings

    Added after 8 [hours] 2 [minutes]:

    Hello.
    I continue with the tests. I've put the CEN pin to VCC through a 1K resistor to hold the 3 volts longer than the 10-12 seconds controlled by the TuyaMCU chip, but still the same.
    I think I'm going to leave it waiting for someone to buy the same device and have more luck or knowledge than me on the subject.

    Greetings
  • #71 20514925
    p.kaczmarek2
    Moderator Smart Home
    Would you be able to capture the full communication of the original Tuya firmware with that MCU?

    but not with OBK, as in earlier posts
    Helpful post? Buy me a coffee.
  • #72 20516100
    spin55
    Level 17  
    p.kaczmarek2 wrote:
    Would you be able to capture the full communication of the original Tuya firmware with that MCU?


    It gives CRC error when I load the original backup.
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    I did one last test restoring the original backup from the other device and it gives the same CRC error.
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    Despite this, I installed the Smartlife App to test if it was possible to pair it, and I have not been able to.

    So I reinstalled OpenBeken firmware and now it shows up with mac zero.
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    That doesn't worry me because it can be restored, but look at the Log. It is not loading the drivers and see how it disconnects and reconnects the BK7321N from time to time.

    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 135 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 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
    Info:MAIN:Main_Init_Delay
    Info:MAIN: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 obk8C000000/ subT obk8C000000/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens/ subT bekens/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obk8C000000/ subT cmnd/obk8C000000/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens/ subT cmnd/bekens/+
    Info:MQTT:MQTT_RegisterCallback called for bT obk8C000000/ subT obk8C000000/+/get
    Info:CMD:LFS_ReadFile: failed to file autoexec.bat
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Time 1, idle 286438/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 2, idle 191721/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 191968/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 192093/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 191821/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid: key:
    Info:MAIN:Time 6, idle 190761/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 186192/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 113857/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 64735/s, free 76128, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 12, idle 191020/s, free 75768, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 13, idle 191229/s, free 75768, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 14, idle 189211/s, free 76168, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 185708/s, free 76168, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 16, idle 195741/s, free 76168, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 17, idle 194368/s, free 76168, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 18, idle 194850/s, free 76168, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 137 #######
    Error:CFG:flash reinitialised
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 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
    Info:MAIN:Main_Init_Delay
    Info:MAIN: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 obk8C000000/ subT obk8C000000/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens/ subT bekens/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obk8C000000/ subT cmnd/obk8C000000/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens/ subT cmnd/bekens/+
    Info:MQTT:MQTT_RegisterCallback called for bT obk8C000000/ subT obk8C000000/+/get
    Info:CMD:LFS_ReadFile: failed to file autoexec.bat
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Time 1, idle 288195/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 2, idle 192967/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 192106/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 191837/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 193047/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid: key:
    Info:MAIN:Time 6, idle 191161/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 179595/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 111358/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 67221/s, free 75600, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 12, idle 191119/s, free 75640, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 13, idle 189954/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 14, idle 195849/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 185157/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 16, idle 199288/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 17, idle 189305/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 138 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 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
    Info:MAIN:Main_Init_Delay
    Info:MAIN: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 obk8C000000/ subT obk8C000000/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens/ subT bekens/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obk8C000000/ subT cmnd/obk8C000000/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens/ subT cmnd/bekens/+
    Info:MQTT:MQTT_RegisterCallback called for bT obk8C000000/ subT obk8C000000/+/get
    Info:CMD:LFS_ReadFile: failed to file autoexec.bat
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Time 1, idle 284319/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 2, idle 194226/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 193082/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 193099/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 194186/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid: key:
    Info:MAIN:Time 6, idle 190745/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 182901/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 113734/s, free 76032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 76032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 0/s, free 76032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Time 11, idle 74687/s, free 74800, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 12, idle 182770/s, free 76096, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 13, idle 190225/s, free 72936, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 14, idle 196942/s, free 72936, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 190969/s, free 76136, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 16, idle 194184/s, free 75928, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 17, idle 193208/s, free 76136, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 18, idle 201539/s, free 76136, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 139 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 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
    Info:MAIN:Main_Init_Delay
    Info:MAIN: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 obk8C000000/ subT obk8C000000/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens/ subT bekens/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obk8C000000/ subT cmnd/obk8C000000/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens/ subT cmnd/bekens/+
    Info:MQTT:MQTT_RegisterCallback called for bT obk8C000000/ subT obk8C000000/+/get
    Info:CMD:LFS_ReadFile: failed to file autoexec.bat
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Time 1, idle 285234/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 2, idle 192923/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 192014/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 192015/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 193051/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid: key:
    Info:MAIN:Time 6, idle 191013/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 181521/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 117733/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 64698/s, free 76104, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 12, idle 192556/s, free 73048, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 13, idle 195906/s, free 73048, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 14, idle 196300/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 383138/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 16, idle 196534/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 17, idle 195838/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 140 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 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
    Info:MAIN:Main_Init_Delay
    Info:MAIN: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 obk8C000000/ subT obk8C000000/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens/ subT bekens/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obk8C000000/ subT cmnd/obk8C000000/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens/ subT cmnd/bekens/+
    Info:MQTT:MQTT_RegisterCallback called for bT obk8C000000/ subT obk8C000000/+/get
    Info:CMD:LFS_ReadFile: failed to file autoexec.bat
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Time 1, idle 289446/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 2, idle 194073/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 193217/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 193031/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 194233/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid: key:
    Info:MAIN:Time 6, idle 192313/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 183109/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 112499/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 67126/s, free 76104, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 12, idle 192709/s, free 75552, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 13, idle 196797/s, free 75552, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 14, idle 198066/s, free 64448, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 15, idle 188023/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 16, idle 195752/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 17, idle 197092/s, free 76144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 141 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 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
    Info:MAIN:Main_Init_Delay
    Info:MAIN: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 obk8C000000/ subT obk8C000000/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens/ subT bekens/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obk8C000000/ subT cmnd/obk8C000000/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens/ subT cmnd/bekens/+
    Info:MQTT:MQTT_RegisterCallback called for bT obk8C000000/ subT obk8C000000/+/get
    Info:CMD:LFS_ReadFile: failed to file autoexec.bat
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Time 1, idle 288223/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 2, idle 192977/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 192115/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 191897/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 192984/s, free 81000, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid: key:
    Info:MAIN:Time 6, idle 191057/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 180454/s, free 76040, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 120784/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 0/s, free 76048, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 65586/s, free 76112, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 12, idle 193733/s, free 76152, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 13, idle 193721/s, free 75296, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 14, idle 196058/s, free 75296, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 188986/s, free 76152, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 16, idle 199984/s, free 76152, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 17, idle 193493/s, free 76152, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 18, idle 194758/s, free 76152, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    


    I loaded startDriver TuyaMCU and startDriver tmSensor in autoexec.bat and there are no more Logs, although in Realterm you can see the cycles already described above. And if I remove startDriver tmSensor the web is activated again and there are Logs.

    Greetings

    Added after 1 [hours] 44 [minutes]:

    And that's how it is now. It does a boot cycle of 123 times and stops. It is only reactivated by pressing the button or disconnecting and reconnecting.

    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 511 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 4 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
    Info:MAIN:Main_Init_Delay
    Info:MAIN: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 obk8C000000/ subT obk8C000000/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obk8C000000/ subT cmnd/obk8C000000/+
    Info:MQTT:MQTT_RegisterCallback called for bT obk8C000000/ subT obk8C000000/+/get
    Info:CMD:CMD_StartScript: started autoexec.bat at the beginning
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Started TuyaMCU.
    Info:MAIN:Time 1, idle 282461/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 2, idle 191589/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 01 00 24 7B 22 70 22 3A 22 6C 79 64 77 6F 62 77 79 71 78 69 79 6F 62 39 68 22 2C 22 76 22 3A 22 31 2E 30 2E 35 22 7D 62 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 1 (QueryProductInformation) with 43 bytes
    Info:TuyaMCU:TuyaMCU_ParseQueryProductInformation: received {"p":"lydwobwyqxiyob9h","v":"1.0.5"}
    Info:MAIN:Time 3, idle 191056/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 02 00 00 01 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF, TODO!
    Info:MAIN:Time 4, idle 186653/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 189939/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid: key:
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 6, idle 191604/s, free 75072, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 7, idle 188242/s, free 75072, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 112727/s, free 75064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 75064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 10, idle 0/s, free 75064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Time 11, idle 69180/s, free 73840, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 12, idle 192194/s, free 73840, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 13, idle 190990/s, free 75168, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 14, idle 190639/s, free 75168, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 194120/s, free 75168, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 16, idle 183004/s, free 75152, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 17, idle 188760/s, free 75192, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 18, idle 198109/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 19, idle 193554/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 20, idle 193388/s, free 63496, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-68,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 21, idle 188995/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 22, idle 195299/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 23, idle 189666/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 24, idle 194894/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 25, idle 194662/s, free 66576, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 26, idle 194807/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 27, idle 191197/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 28, idle 193516/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 29, idle 193968/s, free 66576, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 30, idle 192375/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-68,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 31, idle 189810/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (30 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 32, idle 186525/s, free 75192, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 33, idle 195586/s, free 74968, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 34, idle 193997/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 35, idle 191120/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 36, idle 197449/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 37, idle 193584/s, free 66576, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 38, idle 385938/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 39, idle 194671/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 40, idle 193622/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-68,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 41, idle 192147/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 42, idle 195273/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 43, idle 193759/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 44, idle 193879/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 45, idle 192492/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 46, idle 196383/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 47, idle 191347/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 48, idle 197933/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 49, idle 192584/s, free 75192, MQTT 0(2), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 50, idle 192607/s, free 66576, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-67,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 51, idle 186660/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 52, idle 194571/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 53, idle 204496/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 54, idle 399385/s, free 74968, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 55, idle 189156/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 56, idle 195544/s, free 74968, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 57, idle 196019/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 58, idle 193865/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 59, idle 191635/s, free 74968, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 60, idle 194597/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-67,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 61, idle 189432/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62, idle 201327/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 63, idle 192612/s, free 74968, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 64, idle 192579/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 65, idle 194820/s, free 75192, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 66, idle 198205/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 67, idle 198679/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 68, idle 193492/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 69, idle 390013/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 70, idle 193237/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-68,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 71, idle 190184/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 72, idle 384927/s, free 74968, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 73, idle 191746/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 74, idle 192664/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 75, idle 203844/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 76, idle 194141/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 77, idle 386847/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 78, idle 196250/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 79, idle 187477/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 80, idle 382345/s, free 75192, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-68,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 81, idle 190776/s, free 74968, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 82, idle 194115/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 83, idle 193187/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 84, idle 195201/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 85, idle 193203/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 86, idle 194956/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 87, idle 192421/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 88, idle 194316/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 89, idle 195811/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 90, idle 194029/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-69,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 91, idle 189017/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 92, idle 193004/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 93, idle 198725/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 94, idle 200064/s, free 74968, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 95, idle 191204/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 96, idle 195256/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 97, idle 194500/s, free 75192, MQTT 0(5), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 98, idle 203622/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 99, idle 193443/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 100, idle 195462/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-69,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 101, idle 188534/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 102, idle 192991/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 103, idle 201038/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 104, idle 192749/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 105, idle 193008/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 106, idle 193247/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 107, idle 190956/s, free 66368, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 108, idle 196055/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 109, idle 193085/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 110, idle 195781/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-69,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 111, idle 188031/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 112, idle 194349/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 113, idle 192887/s, free 75192, MQTT 0(6), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 114, idle 193264/s, free 75192, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 115, idle 385978/s, free 75192, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 116, idle 195666/s, free 75192, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 117, idle 195172/s, free 75192, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 118, idle 191327/s, free 75192, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 119, idle 194439/s, free 75192, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 120, idle 191981/s, free 74984, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.89 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:8c:00:00:00 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-69,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 121, idle 190518/s, free 75192, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 122, idle 193451/s, free 75192, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 123, idle 194114/s, free 75184, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38


    Rx:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    Tx:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
  • #73 20516304
    p.kaczmarek2
    Moderator Smart Home
    CRC error can be ignored.
    A full dump of UART communication in a format that I can copy would help.

    Btw, have you seen this topic?
    https://www.elektroda.com/rtvforum/topic3914412.html
    I've did a basic breakdown of TuyaMCU communication there for the similar device to yours. Maybe it could help.

    spin55 wrote:

    It is not loading the drivers and see how it disconnects and reconnects the BK7321N from time to time.

    This is normal. If you don't have tmSensor running, the MCU will try to reboot MCU in infinite loop. This is because the MCU is waiting for OBK to send first packet, which is:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    You can see that OpenBeken tmSensor driver sends it after 3 seconds uptime:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    spin55 wrote:

    And that's how it is now. It does a boot cycle of 123 times and stops. It is only reactivated by pressing the button or disconnecting and reconnecting.

    123 times? I looked at the log text and I see that by "123 times" you mean uptime 123 second... ok..
    
    Info:MAIN:Time 123, idle 194114/s, free 75184, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38
    

    So you are saying it does not wake up to make measurement again after N seconds?

    My main conclusions would be:
    1. uptime 123 seconds is enough to report values over MQTT, do you get them?
    2. if it does not wake up later to do another measurement, then something is missing from UART protocol
    3. Again, full capture of what is sent by Tuya original firmware on both lines would be very, very helpful. Because then I can compare packets one by one and see what is missing for OBK

    This must be something specific to this device, because I already tested that sensor:
    https://www.elektroda.com/rtvforum/topic3914412.html
    with our tmSensor driver and it worked well.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #74 20516798
    spin55
    Level 17  
    p.kaczmarek2 wrote:
    So you are saying it does not wake up to make measurement again after N seconds?


    Yes, that's what I'm saying. Every time I press the button it starts a new cycle, otherwise it just freezes there because the motion sensor isn't responding. It may be because startDriver tmSensor is disabled because otherwise the web won't start.

    :MAIN:Started TuyaMCU.
    Info:MAIN:Time 1, idle 287869/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 2, idle 191602/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 01 00 24 7B 22 70 22 3A 22 6C 79 64 77 6F 62 77 79 71 78 69 79 6F 62 39 68 22 2C 22 76 22 3A 22 31 2E 30 2E 35 22 7D 62 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 1 (QueryProductInformation) with 43 bytes
    Info:TuyaMCU:TuyaMCU_ParseQueryProductInformation: received {"p":"lydwobwyqxiyob9h","v":"1.0.5"}
    Info:MAIN:Time 3, idle 189845/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 02 00 00 01 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF, TODO!
    Info:MAIN:Time 4, idle 186412/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 190106/s, free 80032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid: key:
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 6, idle 191889/s, free 75072, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 179030/s, free 75072, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 112028/s, free 75064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 75064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 10, idle 0/s, free 75064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 62052/s, free 75136, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 12, idle 192673/s, free 74792, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_userName 
    mqtt_pass 
    mqtt_clientID obk1F4A8B0C
    mqtt_host 192.168.1.45:1883
    Info:MAIN:Time 13, idle 190862/s, free 74512, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to obk1F4A8B0C/+/set
    Info:MQTT:mqtt_subscribed to cmnd/obk1F4A8B0C/+
    Info:MQTT:mqtt_subscribed to obk1F4A8B0C/+/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/1/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/1/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/4/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk1F4A8B0C/0/get
    Info:MQTT:MQTT in topic obk1F4A8B0C/0/get
    Info:MQTT:MQTT topic not handled: obk1F4A8B0C/0/get
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:MQTT:channelSet NOT 'set'
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 14, idle 179517/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 187983/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 16, idle 188767/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 17, idle 379182/s, free 63176, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 18, idle 202602/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 19, idle 195116/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 20, idle 195703/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-67,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 21, idle 189655/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 22, idle 192183/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 23, idle 190785/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 24, idle 195135/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 25, idle 386911/s, free 63384, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 26, idle 192083/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 27, idle 384902/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 28, idle 193296/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 29, idle 195475/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 30, idle 190966/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-66,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 31, idle 191475/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 32, idle 190782/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 33, idle 193264/s, free 74864, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 34, idle 204312/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 35, idle 191623/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 36, idle 194624/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 37, idle 193522/s, free 66472, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 38, idle 189201/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 39, idle 192262/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 40, idle 196063/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-69,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 41, idle 191185/s, free 66472, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 42, idle 380627/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 43, idle 193491/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 44, idle 190032/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 45, idle 192649/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 46, idle 189363/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 47, idle 191991/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 48, idle 191397/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 49, idle 193949/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 50, idle 194679/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-68,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 51, idle 187779/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 52, idle 189870/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 53, idle 208010/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 54, idle 195246/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 55, idle 192040/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 56, idle 195657/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 57, idle 193173/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 58, idle 193092/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 59, idle 198749/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 60, idle 194339/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-68,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 61, idle 189808/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62, idle 191507/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 63, idle 191362/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 64, idle 192761/s, free 74864, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 65, idle 191811/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 66, idle 194935/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 67, idle 192790/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 68, idle 203885/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 69, idle 194580/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 70, idle 193542/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-68,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 71, idle 382234/s, free 62336, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 72, idle 190650/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 73, idle 383612/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 74, idle 195157/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 75, idle 193875/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 76, idle 191664/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 77, idle 191641/s, free 74880, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 78, idle 199317/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 79, idle 193216/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 80, idle 192917/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-65,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 81, idle 189373/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 82, idle 190291/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 83, idle 192526/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 84, idle 195617/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 85, idle 192505/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 86, idle 194265/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 87, idle 204613/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 88, idle 194898/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 89, idle 193294/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 90, idle 192805/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-69,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 91, idle 189377/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 92, idle 190179/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 93, idle 198470/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 94, idle 194763/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 95, idle 199900/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 96, idle 190921/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 97, idle 194816/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 98, idle 192111/s, free 74864, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 99, idle 190195/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 100, idle 186539/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-66,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 101, idle 193503/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 102, idle 385550/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 103, idle 191641/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 104, idle 194050/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 105, idle 192380/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 106, idle 195437/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 107, idle 189688/s, free 74656, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 108, idle 192420/s, free 74072, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 109, idle 193140/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 110, idle 190517/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-74,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 111, idle 188389/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 112, idle 193291/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 113, idle 190620/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 114, idle 194812/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 115, idle 190153/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 116, idle 192740/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 117, idle 192443/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 118, idle 194045/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 119, idle 208537/s, free 63384, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MAIN:Time 120, idle 191896/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.65 gate=192.168.1.1 mask=255.255.255.0 mac=c8:47:1f:4a:8b:0c 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-66,ssid=ONO_MAC,bssid=00:1a:2b:48:20:34 ,channel=13,cipher_type:CCMP
    Info:MAIN:Time 121, idle 381633/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 122, idle 189987/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 123, idle 188924/s, free 75088, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    


    1. uptime 123 seconds is enough to report values over MQTT, do you get them?

    When connected to the mains, it publishes all the channels you are subscribed to, but then only reports the status when I manually press the button. Note that in autoexec.bat only startDriver TuyaMCU is enabled because otherwise the web won't start.

    Tema al que suscribirse
    obk1F4A8B0C/#
     
    Mensaje 21 recibido en obk1F4A8B0C/connected a las 19:28:
    offline
    QoS: 0 - Retain: false
    Mensaje 20 recibido en obk1F4A8B0C/connected a las 19:26:
    online
    QoS: 0 - Retain: false
    Mensaje 19 recibido en obk1F4A8B0C/connected a las 19:25:
    offline
    QoS: 0 - Retain: false
    Mensaje 18 recibido en obk1F4A8B0C/connected a las 19:21:
    online
    QoS: 0 - Retain: false
    Mensaje 17 recibido en obk1F4A8B0C/connected a las 19:21:
    offline
    QoS: 0 - Retain: false
    Mensaje 16 recibido en obk1F4A8B0C/connected a las 19:18:
    online
    QoS: 0 - Retain: false
    Mensaje 15 recibido en obk1F4A8B0C/connected a las 19:15:
    online
    QoS: 0 - Retain: false
    Mensaje 14 recibido en obk1F4A8B0C/connected a las 19:12:
    online
    QoS: 0 - Retain: false
    Mensaje 13 recibido en obk1F4A8B0C/connected a las 19:08:
    online
    QoS: 0 - Retain: false
    Mensaje 12 recibido en obk1F4A8B0C/connected a las 19:08:
    offline
    QoS: 0 - Retain: false
    Mensaje 11 recibido en obk1F4A8B0C/0/get a las 19:06:
    1
    QoS: 0 - Retain: true
    Mensaje 10 recibido en obk1F4A8B0C/ip a las 19:06:
    192.168.1.75
    QoS: 0 - Retain: true
    Mensaje 9 recibido en obk1F4A8B0C/freeheap a las 19:06:
    74472
    QoS: 0 - Retain: true
    Mensaje 8 recibido en obk1F4A8B0C/uptime a las 19:06:
    19
    QoS: 0 - Retain: true
    Mensaje 7 recibido en obk1F4A8B0C/rssi a las 19:06:
    -76
    QoS: 0 - Retain: true
    Mensaje 6 recibido en obk1F4A8B0C/sockets a las 19:06:
    2
    QoS: 0 - Retain: true
    Mensaje 5 recibido en obk1F4A8B0C/mac a las 19:06:
    fc:67:1f:4a:8b:0c 
    QoS: 0 - Retain: true
    Mensaje 4 recibido en obk1F4A8B0C/build a las 19:06:
    Build on Mar 25 2023 19:40:31 version 1.15.628
    QoS: 0 - Retain: true
    Mensaje 3 recibido en obk1F4A8B0C/host a las 19:06:
    obk1F4A8B0C
    QoS: 0 - Retain: true
    Mensaje 2 recibido en obk1F4A8B0C/4/get a las 19:06:
    0
    QoS: 0 - Retain: true
    Mensaje 1 recibido en obk1F4A8B0C/1/get a las 19:06:
    0
    QoS: 0 - Retain: true
    Mensaje 0 recibido en obk1F4A8B0C/connected a las 19:06:
    online
    QoS: 0 - Retain: true
    


    2. if it does not wake up later to do another measurement, then something is missing from UART protocol.

    Note that in autoexec.bat only startDriver TuyaMCU is enabled because otherwise the web won't start.

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    3. Again, full capture of what is sent by Tuya original firmware on both lines would be very, very helpful. Because then I can compare packets one by one and see what is missing for OBK

    It is that there is no communication between TuyaMCU and BK7321N with that backup. It's like the device is locked. The LEDs do not respond as the instruction manual says. That's why I went back to the OpenBeken firmware. I already told you with the two original backups and the same thing happens. I will try again.

    The information explained in the link https://www.elektroda.com/rtvforum/topic3914412.html is very interesting, but the Tuya commands have already been commented throughout this and other threads: https://developer.tuya.com/en/docs/iot/tuyacl...niversalserialaccessprotocol?id=K95afs9h4tjjh

    Thanks
  • #75 20517717
    p.kaczmarek2
    Moderator Smart Home
    This is a very hard issue to debug without original packets capture. I don't know how it's possible that original backup does not want to talk with TuyaMCU.

    Futhermore, we have users just right now, today reporting that they have TuyaMCU sensors working in OBK:
    https://www.elektroda.com/rtvforum/topic3968377.html

    So it is something specific to your device. I will try to order a similar one, please wait some time, or maybe we can try something in a meantime.

    Quote:

    It may be because startDriver tmSensor is disabled because otherwise the web won't start.

    It is very strange. By default, the tmSensor is required to get anything over TuyaMCU from battery powered device.
    For my door sensor, to which review I linked earlier, the communication flow is as below:
    - first TuyaMCU powers CB3S
    - then OBK tmSensor sends hello to TuyaMCU
    - TuyaMCU responds
    - then OBK tmSensors sends get state
    - TuyaMCU responds and sends also packets with variables.
    So the behaviour you describe is unexpected.

    Are you really sure that you are getting data over TuyaMCU with no tmSensor started?

    Your device must be using a slightly different protocol than the one I had. And different than the device discussed earlier today here:
    https://www.elektroda.com/rtvforum/topic3968377.html


    Maybe the correct solution would be to don't use tmSensor for your device, and just figure out how to make it wakeup after given time. Maybe it expects OBK to send something setting a sleep time? Maybe one of dpIDs is a sleep time that must be sent? Do you have a list of available dpIDs for this device? Maybe sleep time/measurement interval was configurable in Tuya and that's what we are missing?
    Helpful post? Buy me a coffee.
  • #76 20517809
    spin55
    Level 17  
    First of all, thank you for the help you give me, taking into account all the queries that there are daily.

    This is a very hard issue to debug without original packets capture. I don't know how it's possible that original backup does not want to talk with TuyaMCU.

    I have just flashed the original firmware again and I am not able to pair it with the application. The leds do not work as they should and it does not create AP to configure. In fact there is no data traffic between TuyaMCU and BKNmcu. The leds only turn on momentarily when I press the button, but they do not follow the sequence indicated in the previously published instruction manual.

    Futhermore, we have users just right now, today reporting that they have TuyaMCU sensors working in OBK:
    https://www.elektroda.com/rtvforum/topic3968377.html


    I have several devices of the type TH06 and S09 that have a Tuya chip and work perfectly with the tmSensor driver.

    Are you really sure that you are getting data over TuyaMCU with no tmSensor started?

    If I don't start tmSensor, it starts web but I don't get change data from pir sensor.
    If I start tmSensor the web doesn't start but I can see with Realterm that the communication between MCU's is correct. I have previously uploaded those screenshots. That is, it works fine but without Wi-Fi connection. I can also measure with a multimeter how it controls the voltage on the CEN pin of BKN.

    Your device must be using a slightly different protocol than the one I had.

    I already commented before that I have three pir motion from NEO. One with ESP8266 and the other two with BK7321N which are identical to the one posted by the author of this thread. Same board reference, same firmware version.

    Maybe the correct solution would be to don't use tmSensor for your device, and just figure out how to make it wakeup after given time. Maybe it expects OBK to send something setting a sleep time? Maybe one of dpIDs is a sleep time that must be sent? Do you have a list of available dpIDs for this device? Maybe sleep time/measurement interval was configurable in Tuya and that's what we are missing?

    Everything leads to tmSensor, but you helped get this device up and running and no such problems had arisen. I also had doubts about whether I was doing it right until I received the second pir and I was able to verify that it reproduces the same symptoms.

    In any case, thank you very much for the help.

    Added after 17 [minutes]:

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
  • #77 20517905
    p.kaczmarek2
    Moderator Smart Home
    Quote:

    If I don't start tmSensor, it starts web but I don't get change data from pir sensor.
    If I start tmSensor the web doesn't start but I can see with Realterm that the communication between MCU's is correct. I have previously uploaded those screenshots. That is, it works fine but without Wi-Fi connection. I can also measure with a multimeter how it controls the voltage on the CEN pin of BKN.

    How long is BK module powered if you have tmSensor started?
    Is only Web interface not responsive? How long is it pingable from your PC?

    I am asking because there is nothing in tmSensor that can break Web interface and it only seems like with tmSensor the MCU shuts down the WiFi module too early so it has no time to connect to network... but it's just a guess...
    Helpful post? Buy me a coffee.
  • #78 20518110
    spin55
    Level 17  
    How long is BK module powered if you have tmSensor started?

    13-14 seconds.

    Is only Web interface not responsive? How long is it pingable from your PC?

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    Added after 37 [minutes]:

    Tx:

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    Rx:

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    I am probably wrong because taking a look at the screenshots of the communication between TuyaMCU and BKN I see commands that It doesn't match the information from Tuya: https://developer.tuya.com/en/docs/iot/tuyacl...niversalserialaccessprotocol?id=K95afs9h4tjjh
    There it says that each command must receive confirmation by the other party. So why does BKN respond with a command 08 to a command 05 sent by TuyaMCU?

    The 03 command should not be sent by TuyaMCU?, and should not be 04 instead of 03?. Perhaps that is why there is no answer in Rx?.

    According to Tuya that command 04 would reset the Wi-Fi and select the smartconfig mode. But does this make sense when you have just been told that you are connected to a router and cloud?

    Greetings
  • #79 20518519
    p.kaczmarek2
    Moderator Smart Home
    @spin55 I really want to help you, but I only can use what I have, and I have only the board from mentioned door sensor. I have desoldered the CB3S in the past because I needed it for dev board, but now I added USB to UART converter and I can connect it to PC:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    I think you can understand what I did there, right? PC is in role of OBK now.

    Red LED shown when WiFI module would be powered on.

    My first observation is that it reports nothing when I wake up it with door sensor, the red LED goes on for 10 seconds, then turns off for 0.5 second, then goes on for 10 seconds, and again, and again.
    Basically TuyaMCU tries to power on WiFi module, but receives nothing, so it reboots it after 10 seconds, and tries again, etc. After about 10 cycles of 10 seconds power on, the MCU gives up and turns off WiFi module forever.

    My second observation was made while I wrote a simple tester app for this purpose:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    This app simulated OBK.

    So, when I wake up my door sensor TuyaMCU, and send the first packet from my PC (acting as OBK), I get a reply:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Then, when I send McuConf, I get a reply followed by a state variable (dpID):
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    I am too slow and I had a packet duplicate for some reason, but you get the point... here's the whole communication:
    
    Sent: 55 AA 00 01 00 00 00
    Sent: Ver=0, Cmd=QueryInfo, Len=0
    Sent: 55 AA 00 01 00 00 00
    Sent: Ver=0, Cmd=QueryInfo, Len=0
    Received: 55 AA 00 01 00 24 7B 22 70 22 3A 22 65 37 64 6E 79 38 7A 76 6D 69 79 68 71 65 72 77 22 2C 22 76 22 3A 22 31 2E 30 2E 30 22 7D 24
    Received: Ver=0, Cmd=QueryInfo, Len=36, JSON={"p":"e7dny8zvmiyhqerw","v":"1.0.0"}
    Sent: 55 AA 00 02 00 01 04 06
    Sent: Ver=0, Cmd=QueryStatus, Len=1
    Received: 55 AA 00 01 00 24 7B 22 70 22 3A 22 65 37 64 6E 79 38 7A 76 6D 69 79 68 71 65 72 77 22 2C 22 76 22 3A 22 31 2E 30 2E 30 22 7D 24
    Received: Ver=0, Cmd=QueryInfo, Len=36, JSON={"p":"e7dny8zvmiyhqerw","v":"1.0.0"}
    Received: 55 AA 00 02 00 00 01
    Received: Ver=0, Cmd=QueryStatus, Len=0
    Received: 55 AA 00 08 00 0C 00 02 02 02 02 02 02 01 01 00 01 00 22
    Received: Ver=0, Cmd=QueryRecordStorage, Len=12, [dpID=1, type=1, len=1, val=0]
    

    and now red LED (WiFi module power) stays on much longer...

    I haven't done much tests so far, and it seems that timing also might be a factor here, but everything works within expectations.

    Still, would you be interested in playing around with that tool? You could try replacing WiFi module with USB to UART connector just like I did and we will see how it exactly works in case of your device.

    Otherwise the only way I can see is that I need to get one piece of your problematic device somehow.

    Added after 25 [minutes]:

    Sorry, I had an extra useless byte that was breaking, now here is how full transaction looks like:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    The last "queryrecordstorage" may be named incorrectly, but basically that 0x08 type packet says that reporting is done and MCU can shut down now.

    That's how full transaction looks like for my door sensor.

    @spin55 would you like to try my app to debug your device TuyaMCU?
    Helpful post? Buy me a coffee.
  • #80 20518585
    spin55
    Level 17  
    Still, would you be interested in playing around with that tool?

    Of course I would be interested, but I am afraid that I will be able to install it for the same reason that I could not with TuyaMCUAnalyzer or BK7231Flasher due to a .NET Framework error. But I'm willing to try.

    You could try replacing WiFi module with USB to UART connector just like I did and we will see how it exactly works in case of your device.

    In this case there is no module, the BK7321N goes on the motherboard, but I guess by pulling up the transistor that goes to CEN or forcing it to GND somehow, I could override the chip and freely use Tx and Rx.

    Otherwise the only way I can see is that I need to get one piece of your problematic device somehow.

    I think the best solution would be to try the old app if I can install it. If not, I would not mind sending you the Pir Motion to the address that you indicate by private message. You could also order one and have it delivered there, but we run the risk of it being a different version.

    @spin55 would you like to try my app to debug your device TuyaMCU?

    Of course.

    Greetings
  • #81 20518631
    p.kaczmarek2
    Moderator Smart Home
    Which OS do you have? Which highest NET framework can you support? Maybe I can downgrade used NET framework version so more people can run it on older PCs...

    Sending PIR sensor could work, but... but do you have one still with original firmware?
    Helpful post? Buy me a coffee.
  • #82 20518676
    spin55
    Level 17  
    Sending PIR sensor could work, but... but do you have one still with original firmware?

    The two I have are already flashed. There is one on the way though, when it arrives I'll try to match it up and watch Tx and Rx with RealTerm.

    Which OS do you have? Which highest NET framework can you support? Maybe I can downgrade used NET framework version so more people can run it on older PCs...

    Tomorrow I will try another more modern computer if I can install the programs. I'll inform you.

    Good night
  • #83 20518825
    p.kaczmarek2
    Moderator Smart Home
    Just tell me which OS do you have. I think I can downgrade NET framework much without losing functionality.
    Helpful post? Buy me a coffee.
  • #84 20518829
    spin55
    Level 17  
    Good morning, now I have to go out. The operating system is W10Pro and .NET 3.5.
  • #85 20518841
    p.kaczmarek2
    Moderator Smart Home
    I had to give up on using Min and Max, etc, and write their replacements, but it takes just a one minute to do it.
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Helpful post? Buy me a coffee.
  • #87 20519056
    p.kaczmarek2
    Moderator Smart Home
    Ok I am attaching this program as well:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Here is how a correct transaction seems to look like for my door sensor:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Helpful post? Buy me a coffee.
  • #88 20520149
    spin55
    Level 17  
    Hello.

    I have been able to communicate with TuyaMCU by setting the CEN pin of BK7321N to GND.
    As you can see, TuyaDemo works and makes the task much easier, because it can also be done with RealTerm but it is much heavier.

    I'll experiment with the commands to see what happens. I will inform him and see if between the two of us we deduce where the problem may be.

    Thank you very much for your help. Even if in the end you won't be able to pull this off, the knowledge gained will have been worth it.

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
  • #89 20520204
    p.kaczmarek2
    Moderator Smart Home
    Hello, good job.

    Earlier you have mentioned something like that your MCU device is reporting dpIDs over TuyaMCU even without tmSensor driver, which basically means it will send data over UART without "QueryInfo" packet, which is now shown to be sent on the screenshot you provided.

    Can you now check again, is your MCU really sending data without sending anything from PC first?
    Helpful post? Buy me a coffee.
  • #90 20520260
    spin55
    Level 17  
    Earlier you have mentioned something like that your MCU device is reporting dpIDs over TuyaMCU even without tmSensor driver, which basically means it will send data over UART without "QueryInfo" packet, which is now shown to be sent on the screenshot you provided.

    I don't understand what you mean specifically. Without tmSensor there is no publication of dpIDs but there is wifi, with tmSensor there are dpIDs but there is no wifi.

    Can you now check again, is your MCU really sending data without sending anything from PC first?

    Do you mean if you receive data with TuyaDemo? If so, nothing is received with both CEN to GND and open.

    Added after 11 [hours] 18 [minutes]:

    Hello.
    This is the communication between TuyaMCU and BKN captured with RealTerm and repeatedly posted with images throughout the thread. With tmSensor loaded and working correctly everything except Wi-Fi transmission.

    Tx:


    55 AA 00 00 00 00 FF
    55 AA 00 01 00 00 00
    55 AA 00 02 00 00 01
    55 AA 00 01 00 00 00
    55 AA 00 08 00 00 07
    55 AA 00 00 00 00 FF
    55 AA 00 08 00 00 07
    55 AA 00 02 00 01 04 06
    55 AA 00 03 00 01 00 03
    55 AA 00 08 00 00 07
    55 AA 00 00 00 00 FF
    55 AA 00 08 00 00 07

    Rx:

    55 AA 00 00 00 01 00 00
    55 AA 00 01 00 24 7B 22 70 22 3A 22 6C 79 64 77 6F 62 77 79 71 78 69 79 6F
    62 39 68 22 2C 22 76 22 3A 22 31 2E 30 2E 35 22 7D 62
    55 AA 00 02 00 00 01
    55 AA 00 00 00 01 00 00
    55 AA 00 02 00 00 01
    55 AA 00 05 00 05 01 04 00 01 01 10
    55 AA 00 05 00 08 04 02 00 04 00 00 00 64 7A
    55 AA 00 00 00 01 00 00

    If I am correctly interpreting the information from the Tuya protocol https://developer.tuya.com/en/docs/iot/tuyacl...niversalserialaccessprotocol?id=K95afs9h4tjjh, the MCU reports the DPs via command 05, but BKN replies that it has received a command 08. It doesn't seem right.

    That is, MCU sends: AA 00 05 00 05 01 04 00 01 01 10 55 and BKN confirms with: AA 00 08 00 00 07 55. Wouldn't you have to answer?: AA 00 05 00 00 04 55.

    When this is cleared up, we can continue with AA 00 03 00 01 00 03 55.

    NOTE:
    The commands appear with 55 at the end instead of the beginning because they are direct copies of the RealTerm terminal. Of course, the command starts at 55 on the previous line.

    Added after 39 [minutes]:

    This is the site where I bought the pir in case you want to ask for it: https://es.aliexpress.com/item/10050049224192...st_main.5.21ef194dBswjQ5&gatewayAdapt=glo2esp. It will be faster and safer than if I ask for it to be sent to your address.

Topic summary

The discussion revolves around configuring a motion sensor device powered by the BK7231N chip and utilizing the TuyaMCU protocol. Users share experiences and troubleshooting steps related to flashing the device, setting up the autoexec.bat file, and ensuring proper communication between the TuyaMCU and the Wi-Fi module. Key issues include the device not waking from sleep, MQTT communication problems, and the need for specific commands to maintain connectivity. Solutions involve using RealTerm for monitoring, adjusting baud rates, and ensuring the correct setup of drivers and commands in the autoexec.bat file. Users also discuss the importance of maintaining a stable power supply and the potential for firmware updates to improve functionality.
Summary generated by the language model.
ADVERTISEMENT