Hello everyone,
thank you for this post, which was able to give me the basic information I needed in order to setup this sensor (TH01). With the aforementioned discussion about whether or not to sever some pins or desolder the WiFi module, I want to add some comments.
I desoldered it for the reason that I was not able to get the device's created WiFi AP up and running long enough to enter configuration - simply because I was not patient enough. It is not necessary, don't do it, you don't need to. It was taking ages to desolder the battery pins, which was necessary in order not to melt the housing for the later-on desoldering of WiFi module with hot air, it's not worth it, I even damaged the housing while desoldering the battery terminals with my iron - a pain. Now, I would like to quickly give you the steps that worked for me.
I flashed 4 sensors of the same type, and it worked the same for all of them.
1. have a look at the relevant pins:
2. solder 5 indidivual wires to each of those. For TX / RX pins, you can also use the large round test pads on the motherboard, they are easier to access.
3. connect 4 wires (3.3V, GND, TX, RX) to your USB-UART module, mind the 3.3V setting! make sure to connect TX ---> RX and RX ---> TX! If you want to use external 3.3V power source, connect the ground wire (-) of that source to BOTH our sensor AND USB-UART module.
4. prepare Windows tool bk7231flasher: download current firmware (7231N!), I also recommend setting "Change OBK settings for flash write", this way you can already enter your WiFi credentials and mqtt data. Also, here you can already set the flags (I only used flag 10) and enter the startup code that is required for this module
[backlog startDriver tuyaMCU; startDriver tmSensor; linkTuyaMCUOutputToChannel 1 val 1; setChannelType 1 temperature_div10; linkTuyaMCUOutputToChannel 2 val 2; setChannelType 2 Humidity;linkTuyaMCUOutputToChannel 3 val 3; setChannelType 3 ReadOnly;]
so all that's left to do after flashing is to double check all the name settings and start Home Assistant discovery via the web interface.
(--> If the startup command doesn't work later on, you need to enter it again via web interface. If there is no button to submit, it might be necessary to clear OBK config via web app command, after that you can re-enter new startup command)
5. Now connect USB (and then external power if you use it) and wait a moment for it to show up in UART port. Also, give the module few seconds to power on. Don't forget to select "Automatically configure OBK on flash write" if you chose this setting in step 4
6. Now make sure correct firmware is selected and then start process "Do backup and flash new", confirm dialogue and wait for log window to show waiting status. Now shortly (!) connect the end of CEN-wire to one of your GND terminals (just touch it and immediately release again), it will reset the device and reading/writing should start without any error messages. If you get any crucial error message, make sure to repeat step 5 and wait a minute before you start read/flash process. It worked for all my 4 sensors without exception.
7. After successful flash, disconnect the module first. Then the important part in order to make the WiFi-connection work: connect only 3.3V and GND (doesn't matter where from) to the wires that are still attached, to power the device on again. Now, wait
patiently! WiFi will pop up few times, after few minutes it will be stable! Either way, as AP if not preconfigured, or already in your router with new IP address. Then open web interface, finish configuration (HA discovery, names, startup command etc), and before you desolder the wires, pop in batteries and test if it still works. After disconnecting wires it will be annoying to acces the web interface - yet it is possible by either keeping the module's button pressed or press it down continuosly in 2 second intervals or so.
Result in HA:
(it was raining a lot here today, we can see it 😅 )
Good luck!