Elektroda.com
Elektroda.com
X

[Youtube] How to flash BK7231T smart 2gang switch and free it from the cloud - video guide

p.kaczmarek2 2217 25
This content has been translated flag-pl » flag-en View the original version here.
  • [Youtube] How to flash BK7231T smart 2gang switch and free it from the cloud - video guide
    The video presents a summary of the firmware change in the Tuya switch for WiFi 2.4GHz based on BK7231T (here WB3S). This particular switch, in order to change the firmware, required desoldering the touch button controller chip in the SOIC housing, because it occupied the UART line needed for programming. This problem does not always occur, sometimes the manufacturer will leave the UART port free, and sometimes even lead it to marked pads, but there was no such comfort here.
    Fortunately, the problematic circuit can be desoldered with the cheapest Chinese soldering iron, all you need is the right method, flux, additional binder and attention not to overheat the path:



    The video was prepared with the help of my assistant (thank you for helping me with the film) and sped up accordingly.

    Even products on ESP sometimes encounter similar problems. Another solution would be to cut the paths or (if possible) to put the problematic system (e.g. the second microcontroller, from TuyaMCU) into the RESET state.

    The purpose of the firmware change is to free the product from the cloud and from the manufacturer's servers, as well as to enable free control and connection to Home Assistant (and not only, OpenBeken even supports SSDP and even Windows devices "see" such programmed switches).

    The video contains English subtitles, because it is also aimed at our English-speaking users (ultimately, the thumbnail and perhaps the lector will be changed and it will also be placed on elektroda.com).

    The firmware used, OpenBeken, supports the BK7231T, BK7231N, XR809, BL602, W600 and W800 (and similar) platforms, on all the operations are quite similar, although the tools for uploading the batch differ to some extent. Details in the project readme.
    https://github.com/openshwprojects/OpenBK7231T_App

    Used firmware - OpenBeken - ready binaries for supported platforms:
    https://github.com/openshwprojects/OpenBK7231T_App/releases

    A simple Windows program for uploading/reading a batch - bkWriter 1.60:
    https://github.com/openshwprojects/OpenBK7231T/blob/master/bk_writer1.60.zip

    A more complex batch upload/download program written in Python - hid_download_py:
    https://github.com/OpenBekenIOT/hid_download_py/issues

    Previous video about the relay:
    [Youtube] Firmware change in Tuya relay with busy UART lines
    Previous video about the LED "bulb":
    [Youtube] Removing the SMD module and changing the BK7231 firmware in the RGBCW LED lamp

    And the contest:
    Present your own construction or send an article and receive a 64GB SD card
    It also applies to topics placed in " Equipment indoors ", i.e. descriptions of e.g. IoT gadgets, but not only.

    Side news/organizational matters:
    1. The BK7231N platform in OpenBeken received a patch last month that significantly improved stability with a large number of MQTT events (problems were reported by several users, they are now fixed)
    2. OpenBeken recently supports Home Assistant Discovery, so you don't have to manually copy the configuration. Config->Generate Home Assistant CFG and there you need to click the new button:
    [Youtube] How to flash BK7231T smart 2gang switch and free it from the cloud - video guide
    3. OpenBeken already supports the W600 and W601 WinnerMicro platform (thanks to the help of one of the contributors).
    4. OpenBeken has recently supported an online device database (Launch Web Application->Config):
    [Youtube] How to flash BK7231T smart 2gang switch and free it from the cloud - video guide
    The database contains photos of devices, their templates, settings and scripts as well as links to Elektroda. Do you have any new device? Anyone can add them via pull request to:
    https://github.com/OpenBekenIOT/webapp/blob/gh-pages/devices.json
    Here you can see the database of devices in an accessible form:
    https://openbekeniot.github.io/webapp/devicesList.html
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 5843 posts with rating 5827, helped 279 times. Been with us since 2014 year.
  • #2
    Mateusz_konstruktor
    Level 33  
    Is this device available for sale in Poland and does it have a distributor, or does it have to be individually imported from abroad?
  • #3
    p.kaczmarek2
    Moderator Smart Home
    Your question can be answered in two ways. This particular switch was bought on eBay, but this type of products floods various types of shops also in Poland and on our Polish auction portal you can also buy them with shipping in the Smart package - you get them after 2 days by courier to your hands (or on Parcel locker). And the interiors are more or less similar and the programming procedure is analogous.

    If you buy a switch of this type, then generally or you can get one on ESP8266, e.g. described here:
    https://www.elektroda.pl/rtvforum/topic3749207.html
    or rather on BK7231T/BK7231N. I haven't come across switches on other modules yet, though someone from the USA mentioned that he got a W600 switch, but my OpenBeken supports it anyway . In both cases, you upload the batch via UART (you need to locate the appropriate pins) and possibly, when these pins are "occupied", you have to cut the paths or remove the problematic system as in the video.

    Both ESP and BK are programmed via UART. Tuya-convert (programming without opening the housing) can also work with ESP, if you're lucky. Newer ESP products no longer work with Tuya-convert.

    Some time ago I posted a short topic about similar switches, but on ESP - then there is the plus that you can upload Tasmota:
    https://www.elektroda.pl/rtvforum/topic3933329.html

    So you have a wide choice.

    I will only add that it is also worth considering the WiFi + RF433 option, at least one to buy in Poland - e.g. the QTouch series (but still produced, of course ... you know where). QTouch I described, among others. here:
    https://www.elektroda.pl/rtvforum/topic3793509.html
  • #4
    Mateusz_konstruktor
    Level 33  
    Lots of unknowns.
    In addition, the manufacturer himself may want to start blocking the possibility of changing the software to other than "company" at some point. I am thinking here of changes in electronic design, especially in the circuits located on the printed circuit board.

    You would have to make lists: which versions should not be bought and which ones are already proven and the whole project has a chance of success.
    How to keep up to date and know what is hidden under the casing of the latest releases of externally identical devices?
  • #5
    p.kaczmarek2
    Moderator Smart Home
    I do not know a single case of "blocking by the manufacturer" ESP8266 or BK7231T or BK7231N. Even if you break the bootloader in BK, you can get to the system via SPI. The only thing "blocked" is tuya-convert - so newer products with ESP cannot be programmed without opening the housing.
    Physically it is also rather hard, there is always some access to the RX / TX pads. Even in these smallest modules:
    [Youtube] How to flash BK7231T smart 2gang switch and free it from the cloud - video guide
    Someone could write "what if there will be modules without RX / TX at all" - well, that would be a problem, but somehow I don't expect it and I haven't encountered it at the moment.

    Mateusz_konstruktor wrote:

    You would have to make lists: which versions should not be bought and which ones are already proven and the whole project has a chance of success.
    How to keep up to date and know what is hidden under the casing of the latest releases of externally identical devices?

    Generally, it's something like this with my users from the USA and from around the world we already do (well, we try to do) - hence the flood of topics in "Device interiors":
    https://openbekeniot.github.io/webapp/devicesList.html
  • #6
    Mateusz_konstruktor
    Level 33  
    I wrote about one or another manufacturer of the entire device.

    However, it is obvious to change the software of the module itself, which is designed with the intention of freely uploading new software to it.

    What could this look like in practice? Currently, we have one version of the internal plate, and in some time we can expect another version that no longer cooperates. Buying and persuading after unpacking?
  • #7
    p.kaczmarek2
    Moderator Smart Home
    There are a few "internal boards" of WiFi modules, but they all have pads that are also probably used in the factory for testing. Rather, it would not be profitable for them to make a version absolutely without these pads. I have not yet met a board from Tuya that would not have been derived in any form of programming interface.

    If they change to something "non-cooperative" then someone will stumble upon it sooner or later and report it. And just in case, there is always a chance that the new module will have a compatible footprint, eg with the easy-to-buy ESP12E, and then it can be replaced at a low cost. Some people do that too.
  • #8
    Mateusz_konstruktor
    Level 33  
    Entire device = switch.
    I did not and I do not mean the component itself, which is the Wi-Fi module.
  • #9
    p.kaczmarek2
    Moderator Smart Home
    If by "internal board" you mean the PCB of the switch and not the WiFi module, this is the smallest problem. After all, the paths to the touch buttons and relays, and possibly the WiFi LED, can be traced anew or, as a last resort, guessed. There is even a tool in OpenBeken that shows input states.

    In general, the interiors of devices evolve over time (e.g. LSPA9 is older on BK7231T + BL0937 and newer on BK7231N + BL0942) but you have to come to terms with it and we try to include it in the list linked above.

    We create templates and ready-made pinout descriptions to help users, but we know that generally you can find a device with a different "pinology" and this is not a problem.

    If you mean something else, please elaborate. I'm not sure if I understand correctly what you're referring to.
  • #10
    Anonymous
    Level 1  
  • #11
    p.kaczmarek2
    Moderator Smart Home
    It's quite possible, but nothing suggests it yet. They may introduce a new WiFi chip soon, either completely "unavailable" or simply without SDK.
    It was similar when no one knew that Beken could be programmed, then people also exchanged modules. For example, here someone bought 30 lamps and soldered 30 times:
    [Youtube] How to flash BK7231T smart 2gang switch and free it from the cloud - video guide
  • #12
    Mateusz_konstruktor
    Level 33  
    Which items to choose from the store shelf?
  • #13
    Anonymous
    Level 1  
  • #14
    Mlody_Zdolny
    Level 25  
    spec220 wrote:
    Makita knows about BMS counterfeits, that's why they constantly mess with the housings, so that something still doesn't fit, and another hour in the back before you polish it all up so that it fits professionally.

    May this practice end as soon as possible, just like standardization to USB-C in the case of chargers for smartphones and laptops in the EU.
    So far, you can come across 3D models of adapters between different mounting systems.
  • #15
    Anonymous
    Level 1  
  • #16
    Mateusz_konstruktor
    Level 33  
    There doesn't have to be any extreme activity.
    It is enough, for example, considering this particular model, to change the button controller to a different type.
  • #17
    Spanner
    Level 14  
    Interesting way of desoldering. I usually sucked as much binder as possible from the pads with a braid and then removed the chip after heating it with hot-air. Of course, this method is not always possible. When desoldering from a system in which you do not know the BOM or the schematic, it is good to glue the surrounding small elements with kapton, because it may happen that when the board is accidentally moved, small elements may change their place and this may cause problems.

    A preheater is useful if the board allows its use.

    An interesting fun was once when desoldering a module in the form of a PCB soldered on another PCB - it had to be done in such a way as not to damage either the board or the module. The problem was that the module had pads (I don't know what it's called exactly, it's figuratively a semicircle - as if a metallized THT pad was cut in half) on both sides, and I don't know if there were even any on the third edge.

    The three of us desoldered it - one of us heated a copper wire of about 1mm soldered on one side of the pads with one soldering iron, I heated the other side in the same way and had tweezers at the ready, the third of us heated the whole thing with hot air. In addition, the whole thing on the heater ?

    The whole thing was finally completed successfully.
  • #18
    Anonymous
    Level 1  
  • #19
    p.kaczmarek2
    Moderator Smart Home
    If indeed IoT devices are on the "black dots", it is known that it will be difficult to do anything sensible. Fortunately, that's not likely to happen yet.

    The desoldering method was also presented here:
    https://www.elektroda.pl/rtvforum/topic3918655.html
    [Youtube] How to flash BK7231T smart 2gang switch and free it from the cloud - video guide

    Some people go a step further and buy a special desoldering binder - ChipQuik - but I haven't tried it and I'm not going to. I feel like that would be overpaying.
    [Youtube] How to flash BK7231T smart 2gang switch and free it from the cloud - video guide
  • #20
    Anonymous
    Level 1  
  • #21
    Mlody_Zdolny
    Level 25  
    Spanner wrote:
    Interesting way of desoldering.

    The key to success is the flux. Practice shows that flux or even an ordinary, not very advanced solder paste perfectly retains heat and allows you to solder SMD components with a simple soldering iron.
  • #22
    Anonymous
    Level 1  
  • #23
    p.kaczmarek2
    Moderator Smart Home
    spec220 wrote:

    And what binder do you use for SMD desoldering? What is your Sn to Pb ratio?

    I do not use any special binder, the most ordinary Sn60Pb40 sold often in small violets with a characteristic blue plug, although I bought a spool of it some time ago because it is so convenient. And the pasta...

    EDIT: In this topic you have a photo of what I soldered some time ago:
    https://www.elektroda.pl/rtvforum/viewtopic.php?p=19752804#19752804
    I also have two slightly better soldering irons (already adjustable; actually one is a soldering iron station + hot air) but I think that basically it is not ... absolutely necessary, as you have a feeling.

    EDIT2: Ah, just for the sake of clarity, I'm writing here, of course, about situations such as the one in the video from the topic, and not about e.g. removing the MOSFET from the motherboard of the laptop. There you have to really heat it up and the spouts of the mass are large and have high heat capacities. This is completely different than the one small SOIC out of a board such as in a smart switch.
  • #24
    Anonymous
    Level 1  
  • #25
    Mlody_Zdolny
    Level 25  
    spec220 wrote:
    Well, if you have more lead, it should take a little longer to cool down? And then he'll be able to desolder bigger bones...

    It depends on what you want to do and what you care about. If it is hardware repair and SMD components, I do not go without hot-air and pre-heating.
    In the case of THT - the Hakko desoldering gun comes into action.
    If it is the recovery of elements and I don't care about the board, then a soldering iron with a triangular tip with an elongated edge and mainly flux in the form of flux paste or gel.
    I deliberately do not use binders with Pb in the composition at all.
  • #26
    Anonymous
    Level 1