I do have “in theory” a simple serial connection between two ESP32’s (Mini D1’s).
One writes a “Hello World” to the serial bus, the other one blinks the onboard LED shortly (200ms) when it reads the “Hello World” string on the serial connection.
I say “in theory” because the two are wirelessly connection using HC-12 modules, but I do not think that is relevant for my question. Just mentioning it for the full context (Prove me wrong).
When programming the transmitter with the Ardrino IDE using the following code the receiver blinks for 200 milliseconds every 2 seconds.
At this point I think I have proven that the hardware works as intended.
Moving forward I would like to program the sender as a ESPHome device so I can write the “Hello World” string to the serial bus by means of clicking on the button entity in my Home Assistant installation.
I programmed the following yaml, expecting it to work.
First tried it without the on_press action but after googling I just added it to be sure, I also tried to remove the \r (Only a \n) and tried to remove the \r\n (Just the text).
But the onboard LED on the receiving ESP32 is not responding.
So my basic question is, what is the difference between “Serial.print(“Hello World”);” and “uart.write: “Hello World”” or how can I just print the string to the serial bus with ESPhome.
However I do see this in the logging during startup of ESP:
[17:21:06][W][uart.arduino_esp32:192]: You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0.
To make sure this is not interfaering I followed the instructions and added:
``
# Enable logging (But enable it to output to the local Serial port, as this one is used by HC-12)
logger:
baud_rate: 0