I am finishing a new external component that can locally control my Midea MAD50 dehumidifier. Currently I got stuck because the extra UART transmissions and an unexpected low pulse make the appliance not response to UART commands.
I try to dig into this issue a bit more. Here are the three cases that I looked into.
Case 1:
ESP8266 running ESPHome, set the logger to UART1, commands were sent by UART0 hardware on GPIO01 and GPIO03.
As shown in the trace above, there are multiple extra message appeared on the TX pin at power-up. I am not sure whihc section is from ESP8266’s ROM code, and which are belongs to ESPHome code.
On top of it, the TX pin got pull low for some time before my code can send the initial query to the appliance. In this case, the applianc will not response at all.
Case 2:
ESP8266 running ESPhome, logger section was totally removed, rewired GPIO14 as the TX and GPIO02 as the RX. In this case, the software UART is used on GPIO14 and 02.
However, it is not working as well. From the above tracing at power-up, the extra transmissions on the TX went away because it is a software UART. However, the unexpected low pulse is still there which causing the appliance not responding to UART at all. ( I have confirmed with an Arduino, see below)
Case 3:
Arduino hardware UART.
Now, everything works as expected. I also intentionally add a low pulse in arduino code, which confirmed the extra low pulse causes the applicance not responding.
Now, the question becomes why ESPHome outputs extra low level when setting a GPIO for UART output?
This is pretty much a deal breaker for my project. ESP8266 only has one UART, and this UART has been heavily polluted by both ROM code and esphome logger. Software UART also has extra low pulse at power-up. On top of it, the softrware UART’s timing is not that accurate so my appliance has some chance not responing to its command.
I kind of hesitate to try out on ESP32 becuas of the high concern of UART pollution.
Any comments?