logo elektroda
logo elektroda
X
logo elektroda

[Solved] [CBU/BK7231N] AVATTO GDS16 WiFi relay module - Sensor Problem

gobbirock 366 3
ADVERTISEMENT
  • Sensor pin likely needs different GPIO mode

    #1 21909526
    gobbirock
    Level 5  
    Posts: 4
    Hi everyone, I bought a garage door opener from Avatto GDS16:
    [CBU/BK7231N] AVATTO GDS16 WiFi relay module - Sensor Problemcase.png (5.23 MB)You must be logged in to download this attachment.
    [CBU/BK7231N] AVATTO GDS16 WiFi relay module - Sensor Problemside_1.png (5.58 MB)You must be logged in to download this attachment.
    [CBU/BK7231N] AVATTO GDS16 WiFi relay module - Sensor Problemback_1.png (5.32 MB)You must be logged in to download this attachment.

    I was able to get the original firmware and get the info below:
    I: UPK: Found BK7231N config!
    I: UPK: Switch/plug config
    I: UPK:  - relay 1: pin P6
    I: UPK:  - button 1: pin P26
    I: UPK: Status LED: pin P9, inverted False


    ADVERTISEMENT


    After that, flashing the ESPhome kickstart firmware was easy.

    The relay and the LED work fine, no problem at all, but I was not able to make the sensor pin work.
    I try to mark the pin as an input_pullup and other pins as well, but nothing works.
    I have two of it and the result is the same for both.
    Can someone help me figure this out?

    This is the code that I use:
    Code: JSON
    Log in, to see the code
  • ADVERTISEMENT
  • Helpful post

    Suggesting flash backup check and pull-up tests

    #2 21910378
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14721
    Help: 659
    Rate: 12806
    Do you have original 2 MB flash backup so we can double check?

    So basically, extraction tool determined that P26 is input/button, but yet it's not working at all? Have you tried all pull up/down/etc combinations?

    And you are saying that both pieces are not working.... maybe a software error?

    Have you tried to configure it, for now, as a simple switch, without delayed_on_off?

    Curious how it would work with OpenBeken?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • Tuya pin mapping for button, sensor, relay and LED

    #3 21939289
    gobbirock
    Level 5  
    Posts: 4
    Hi p.kaczmarek2
    I uploaded the original flash so you can take a look too.
    I was using the ltchiptool to get the information from the original firmware, now I try to use the BK7231GUIFlashTool and get new info.

    Device configuration, as extracted from Tuya:
    - Button (channel 1) on P26
    - WiFi LED on P9
    - Door Sensor (channel 1) on P8
    - Relay (channel 1) on P6

    The pin 26 is the Button behind the the device, the door sensor is in the Pin 8.
    I flash it again with the kickstart to test it, but still not working.

    kickstart-bk7231n panel showing pin P26/PWM5 settings and event log on the right

    I am going to try with the OpenBeken to see if it works with it.
    Attachments:
    • atto-garagem.bin (2 MB) You must be logged in to download this attachment.
  • #4 21939616
    gobbirock
    Level 5  
    Posts: 4
    I'm so stupid, the magnetic sensor is in the S3+S4 contacts, not in the S1+S2, this are the relay contacts
    Any way, this are the correct pins!

    Device configuration, as extracted from Tuya:
    - Button (channel 1) on P26
    - WiFi LED on P9
    - Door Sensor (channel 1) on P8
    - Relay (channel 1) on P6
    One more thing hacked successfully! tks
ADVERTISEMENT