Hello community,
I have been struggling recently with reading the UART data with ESP32 coming from Lora module LLCC68.
My setup:
I have 2 LLCC68 - 1 connected with Arduino and the other with ESP32 running esphome.
Right now I can receive anything that is sent FROM esp32 TO Arduino.
Problem is I cannot read anything when data is sent FROM Arduino TO esp32.
I have confirmed that both LLCC68s are fine - connected to another Arduino instead of esp32 and could communicate both ways.
I have already tried to send data in different formats such as C-strings, Strings, only one char but no success while also changing the delimiters. Also I have tried different RX pins on my ESP32.
I have checked the logs of esp32 and I do not see any activity on UART bus RX while sending the messages.
Here is my esphome code.
uart:
id: uart_bus
tx_pin: GPIO1
rx_pin: GPIO16
baud_rate: 9600
debug:
direction: RX
after:
delimiter: "\r" # Read messages separated by CR
sequence:
- lambda: |-
UARTDebug::log_string(direction, bytes); //Still log the data
//Example to convert uart text to string
std::string str(bytes.begin(), bytes.end());
//watch for potential problems with non printable or special characters in string
id(rawString).publish_state(str.c_str());
mqtt:
broker: "192.168.0.10"
id: mqtt_client
on_message:
- topic: loraout
then:
- uart.write: !lambda
const std::vector<unsigned char> vec(x.begin(), x.end());
return vec;
text_sensor:
- platform: template
name: "Raw String"
id: "rawString"
i2c:
sda: 21
scl: 22
scan: true
id: bus_a
i2s_audio:
i2s_lrclk_pin: GPIO33
i2s_bclk_pin: GPIO25
On Arduino side I would like to send simple String, does not matter:
Example:
char unlock[] = "unlock";
Serial1.println(unlock);
I am out of ideas right now. Could anybody help me ?
Forgot to mention: Running the almost latest v 2024.8 esphome