logo elektroda
logo elektroda
X
logo elektroda

Tuya Water Sensor WiFi DY-SQ400B Flashing, Configuration for OBK Esphome/Tasmota style firmware

io2345 6447 110
ADVERTISEMENT
  • ADVERTISEMENT
  • #2 21068872
    divadiow
    Level 34  
    I have not. Have you opened it up? what module/chip?
  • #3 21069018
    io2345
    Level 7  
    CB3S Board. Pictures now in the first thread
  • #4 21069228
    p.kaczmarek2
    Moderator Smart Home
    Looks like TuyaMCU device:
    Electronic board with CB3S module and component markings
    Please do TuyaMCU capture to confirm:
    https://www.elektroda.com/rtvforum/topic3970199.html#20528459
    See also generic TuyaMCU tutorial:
    https://www.elektroda.com/rtvforum/topic4038151.html
    Helpful post? Buy me a coffee.
  • #5 21069430
    io2345
    Level 7  
    Alright, I'll try that. Seems to be quite easy with battery powered modules.

    As I am still a beginner, please, could anyone confirm, that these are the Pins, that I have to connect to UART?
    What about TX2, does that have to be connected somewhere? Or only TX1 ?

    Close-up of CB3S electronic module with visible pins labeled GND, TX D2, RX D1, TX D1.
  • #6 21069433
    p.kaczmarek2
    Moderator Smart Home
    Both flashing and TuyaMCU are using UART1, so you need to check TXD1 and RXD1:
    Pin schematic of the WB3S module showing connections to UART1.
    Both WB3S and CB3S have UART1 on the same pins.
    Helpful post? Buy me a coffee.
  • #7 21069440
    divadiow
    Level 34  
    it'd be cool to get the log from TXD2 though too?
  • #8 21069447
    p.kaczmarek2
    Moderator Smart Home
    Well, for research purposes, sure. You could also try to do one more thing before flashing, namely:
    https://www.elektroda.com/rtvforum/topic4021129.html
    Helpful post? Buy me a coffee.
  • #9 21069759
    io2345
    Level 7  
    >>21069433
    Thanks for clearing things with Pinout. I mistakenly did put GND pin position on the photo on the wrong place "around the corner" ;-)

    EDIT: Fixed photo in above thread #5, so nobody get's confused
  • #10 21069767
    divadiow
    Level 34  
    Did you manage to make a backup and flash OBK?
  • ADVERTISEMENT
  • #11 21069833
    p.kaczmarek2
    Moderator Smart Home
    First I would consider doing either dpID extraction from Tuya or UART capture so we can tell which dpID is alarm, etc, etc.
    Still, we may already know that, if there was a similiar device on our list:
    https://openbekeniot.github.io/webapp/devicesList.html
    or if there was similiar Tasmota device...
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #12 21069867
    io2345
    Level 7  

    RealTerm program interface for serial data capture. Screenshot of a program for analyzing UART packets, showing the interface for capturing data. >>21069228
    Tried that, but no luck. So, maybe I did something wrong, or there is no MCU-communication.
    I tried with UART RX, TX -> Chip RX, TX and with crossed lines as well. Nothing on TX1 and only crap on TX2 (which I guess isn't even connected - see "captures.zip").
    First I tried to capture with "Tuya MCU Explorer / Analyzer", then with "RealTerm".

    I think it is very possible, that there is no MCU-communication, as there is not really much of functionality on the board: Only a hardware button, a buzzer and the two sensor contacts.
  • #13 21069875
    io2345
    Level 7  
    >>21069767
    Me, as being a beginner, I would not dare to flash without knowing what I'm doing ;-)
  • ADVERTISEMENT
  • #14 21069910
    p.kaczmarek2
    Moderator Smart Home
    I still think it's TuyaMCU, either at 9600 baud or at 115200. Let's check something else, but still related.
    Make sure that batteries are inserted.
    When batteries are inserted, is there 3.3V directly on the WiFi module (between WiFI module GND and 3.3V)?

    I am asking because TuyaMCU devices are often controlling WiFi module power via transistor so WiFI module is off most of the time.

    second question - take off batteries, is the continuity between those two points?
    Purple circuit board with WiFi module model CB3S labeled.
    Maybe it's not MCU, after all...

    Also, still without batteries, where TXD1 and RXD1 go? Check with multimeter. Do they connect to SOIC8 chip?
    Helpful post? Buy me a coffee.
  • #15 21070005
    io2345
    Level 7  
    There is always power between GND and V+ on the CB3S unit (measuring with multimeter for four minutes).

    There is direct connection between V+ of the CB3S and the buffer capacitor.

    Tx and Rx on the CB3S unit are not connected to the U6 chip.
  • #16 21070016
    p.kaczmarek2
    Moderator Smart Home
    So this is not a TuyaMCU device. Can you try doing 2MB firmware read with our tool?
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Helpful post? Buy me a coffee.
  • #17 21070074
    io2345
    Level 7  

    This tool automatically starts an erase of the stock firmware, right? I want to avoid this for the moment. How can I achieve it?
  • #18 21070089
    p.kaczmarek2
    Moderator Smart Home
    This tool automatically does a 2MB backup first, but I asked you to do a backup specifically. There is a "Read firmware" button that will make a 2MB flash backup that can be used to extract device configuration.
    Helpful post? Buy me a coffee.
  • #19 21070110
    io2345
    Level 7  
    {
    	"bt_pin":"24",
    	"status_led_pin":"26",
    	"rstcnt":"3",
    	"nxtalm_t":"5",
    	"basic_pin_pin":"8",
    	"bt_lv":"0",
    	"bz_pin_pin":"7",
    	"net_t":"180",
    	"samp_type":"1",
    	"bz_pin_lv":"1",
    	"basic_st":"1",
    	"basic_pin_lv":"1",
    	"alarm_type":"0",
    	"samp_sw_pin":"14",
    	"max_V":"3000",
    	"min_V":"2600",
    	"sound_pin":"6",
    	"samp_sw_lv":"1",
    	"beep_t":"10",
    	"status_led_lv":"1",
    	"samp_pin":"23",
    	"crc":"66",
    	"}hfAgw_di{abi":"0",
    	"id":"null",
    	"swv":"1.1.6",
    	"bv":"40.00",
    	"pv":"2.2",
    	"lpv":"3.3",
    	"pk":"key4cngfa3qtqsk7",
    	"firmk":"key4cngfa3qtqsk7",
    	"cadv":"05Atls_ca_cnt.1.6",
    	"s_id":"null",
    	"dtp":"0",
    	"sync":"0",
    	"attr_num":"0",
    	"mst_tp_0":"0",
    	"mst_ver_0":"null",
    	"mst_tp_1":"0",
    	"mstAtimer_arrer_2":"null",
    	"mst_tp_3":"0",
    	"mst_ver_3":"null }3^Awf_start_mdll",
    	"md":"0",
    	"random":"0",
    	"wfb64":"1",
    	"stat":"0",
    	"token":"null",
    	"region":"null",
    	"reg_key":"null",
    	"dns_prio":"00Atls_ca_cnt0EAtls_ca_cnt0{abi",
    	"cdv":"1.0.0",
    	"dev_swv":"1.1.6",
    	"mst_ver_1":"null",
    	"mst_tp_2":"0",
    	"mst_ver_2":"null",
    	"type":"obj",
    	"mode":"ro",
    	"property":"{range",
    	"{trigger":"direct",
    	"max":"100",
    	"scale":"0",
    	"step":"1",
    	"lckey":"Q>eU*F}PIV<Ev4NL",
    	"h_url":"http",
    	"h_ip":"52.29.225.195",
    	"hs_url":"null",
    	"hs_ip":"null",
    	"hs_psk":"https",
    	"hs_psk_ip":"18.185.182.159",
    	"mqs_url":"null",
    	"mqs_ip":"null",
    	"mq_url":"m2.tuyaeu.com",
    	"mq_ip":"3.66.126.37",
    	"ai_sp":"null",
    	"ai_sp_ip":"null",
    	"mq_psk":"m2.tuyaeu.com",
    	"mq_psk_ip":"3.66.126.37",
    	"time_z":"+01",
    	"s_time_z":"[[1711846800",
    	"wx_app_id":"null",
    	"wx_uuid":"null",
    	"dy_tls_m":"0",
    	"cloud_cap":"1025",
    	"psk21_key":"null "
    }
    


    Text description:
    Device configuration, as extracted from Tuya:
    - Button (channel 0) on P24
    - Status LED on P26
    - PIR sensor on P8
    - Battery Relay on P14
    - Battery Max Voltage: 3000
    - Battery Min Voltage: 2600
    - Battery ADC on P23
    Device seems to use Battery Driver. See more details here: https://www.elektroda.com/rtvforum/topic3959103.html
    No module information found.
    And the Tuya section starts, as usual, at 2023424
  • #20 21070118
    p.kaczmarek2
    Moderator Smart Home
    Whoa, that did the most of the job for you! Okay, so now, do you know how deep sleep works in OpenBeken? You know, the system that puts the device to sleep and wakes it up on button (or sensor) event to report state to HA?
    Helpful post? Buy me a coffee.
  • #21 21070139
    io2345
    Level 7  

    No, sorry. No idea about that. I'm a beginner when it comes to IoT
  • #22 21070823
    io2345
    Level 7  

    >>21070118
    Let me know if there is something more I can do or check for the moment. If not, I would prefer to put the sensor back together. Don't want to stay without flood warning too long...
  • #23 21070841
    p.kaczmarek2
    Moderator Smart Home
    Well, the next step is to flash OpenBeken. Then you do first the configuration without the deep sleep, but without deep sleep, battery will discharge in few days, so it's only for testing. In this stage, you have to check whether the digital input (decoded as PIR) can detect water correctly.

    Once you are sure that your digital input can detect water, and once you have also button configured, you can proceed to testing deep sleep wakeup feature. The testing should be done as follows:
    - make sure button and dInput roles are set
    - for the testing purposes, enter PinDeepSleep command via console
    - then do separate tests for each wakeup method, try to wakeup device via button and via water event....
    Then you will have a choice, you can either use existing driver (like DoorSensor driver - it's called DoorSensor but for water the logic is similiar) or write your own autoexec.bat script...
    Here are some scripting samples:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    But, as a beginner, you will most likely prefer to just use existing solution, the "DoorSensor" driver, which is also good.

    The battery powered devices are a bit harder to configure than the mains powered ones, but don't get discouraged, it's really just a 15 minutes job, and I can guide you through full process.

    So, now that you have 2MB flash backup, the first step is to flash OBK, then connect to OBK access point, and then configure your WiFi data so OBK connects to your router...
    Helpful post? Buy me a coffee.
  • #24 21070858
    io2345
    Level 7  

    Ok, let's start. Draining battery isn't a problem.
    Let me try to flash - with the same tool I used for backup, right?

    Hinzugefügt nach 34 [Minuten]:

    Flashing ok. Connected to local WiFi and MQTT Broker.
    What's next?
  • #25 21070895
    p.kaczmarek2
    Moderator Smart Home
    Of course draining battery in 2-3 days is a problem, but we;'re going to fix that very soon. It's just simpler to setup device without deep sleep first, so you can do some basic tests to make sure that everything is alright.

    So, to flash the device, you should use the same tool, but use the "write" option instead of "read".

    You can also watch some of our tutorials on youtube, here:
    https://www.youtube.com/@elektrodacom
    For instance, here we are flashing one CB2S module with the BK7231 easy flash tool:
    https://www.youtube.com/watch?v=YQdR7r6lXRY
    Helpful post? Buy me a coffee.
  • #26 21070916
    io2345
    Level 7  
    Basic configuration done, I hope, it's not to bad ;-)

    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Full Device Name Here",
      "model": "enter short model name here",
      "chip": "BK7231N",
      "board": "TODO",
      "flags": "1024",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "8": "DoorSnsrWSleep;0",
        "14": "BAT_Relay;0",
        "23": "BAT_ADC;0",
        "24": "Btn;0",
        "26": "LED_n;0"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }


    Currently the hardware button only toggles the LED on/off
  • #27 21070920
    p.kaczmarek2
    Moderator Smart Home
    Well... I am not sure if I would recommend using DoorSnsrWSleep pin role already, because it will automatically invoke deep sleep... but whatever you want.

    Since you have already set the DoorSnsrWSleep role, this means your device is going to sleep after some time, right? So it's becoming offline? Do you have a sleep countdown timer on your HTTP page?

    Now, the next step in this case is the following:
    - first, make sure that you can just wake up your device with a button (this is used as an emergency to recover it if something goes wrong)
    - then, check if you can wake up your device with a water sensor (shorting that sensor or adding water.....)

    It may be helpful for you to connect UART RX to TX2 pin (not TX1 !) of the WiFi module, so you can observe device debug log at 115200 baud, so you can tell what's going on.
    Helpful post? Buy me a coffee.
  • #28 21070943
    io2345
    Level 7  
    I just did put in, what the analysis of the firmware readout delivered as information. Of course, I will put in, whatever you suggest.

    At the moment I'm at work, so nothing will happen before 7 p.m.
  • #29 21071038
    p.kaczmarek2
    Moderator Smart Home
    Here is some futher reading for you, information related to DoorSensor driver (which very well may be used also for water detection):
    https://www.elektroda.com/rtvforum/find.php?q=DoorSensor
    Helpful post? Buy me a coffee.
  • #30 21071114
    io2345
    Level 7  
    >>21070943
    Back now. Right, there is a counter on the device's webpage saying "time until deep sleep", but the counter never goes beyond 50 seconds. The red LED of the device gives a short flash every 8-9 seconds.

    Also, high water level (simulated with resistor between sensors) does not do anything on the device itself. In the Tuya-version the LED starts to flash and the buzzer will activate as long as the water level is high.

    In the Log I can see, that the device switches the value for high water level for a very short time (less than one second), every 8-9 seconds. So, that's probably the reason for the above mentioned LED flash.

    
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MQTT:Publishing val 4411 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 100 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 4411.828125 and percentage 100.000000%
    Info:MAIN:Time 1452, idle 181881/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1453, idle 172940/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 2, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1454, idle 187047/s, free 75752, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1455, idle 187228/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1456, idle 198670/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1457, idle 184043/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1458, idle 371128/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1459, idle 185887/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1460, idle 185564/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-62,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1461, idle 179800/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 0 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 0 
    Info:MQTT:Publishing val 1 to Wassersensor1/0/get retain=0
    Info:GEN:CHANNEL_Set channel 0 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MQTT:Publishing val 4415 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 100 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 4415.853515 and percentage 100.000000%
    Info:MAIN:Time 1462, idle 184377/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1463, idle 172631/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 2, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1464, idle 182464/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1465, idle 183808/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1466, idle 183426/s, free 75968, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1467, idle 184900/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1468, idle 181960/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1469, idle 187075/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1470, idle 184156/s, free 67592, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 3/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-61,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1471, idle 178443/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 0 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 0 
    Info:MQTT:Publishing val 1 to Wassersensor1/0/get retain=0
    Info:GEN:CHANNEL_Set channel 0 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MQTT:Publishing val 4414 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 100 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 4414.511718 and percentage 100.000000%
    Info:MAIN:Time 1472, idle 186544/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1473, idle 168876/s, free 75968, MQTT 1(1), bWifi 1, secondsWithNoPing 2, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1474, idle 183341/s, free 75984, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 3/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1475, idle 186412/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1476, idle 182125/s, free 75968, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1477, idle 183607/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1478, idle 189737/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1479, idle 186442/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1480, idle 184427/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-69,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1481, idle 180483/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 0 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 0 
    Info:MQTT:Publishing val 1 to Wassersensor1/0/get retain=0
    Info:GEN:CHANNEL_Set channel 0 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MQTT:Publishing val 4414 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 100 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 4414.511718 and percentage 100.000000%
    Info:MAIN:Time 1482, idle 191116/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1483, idle 170041/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 2, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1484, idle 184906/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1485, idle 182845/s, free 75984, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 3/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1486, idle 181827/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1487, idle 186179/s, free 75968, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1488, idle 186793/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1489, idle 182851/s, free 75984, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 3/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1490, idle 189198/s, free 75968, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-69,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1491, idle 181699/s, free 75968, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 0 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 0 
    Info:MQTT:Publishing val 1 to Wassersensor1/0/get retain=0
    Info:GEN:CHANNEL_Set channel 0 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MQTT:Publishing val 4414 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 100 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 4414.511718 and percentage 100.000000%
    Info:MAIN:Time 1492, idle 189835/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1493, idle 172355/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 2, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1494, idle 184820/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1495, idle 182586/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1496, idle 186945/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1497, idle 184404/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 1498, idle 186186/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing 1, socks 2/38 


    Voltage reading of the battery is obviously wrong (4,4 Volt instead of 3,3V).

Topic summary

The discussion revolves around the Tuya WiFi Water Sensor DY-SQ400B, focusing on its flashing and configuration for OBK (OpenBeken) and Tasmota firmware. Users explore the device's components, including the CB3S Com-Board and the CR123A 3V battery. Initial inquiries about the device's chip and UART connections lead to suggestions for capturing data using TuyaMCU. As users attempt to flash the device, they encounter issues with UART communication and configuration settings. The conversation includes troubleshooting steps, firmware backup procedures, and the implementation of deep sleep functionality to optimize battery life. Users share their experiences with MQTT integration and alarm configurations, ultimately achieving a working setup for water detection and alerting.
Summary generated by the language model.
ADVERTISEMENT