Here we will show how to change the firmware of the Tuya relay using BK7231 This will allow us to free it from the cloud, from the manufacturer's servers and connect with other ecosystems such as Home Assistant The process shown here will be quite interesting as it will require you to cut one track on the PCB and remove one capacitor Not all relays require such operations We've chosen this one for video, because it's interesting The presented materials were recorded by a friend from the forum Start with removing the housing, just pry it with a flat screwdriver This relay is based on the CB2S WiFi module, i.e. BK7231N The board has a 3.3V LDO voltage regulator. You can see it's pinout on the screen Power supply (5V) can be soldered to the regulator input AX, TX and sin has to be soldered to the CB2S pads First, tin the wires Then put the flux on the pads Then put additional Pb solder on the pads Now hold the TX wire with one hand and solder it with the other hand Solder the power supply to the 3.3V stabilizer pins (5V to Vin, GND to GND) As before, flux, Pb solder, wires Now solder the CEN signal Here is our USB to UART converter It has an additional 5V output, routed directly from the USB This USB to UART converter has a goldpin marked "5V", but is not suitable for this It is used to select the voltage levels 5V Voltage levels are selected as 3.3V, as BK7231 runs on 3.3V They are selected by the jumper on the blue breadboard, jumper is between 3.3V and VDD Lets connect our module, leave the CEN signal loose Then prepare the second loose wire, connect it to GND Shorting CEN to GND will RESET the system, but remember, it's tricky to do it Those wires must be shorted for a fraction of second, while programming tool is waiting for 'Getting bus' Now we would program normally as in the previous video about the bulb, but here's one problem. Can you see this PCB track? It's one of programming UART signals and it leads to the button with a pull up resistor. It will interfere with the programming We need to cut it temporarily. See that little capacitor? It is also on the UART line. It's probably here to debounce the button We will remove it, debouncing is done in new firmware in software Capacitor removed Now, finally, there will be no programming interference You can finally back up 2 megabytes of firwmare and upload a new firmware As in the previous video - use hid_download_py. Start flash command and RESET module You have a link to the previous video in the description The only difference is that here we reset by a short CEN short circuit to ground, as in the video In the previous video we did that just by repowering the module After making sure that everything works and OpenBK wi-fi Access Point showed up desolder the wired Now we have to fix the cut PCB track We can make a jumper from an axial resistor lead Remove the soldermask from the track to be able to solder to copper more conveniently Cut the jumper to size, position it, solder it After all, clean the PCB from flux Now we will show the pin configuration in OpenBeken Configure the pin on which is the relay and the pin on which there is a button. From now on, we can control the relay via WiFi From now on, we can control the relay both from the batton on the device and by the WIFI On the OpenBeken web panel we have a button which, when clicked, allows you to change the state of the relay OpenBeken also allows us to pair this relay with HomeAssistant, among others And script it freely, you can read about scripting on our Github Finally, I would like to show you our teardowns database. If you have an interesting device you can make some photos from inside, some photos of case and packaging and post it on our Teardowns Section. See you on the forum!