logo elektroda
logo elektroda
X
logo elektroda

BK7231N WiFi Door Sensor: Troubleshooting Power with Unmarked 8-Pin MCU

hojnikb 615 3
ADVERTISEMENT
  • #1 21289354
    hojnikb
    Level 11  
    So bought these door sensors
    https://vi.aliexpress.com/item/1005007537059674.html

    Upon first inspection, they appear to be using BK7231N and an unmarked 8pin MCU (or some other chip, TuyaMCU maybe?).

    Now flashing openbeken was no trouble, but now I'm stuck because the device does not appear to get any power to the BK7231N. It appears that the unmarked MCU might be turning on/off the BK7231N chip.

    Any such devices out there and how to get this working?

    Circuit of a door sensor on a green PCB with slots for two AAA batteries. Close-up of a circuit board featuring a BK7231N module and an unmarked chip. Electronic module with visible integrated circuits and traces on a PCB. Electronic circuit board with CB3S wireless module on a white background.

    Added after 2 [hours] 47 [minutes]:

    Ok so i've made some progress;

    Device is pretty much identical to this one
    https://www.elektroda.com/rtvforum/topic4028222.html

    Except TuyaMCU channels are different, so the supplied config doesn't work

    I've corrected this and it works now. Channel 103 mightbe the battery state.

    // Start TuyaMCu driver
    startDriver TuyaMCU
    startDriver tmSensor
    tuyaMcu_defWiFiState 4
    
    //Door
    
    setChannelType 1 OpenClosed
    linkTuyaMCUOutputToChannel 101 val 1
    
    //Battery ?
    setChannelType 2 ReadyOnly
    linkTuyaMCUOutputToChannel 102 val 2


    One thing it does bother me; the output is inverted for the home assistant use. Any chance tuya channels can be inverted, so no workaround is needed for HA ?
  • ADVERTISEMENT
  • #2 21289672
    ribben1989
    Level 2  
    Quote:
    Now flashing openbeken was no trouble, but now I'm stuck because the device does not appear to get any power to the BK7231N. It appears that the unmarked MCU might be turning on/off the BK7231N chip.


    I just found your post and I have bought the same sensor, but for me flashing OpenBeken is quite new and I don't know from where to start 😞 could you maybe share a tutorial for this particular device with me? 🙂
  • ADVERTISEMENT
  • #3 21311875
    ribben1989
    Level 2  
    >>21289354 could you please provide also the OBK template? I have managed to flash OpenBeken but no pin configuration is auto detected
  • #4 21312105
    divadiow
    Level 35  
    ribben1989 wrote:
    but no pin configuration is auto detected


    This device is TuyaMCU controlled so there will be no pin assignments to extract from the factory firmware to then import into OpenBeken. Setup of these devices requires the user to create and populate an autoexec.bat file on the LFS file storage within OpenBeken. Post number 1 of this thread has such content.





    TuyaMCU flashing, setup and configuration guide - configure dpIDs for Home Assistant

    The process can also be gleaned by sifting through other TuyaMCU device threads like:
    [BK7231N] [CB3S] [AHT20] TH01 Generic Temperature and Humidity Sensor Teardown

    or many others in devicelist https://openbekeniot.github.io/webapp/devicesList.html

    Screenshot of a device list with tuya mcu filtering in an application.

    example autoexecs: https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
ADVERTISEMENT