logo elektroda
logo elektroda
X
logo elektroda

[Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)

mannsteve 6381 3
ADVERTISEMENT
  • #1 20411743
    mannsteve
    Level 6  
    I just flashed two switches, KS602S, that have the Beken BK7231N chips in them. I purchased two from Amazon about 18 months ago and they had ESP chips. I bought two more earlier this year and discovered that they were not ESP switches any longer.

    But before using my process described here just try latest release (tutorial) without doing any fullFW hacks. FullFW.bin is only needed in rare cases.


    How to flash FullFW.bin to the chip
    Important note- I am not an expert. I could not have figured this out on my own and depended on inputs from @p.kaczmarek2.

    1. Flash the device using BK7231Flasher.exe with FullFW.bin (Attached).
    FullFW.bin is a full 2MB flash with empty MAC and RF data. This clears the incompatible RF data from Tuya.
    2. Copy FullFW.bin to OpenBK7231N_QIO_1.15.999.bin and put the file into the firmwares folder. The BK7231Flasher will not "see" the FullFW.bin file in the "Select firmware" dropdown otherwise.

    [Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)

    3. Click on "Do backup and flash now".
    4. While the flasher is displaying "Getting bus failed" in yellow, touch the CEL pin to ground for 0.1 to 0.25 seconds to put the device into the flash mode.
    5. Reboot (power off-on) the device and wait a minute (at least) for it to go online and in the AP mode.
    6. On your phone or tablet, look for a network named: "OBK...." and connect to it.
    (When you are warned that Internet is not available, click on "Connect always", or whatever option your device presents).
    7. Open a browser and connect to http://192.168.4.1.
    8. From the menu that you are presented with, click on "Config"

    [Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)

    9. From here, click on "Configure WiFi", then enter your WiFi credentials.

    [Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)

    10. When you click on "Submit", the device will reboot and try to connect to your network. (If everything goes well. Otherwise see below)).
    11. Do an IP scan to find the IP address of the device. (I use Advanced IP scanner).

    [Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)

    12. Enter the device IP address on your browser. (A feature of the Advanced IP scanner is that the dropdown exposes the HTTP link).
    Opening the IP address for the device will bring you back to the menu. Again, open "Config".
    13. Now go to "Change Mac". The binary I used, FullFW.bin, erases the MAC address and if you ever flash a second device you will have a MAC address conflict unless you change them. Now would be a good time to change the MAC address. (In my case I just changed the last digit from 0 to 1. On the second unit I changed the last zero to 2).

    OPTIONAL:
    You may want to turn on the Universal/Local bit in the MAC address. (This bit turned on is analogous to the 192.168.x.y family of private IP addresses). If the Universal/Local Bit is turned on, your MAC address can never conflict with a manufacturer's MAC address. (I did not do this in my examples).
    The Universal/Local bit in the MAC address is the second-least significant bit of the first byte of the address. All MAC addresses physically assigned to real hardware will have this bit set to 0. Locally assigned addresses are supposed to have this bit set to 1 (though this requirement is often ignored). Thus, any address beginning with x2, x6, xA, or xE will be private.[/quote]
    However, if you do this, the IP scanner will not recognize the device manufacturer as Beken because the manufacturers MAC addresses begin with C8:47:8C:...

    [Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)

    IMPORTANT !!! The FullFW.bin hack will not work on two devices unless you use change the MAC address. Otherwise you will get two devices with the SAME MAC on your network! And router will act crazy. That way people can lose a lot of time debugging strange issues!

    After changing the MAC address, it would be advisable to reboot your router.



    I CAN'T FIND THE DEVICE IP
    This means that the device couldn't log on to your network.
    Try this first:
    1. Cycle the power off/on five times. This will put the device into the AP mode again, then go back to step 6.
    2. If re-entering the WiFi credentials doesn't work, try flashing the device again. Back to step 1.
    (Note: I did both, so I don't know which step fixed the problem of the device not being able to connect to my network).



    Once the device reliably connects to your network, go back to the config menu to finish setting up your device.
    Here are the Module Configuration for my KS602S switches:
    P17 - Relay - channel 1
    P24 - LED - channel 1
    P26 - Button - channel 1

    [Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)

    Now you need to do an upgrade to the latest release
    Do not use the config menu item: OTA (update software by WiFi). This won't work with an .rbl file.<br>
    1. Go to https://github.com/openshwprojects/OpenBK7231T_App/releases and download the *.rbl file for your device.
    In my case the KS602S switches have the BK7231N chip, so I downloaded OpenBK7231N_1.15.394.rbl
    2. Open the Web App by entering your device IP plus /app?. For example: http://192.168.1.32/app? (Alternately, there is a link to WebApp on the config menu).
    3. Click on the "OTA" tab.
    4. Drag the .rbl file you just downloaded to the box labeled: "Drop OTA file here".
    5. Click on "Start OTA.

    [Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)

    6. When OTA is finished, the device will reboot. Wait a few seconds and open the device IP.
    At the bottom of the menu from the device you can see the latest version number.

    [Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)

    Your device is now up to date.
    Hope this helps.
  • ADVERTISEMENT
  • #2 20430392
    Ramney
    Level 2  
    Thanks for the useful information
  • ADVERTISEMENT
  • #3 20436943
    p.kaczmarek2
    Moderator Smart Home
    IMPORTANT:
    Now you can just use our BK flasher:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    first do erase All:
    [Tutorial] Fix for OpenBeken not connecting to WiFi (KS-602S switch, BK7231N chip)
    this will remove RF partition, config, etc. Your MAC will become zeros.
    Then flash OBK latest release (as usual).
    Then in OBK, you need to go to Web App, Flash Tab, click Restore RF Partition, and then change MAC.

    The description above does basically the same what FullFW.bin did, FullFW.bin was a full flash binary with erased RF data. But this work around now is simpler.
    Helpful post? Buy me a coffee.
  • #4 21073852
    crisnar
    Level 1  

    Hello, is it possible to reset the WiFi settings via OTA?
    I have several devices (about 50) already installed with ESPHome firmware. However, I'm experiencing issues with the WiFi with the latest version and I can't revert to the previous one. I've verified that the issues don't occur with the OpenBeken firmware. Before installing ESPHome, I installed OpenBeken, connected them to WiFi, and then installed ESPHome. So, when I load the OpenBeken firmware via OTA (I'm using a converted uf2 version retrieved from here: https://github.com/BenJamesAndo/OpenBeken_uf2_firmware/releases/tag/1.17.230), it tries to connect to the previously connected network, which I don't remember. Unfortunately, I don't have physical access to the devices.

    Is it possible to have a firmware, maybe already in uf2 format because I wouldn't know how to convert it, that automatically sets the device to AP mode?

    Thank
ADVERTISEMENT