logo elektroda
logo elektroda
X
logo elektroda

[CB3S/BK7231N] Temperature/Humidity Sensor with TuyaMCU - Diagram, Reverse Engin

p.kaczmarek2 21228 62
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • #61 21778475
    davidlichti
    Level 2  
    During my tests with my device, I found that communication is more often initiated by a change in temperature/humidity rather than by a regular interval.
  • ADVERTISEMENT
  • #62 21779058
    helmutbayerlein
    Level 2  
    Oh, that can be a good reason, because during the fast interval, I ever get changes of 0.5°C. I will watch this behavior the next time!
  • #63 21780907
    davidlichti
    Level 2  
    Here is once more the communication with correct timings (rx and tx connected to my logic analyzer) of the BK7231N <--> TuyaMCU Communication:
    BK7231N (0ms):
    55 AA   00   01      00 00      00   
    HEADER   VER=00   Product      LEN      CHK   
    TuyaMCU (+15ms):
    55 AA   00   01      00 24   7B2270223A226A33666A616A66327830617073716770222C2276223A22312E302E30227D   A3   
    HEADER   VER=00   Product      LEN   {"p":"j3fjajf2x0apsqgp","v":"1.0.0"}   CHK   
    
    BK7231N (+1145ms):
    55 AA   00   02      00 01   03   05   
    HEADER   VER=00   McuConf      LEN   03   CHK   
    TuyaMCU (+20ms):
    55 AA   00   02      00 00      01   
    HEADER   VER=00   McuConf      LEN      CHK   
    
    BK7231N (+2077ms):
    55 AA   00   02      00 01   04   06   
    HEADER   VER=00   McuConf      LEN   04   CHK   
    TuyaMCU (+13ms):
    55 AA   00   02      00 00      01   
    HEADER   VER=00   McuConf      LEN      CHK   
    
    TuyaMCU (+165ms):
    55 AA   00   05      00 15   0102000400000101020200040000001C0304000102   50   
    HEADER   VER=00   Unk      LEN   dpId=1 Val V=257,dpId=2 Val V=28,dpId=3 Enum V=2      CHK   
    
    BK7231N (+192ms):
    55 AA   00   05      00 01   00   05   
    HEADER   VER=00   Unk      LEN         CHK   

    I did'nt analyze the pairing process. Please tell me if this is neccessary too for being able to use it with openbeken.
    Could somebody please tell me how to correctly configure this device in OpenBeken Webapp?
    Thanks
📢 Listen (AI):

Topic summary

The discussion centers on the reverse engineering and firmware modification of a Tuya WiFi temperature and humidity sensor based on the TuyaMCU protocol, featuring a separate always-on microcontroller and a WiFi module that activates the MCU for status reporting. Key topics include the analysis of the sensor's communication protocol, schematic extraction, and adapting firmware to operate independently from the Tuya cloud, enabling integration with Home Assistant. Participants share detailed UART packet captures, discuss command 10 (ObtainDPCache) for adjusting data update frequency, and address challenges in serial port data capture and synchronization. Firmware scripting examples for autoexec.bat are provided to optimize sensor reporting intervals and power consumption, including channel linking and persistent storage of channel states using start values or LittleFS. The thread also covers flashing procedures using tools like BK7231 GUI Flash Tool, BigTreeTech BTT Writer, and ltchiptool, with emphasis on correct wiring, baud rates, and overcoming device sleep modes during flashing. Hardware identification points to the U4 chip as the temperature/humidity sensor component. Users inquire about adding external sensors and saving MQTT-received states in flash memory. The development of a bidirectional UART sniffer with TuyaMCU message decoding is also discussed, including software design considerations for real-time data capture. Overall, the thread provides comprehensive technical insights into customizing TuyaMCU-based battery-powered temperature/humidity sensors for enhanced local control and integration.
Summary generated by the language model.
ADVERTISEMENT