logo elektroda
logo elektroda
X
logo elektroda

[BK7231N] Issues with Magnetic Sensor Not Working After Openbk Firmware Flash

calcu 606 14
ADVERTISEMENT
  • #1 20884079
    calcu
    Level 3  
    Hi,

    Like i wrote in another post i purchased 2 parking door controllers.
    I was able to load Openbk firm finally to both of them.

    But now i have only 1 problem, the magnet sensor doesn't work.

    This is the TUYA config read with your tool from device (using webapp Download Tuya Gpio Config):

    
    {
    	"rl1_lv":"1",
    	"alarm1_time":"600",
    	"bt1_pin":"6",
    	"netled_lv":"0",
    	"door_alarm_st1":"12",
    	"switch1":"1",
    	"net_trig":"2",
    	"door_mag1":"3",
    	"jv":"1.0.0",
    	"bt1_type":"0",
    	"nety_led":"2",
    	"tracetime1":"4",
    	"alarm_t1":"5",
    	"voice_ctrl1":"6",
    	"netled_pin":"26",
    	"bt1_lv":"0",
    	"door1_magt_pin":"8",
    	"reset_t":"5",
    	"indep_cfgbt":"false",
    	"rl1_dr_type":"2",
    	"door1_magt_lv":"0",
    	"module":"CB2S",
    	"voice_ctrl_set1":"11",
    	"cntdown1":"2",
    	"ch_num":"1",
    	"rl1_pin":"7",
    	"trl1_time":"20",
    	"netn_led":"0",
    	"crc":"56",
    	"}@BAgw_di{abi":"0",
    	"id":"null",
    	"swv":"1.1.2",
    	"bv":"40.00",
    	"pv":"2.2",
    	"lpv":"3.4",
    	"pk":"key8tg9kykj4g8dw",
    	"firmk":"key8tg9kykj4g8dw",
    	"cadv":"1.0.5",
    	"cdv":"1.0.0",
    	"dev_swv":"1.1.2",
    	"s_id":"null",
    	"dtp":"0",
    	"sync":"0",
    	"attr_num":"1",
    	"mst_tp_0":"9",
    	"mst_ver_0":"1.1.2",
    	"mst_md5_0":"null",
    	"mst_tp_1":"0",
    	"mst_ver_1":"null",
    	"mst_md5_1":"null",
    	"mst_tp_2":"0",
    	"mst_ver_2":"null",
    	"mst_md5_2":"null",
    	"mst_tp_3":"0",
    	"mst_ver_3":"null",
    	"BAtimer_arr0uIAtls_ca_cnt0{lastFetchTime":"0",
    	"cnt":"0}0{abi",
    	"mst_md5_3":"null }[{trigger",
    	"type":"obj",
    	"mode":"rw",
    	"property":"{type",
    	"{type":"obj",
    	"max":"86400",
    	"scale":"0",
    	"step":"1",
    	"{trigger":"direct",
    	"lckey":"^tR0n)+4sIC3Avt>",
    	"h_url":"http",
    	"h_ip":"42.192.25.216",
    	"hs_url":"null",
    	"hs_ip":"null",
    	"hs_psk":"https",
    	"hs_psk_ip":"81.69.183.170",
    	"mqs_url":"null",
    	"mqs_ip":"null",
    	"mq_url":"m2.tuyacn.com",
    	"mq_ip":"121.5.97.151",
    	"ai_sp":"null",
    	"ai_sp_ip":"null",
    	"mq_psk":"m2.tuyacn.com",
    	"mq_psk_ip":"121.5.97.151",
    	"lp_url":"baal.tuyacn.com",
    	"lp_ip":"42.192.35.108",
    	"time_z":"+08",
    	"s_time_z":"[]",
    	"wx_app_id":"null",
    	"wx_uuid":"null",
    	"dy_tls_m":"0",
    	"cloud_cap":"1025",
    	"psk21_key":"null }{nc_tp",
    	"ssid":"VFAtTElOS19DMEVFIDIuNA==",
    	"passwd":"YWJzNTQzMjE=",
    	"md":"0",
    	"random":"0",
    	"wfb64":"1",
    	"stat":"2",
    	"token":"USAGKhwt",
    	"re gion":"AY",
    	"reg_key":"3mrC",
    	"dns_prio":"0 }2iAgw_wsm{nc_tp",
    	"region":"null",
    	"psk_key":"A5mXQX3X23GTtLlaE25oKix8asj3rBGTdRPO6",
    	"auth_key":"EOIgzgEy3pnF1JrCxYqmLAKA8S4PafwY",
    	"ap_ssid":"SmartLife",
    	"ap_passwd":"null",
    	"country_code":"null",
    	"bt_mac":"null",
    	"bt_hid":"null",
    	"prod_test":"false",
    	"fac_pin":"deyeioifmyvdalnc }{nc_tp",
    	"index":"0}#HAble_beaconkeyAFE938CD573E6503EA348BAA0EC8D770eAem_sys_envbk7231n{key"
    }
    


    I have updated the firm with Version: 1.17.382

    On Home assistant after a reboot, they seems to be fine:

    Screenshot of control panel displaying controls and sensor information.

    The relay (marked as 1) is working fine, but the magnet sensor (55) is not working at all

    Any help?

    This is what i'm finding at index from the device:

    Device configuration screen for ParkingE1 with active channel.
  • ADVERTISEMENT
  • #2 20884433
    p.kaczmarek2
    Moderator Smart Home
    Okay, let's start with your config, can you show your GPIO settings?
    Helpful post? Buy me a coffee.
  • #3 20884486
    calcu
    Level 3  
    Sure:
    This is the text description from Extract Config from Tuya binary:

    Device configuration, as extracted from Tuya: 
    - Button (channel 1) on P6
    - WiFi LED on P26
    - Door Sensor (channel 1) on P8
    - Relay (channel 1) on P7
    Device seems to be using CB2S module, which is using BK7231N.
    And the Tuya section starts, as usual, at 2023424
    


    Attached the 2mgs backup file .
    This are the pins used:
    Screenshot of a device configuration with highlighted pins P6, P7, and P8, all set to High value. Screenshot of pin P26 configuration for a Tuya device.
  • ADVERTISEMENT
  • #4 20884537
    calcu
    Level 3  

    I don't have any active driver, in the meantime I will play with TuyaMcu to see if I'm capable of doing something :-)
  • #5 20884652
    p.kaczmarek2
    Moderator Smart Home
    No, there is no TuyaMCU in this device.

    Okay, so P8 is a door sensor, right? Does the sensor react to closing the door and opening it? Or, to be precise, by moving the magnet to the hall sensor and moving it away? Or does it stay same all the time?
    Helpful post? Buy me a coffee.
  • #6 20884684
    calcu
    Level 3  

    In original form, it was reacting.

    Now no reaction at all, but I can't see displayed anywhere, nor it's not published to HA

    Screenshot of ParkingE1 interface showing status OFF.

    It seems it's sending the binary sensor, but it's not:

    Screenshot of MQTT connection logs showing configuration attempts and Home Assistant discovery.
  • #7 20884689
    p.kaczmarek2
    Moderator Smart Home
    Are you really sure that there is no change on P8?
    On this screenshot, P8 is high:
    Screenshot of a configuration panel with three ports P6, P7, P8 set to high values.
    On this screenshot, it's low:
    Screenshot of a control panel showing the Open status for channel 1.

    I will ask again - is the WWW panel showing "Open" all the time? Even if you "close the door"?

    If you are really sure that it's showing "Open" all the time, then you may consider changing dInput role to,, for example, dInput_noPullUp, etc, to check various pull up options.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #8 20884719
    calcu
    Level 3  

    This open reacts at Relay.

    The WWW panel doesn't show anything about the magnet status.

    And it was showing open because I played with commands at this post:

    https://www.elektroda.com/rtvforum/topic3936372.html#20300142

    I just reset everything and now:

    Control panel interface showing ON status.

    Only shows Toggle (relay) (pin7)

    Screenshot of the configuration panel with pin settings for P6, P7, and P8, all set to high.

    All 3 pins are high, if I change the relay value, all 3 changes to LOW, but together, it's like P8 and P7 were linked somehow.

    Added after 5 [minutes]:

    If I change P8 this way

    Screenshot of pin configuration for P6, P7, and P8 with settings and High values.

    When I use the magnet with this config, the relay is reacting, I mean, if I move the magnet to the hall sensor and moving it away the relay reacts and opens/closes.

    But I don't want that xD, I only want to show the status of the magnet sensor.
  • #9 20884735
    p.kaczmarek2
    Moderator Smart Home
    So you configured P8 correctly now. This means P8 should be dInput with no pull up (see role name).

    The values are linked because you assigned them all to channel 1.

    If you want to separate P8 from relay, change P8 channel to let's say, channel 2, and keep relay at channel 1.

    Then they will be split. Please try.
    Helpful post? Buy me a coffee.
  • #10 20884753
    calcu
    Level 3  

    Ok, Finally!

    With this config:

    Control panel showing configuration of ports P6, P7, and P8 with high and low values.

    It's finally working!
  • #11 20884758
    p.kaczmarek2
    Moderator Smart Home
    That's good to hear, now... now, are you aware that you need to configure this sensor for power saving? Deep sleep usage?

    Otherwise battery will drain in one day...
    Helpful post? Buy me a coffee.
  • #12 20884880
    calcu
    Level 3  

    Well, no problem with that, it's powered at 220V.

    No battery at all.

    Thanks!
  • ADVERTISEMENT
  • #13 20884926
    p.kaczmarek2
    Moderator Smart Home
    Ah, so you've made a modification, right? Some kind of DIY? Then please consider posting it as a DIY/guide here:
    https://www.elektroda.com/rtvforum/forum513.html
    We can also send you a free set of gadgets for submitting a DIY article, but keep in mind that for our gadget program you need to write at least some explanation, how was DIY made, why, how it works, provide photos, maybe demonstration, etc.

    Or.... by "parking" you mean a garage door controller? The one that works at 5V out of the box? Is it on our list here?
    https://openbekeniot.github.io/webapp/devicesList.html
    If it's not, then again, please provide some information, photos, etc, maybe info where it was bought, and your current config template from Web App, so we can add it to our list. Thanks.

    Our teardowns list is almost at 500 devices mark, we want to reach 500 entries soon.
    Helpful post? Buy me a coffee.
  • #15 20885075
    p.kaczmarek2
    Moderator Smart Home
    I haven't seen that model yet, so it may be interesting.
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around issues faced after flashing Openbk firmware on two parking door controllers, specifically regarding a non-functional magnetic sensor. The user provided a Tuya configuration, detailing GPIO settings and pin assignments. Initial troubleshooting involved verifying the sensor's response to magnet proximity, which was found to be unresponsive. After several exchanges, it was determined that the sensor was incorrectly configured, linking it to the relay channel. By reassigning the door sensor (P8) to a separate channel, the magnetic sensor began functioning correctly. The user confirmed that the device is powered by 220V, eliminating concerns about battery drain.
Summary generated by the language model.
ADVERTISEMENT