Xinyuan-LilyGO / T-CAN485

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RS485 ESPHome connect issue

Yocee84 opened this issue · comments

Hi! I cant use this panel. Please share correct esphome setup.

I use this:

substitutions:
devicename: *******
description: ********
entity_prefix: *******

esphome:
name: "${devicename}"
comment: "${description}"

esp32:
board: esp32dev
framework:
type: arduino

Enable logging

logger:
level: DEBUG
baud_rate: 0

web_server:
port: 80

Enable Home Assistant API

api:
encryption:
key: "*****************************************"

ota:

wifi:
networks:

  • ssid: !secret wifi_ssid
    password: !secret wifi_password
  • ssid: *********
    password: ************
    reboot_timeout: 0.05h

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: "*****2"
password: "**********"

captive_portal:

light:

  • platform: neopixelbus
    type: GRB
    variant: WS2812
    pin: GPIO04
    num_leds: 1
    name: "Light"

uart:
id: mod_bus
tx_pin: 22
rx_pin: 21
baud_rate: 9600
stop_bits: 1

modbus:
flow_control_pin: 5
id: heatpump_modbus

Try this for some inspiration, I'm working on a homeassistant forum post to go with it. This is working for my application.

https://gist.github.com/Bwooce/7c43622dcc9bc1fbb04d7a0f1e5528df

Try this for some inspiration, I'm working on a homeassistant forum post to go with it. This is working for my application.

https://gist.github.com/Bwooce/7c43622dcc9bc1fbb04d7a0f1e5528df

That's how it works for me. Thank you very much!
You should get a commission. Is there a buy me a coffee link?

Excellent, glad it was useful. Do something unexpected for someone and I'll call it even :-)

This is how I make it to work in ESPHome with Growatt inverter

Output section is important obviously, without it it not work.

# Set pins required for LilyGo T-CAN485 board
output:
  - platform: gpio
    id: ENABLE_PIN # Enable the chip
    pin:
      number: GPIO19
      inverted: true
  - platform: gpio
    id: SE_PIN # Enable autodirection
    pin:
      number: GPIO17
      inverted: true
  - platform: gpio
    id: ENABLE_5V_PIN # Enable 5V pin for RS485 chip
    pin:
      number: GPIO16
      inverted: true

# UART MODBUS configuration entry
uart:
  id: mod_uart
  rx_pin: GPIO21
  tx_pin: GPIO22
  baud_rate: 9600 # The out-of-box baud rate for my particular sensor->RS485 bridge
  stop_bits: 1
  parity: NONE
#  data_bits: 8
  debug:
    direction: BOTH
    dummy_receiver: false
    after:
      delimiter: "\n"
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);

modbus:
  id: modbus1
  uart_id: mod_uart
#  flow_control_pin: GPIO4


modbus_controller:
  - id: Growatt_MIN600TLX
    address: 0x1   ## address of the ModBUS slave device on the bus
    modbus_id: modbus1
    setup_priority: -10

Archive.zip

Here are my can1 and can2 files. Connect h to h and l to l. Sends test data back and forth.