Hello,
I have a pool parameter meter (pH, Temperature, Salinity, ORP, TDS). It uses a Beken CB3S chip and a TuyaMCU that reads the sensor parameters. These two chips are connected via UART. The original firmware was TUYA. I desoldered the CB3S and managed to replace Tuya with ESPHome. Ever since I bought it, this meter was unstable: it would disconnect from Wi‑Fi and wouldn’t reconnect unless I unplugged it from the outlet. After switching the firmware to ESPHome, the CB3S became stable and stays online while powered on; however, the TuyaMCU randomly stops sending data after some time. Since they are separate chips, the TuyaMCU doesn’t have a “reboot” command. If I reboot the CB3S, the TuyaMCU does not reboot with it (obviously, because they are separate chips).
These are the CB3S logs trying:
14:11:43 [E] [uyat:533] Initialization failed at init_state 0
14:11:58 [E] [uyat:533] Initialization failed at init_state 0
14:12:13 [E] [uyat:533] Initialization failed at init_state 0
14:12:28 [E] [uyat:533] Initialization failed at init_state 0
Note: uyat is an external componente based on oficial tuya componente with some hack that MCU can start 100% and not wait for wifi up.
It only starts working again by unplugging it and plugging it back in. Besides that, there’s an ON/OFF button that needs to be pressed to “enable power” for the two chips. In other words, if I’m remote, it’s not possible to restart it (I could use a smart plug, but I still need to physically press ON to power up the device).
My questions:
- Does anyone know of a component I could use to replace the ON/OFF button so that, upon receiving power, it would send a pulse of a few milliseconds simulating a “push”? I researched and saw there are transistors for this, but I’m not very familiar with which one and how to use it.
- Has anyone worked with the TuyaMCU chip? I can send commands according to the documentation, but the chip doesn’t respond to these commands, although I can see (via UART debug) the communication flowing between the CB3S and the TuyaMCU.
Code I developed → https://pastebin.com/mveHEKi5
The code has a few profiles to change DEBUG in real time, as well as filter the logs. I also created command templates based on the Tuya manual, but the MCU doesn’t respond. The UART communication is OK because via debug it’s possible to see the two chips exchanging information (when everything is working properly).
I should be able to somehow force the MCU to REBOOT, but so far I haven’t found a way to do that (except physically and/or by modifying the board’s circuit, which requires more soldering skills).