esphome-lg-controller icon indicating copy to clipboard operation
esphome-lg-controller copied to clipboard

ESP32-S3-WROOM-1U

Open Anoxym opened this issue 1 year ago • 11 comments

Hi,

I have an ESP32-S3 and I would like to know if I can use the TX and RX pins on GPIO43 and GPIO44? Will this cause any issues? I understood that it's better to use GPIO17 and GPIO18, but they are already in use.

image

Anoxym avatar Dec 22 '24 00:12 Anoxym

I can't say for sure but it's probably fine based on this picture.

JanM321 avatar Dec 22 '24 08:12 JanM321

ok thanks ;) I thought it was better not to use TX/RX but rather GPIOs to control the high or low state during signal transmission.

Anoxym avatar Dec 22 '24 09:12 Anoxym

Unknown as state tells that the serial link doesn't works ? The cables are connected behind the PREMTB100. And I did not connect the 3.3V to the ESP as it has its own power supply, I only connected TX, RX, and GND to the ESP.

Screenshot 2024-12-26 at 3 25 25 PM

Anoxym avatar Dec 26 '24 14:12 Anoxym

You should look at the ESPHome logs to see what's going on. You changed the GPIO numbers in the YAML file right?

JanM321 avatar Dec 26 '24 14:12 JanM321

I will check logs tonight but yes I have changed GPIO numbers for TX/RX :

` uart:

  • id: ac_serial tx_pin: GPIO43 rx_pin: number: GPIO44 # Keep in sync with rx_pin above. allow_other_uses: true baud_rate: 104

sensor:

  • id: temp_sensor platform: homeassistant internal: true entity_id: ${temperature_sensor_entity_id}

  • platform: uptime name: Uptime

  • platform: wifi_signal name: "WiFi Signal" id: wifi_signal_db update_interval: 60s entity_category: diagnostic

  • platform: copy source_id: wifi_signal_db name: "WiFi Strength" filters:

    • lambda: return min(max(2 * (x + 100.0), 0.0), 100.0); unit_of_measurement: "%" entity_category: diagnostic

external_components:

  • source: components components: [lg_controller]

climate:

  • platform: lg_controller name: "" id: ${deviceid} uart_id: ac_serial rx_pin: number: GPIO44 # Keep in sync with rx_pin above. allow_other_uses: true `

Did I need to put the PREMTB100 in slave mode ?

Anoxym avatar Dec 26 '24 15:12 Anoxym

Did I need to put the PREMTB100 in slave mode ?

The controller doesn't work well if there are multiple 'master' controllers but you should still get sensor data etc in Home Assistant so it's likely unrelated.

JanM321 avatar Dec 26 '24 15:12 JanM321

Ok thanks! I only have this in log :

[01:25:54][D][lg-controller:1354]: update
[01:25:54][E][lg-controller:746]: unknown fan mode, using Medium
[01:25:54][E][lg-controller:770]: unknown swing mode
[01:25:54][D][lg-controller:849]: sending A8.20.00.00.00.00.05.14.40.00.80.00.F4 (13)
[01:25:54][W][component:237]: Component lg_controller.climate took a long time for an operation (506 ms).
[01:25:54][W][component:238]: Components should block for at most 30 ms.
[01:25:58][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[01:25:58][D][esp32.preferences:114]: Saving 1 preferences to flash...
[01:25:58][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed

[01:26:18][E][lg-controller:746]: unknown fan mode, using Medium
[01:26:18][E][lg-controller:770]: unknown swing mode
[01:26:18][D][lg-controller:849]: sending A8.20.00.00.00.00.15.10.40.00.80.00.F8 (13)
[01:26:18][D][climate:396]: 'Home LG ducted system' - Sending state:
[01:26:18][D][climate:399]:   Mode: OFF
[01:26:18][D][climate:416]:   Swing Mode: UNKNOWN
[01:26:18][D][climate:419]:   Current Temperature: 18.00°C
[01:26:18][D][climate:425]:   Target Temperature: 20.00°C
[01:26:18][W][component:237]: Component lg_controller.climate took a long time for an operation (518 ms).
[01:26:18][W][component:238]: Components should block for at most 30 ms.
[01:33:50][D][esp32.preferences:114]: Saving 1 preferences to flash...
[01:33:50][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[01:33:52][D][lg-controller:1354]: update
[01:33:53][E][lg-controller:872]: Unexpected missing previous CA/AA message
[01:33:53][W][component:237]: Component lg_controller.climate took a long time for an operation (508 ms).
[01:33:53][W][component:238]: Components should block for at most 30 ms.
[01:33:58][D][lg-controller:1354]: update

But sensors are still unknown

Anoxym avatar Dec 27 '24 00:12 Anoxym

It’s trying to send messages to the AC but not receiving anything, so something with the hardware side or the GPIO definitions isn’t right.

JanM321 avatar Dec 27 '24 06:12 JanM321

Maybe GPIO43/44 doesn't work with the code ? The only difference is that I didn't connect the 3.3V to the ESP since it's already powered. I connected the LIN TX to TX GPIO43 and the LIN RX to RX GPIO44.

Anoxym avatar Dec 27 '24 12:12 Anoxym

I have changed the wiring and now I have :

[16:28:33][D][lg-controller:1354]: update
[16:28:33][D][lg-controller:1450]: line busy, not sending yet

Anoxym avatar Dec 27 '24 15:12 Anoxym

Unknown as state tells that the serial link doesn't works ? The cables are connected behind the PREMTB100. And I did not connect the 3.3V to the ESP as it has its own power supply, I only connected TX, RX, and GND to the ESP.

Am I understanding correctly that you are not using the TJA1027 transceiver as suggested in the project, but instead found the Rx and Tx points on the LG wired wall controller PCB and connected the ESP32 directly to them? If that's the case, please note that those lines likely operate at 5V logic levels, while the ESP32 requires 3.3V logic. This voltage mismatch could potentially cause communication issues or even damage the ESP32.

lagomCat avatar Jun 07 '25 18:06 lagomCat