esphome / esphome/feature-requests

UART hardware flow control

Open
#1,126 7 comments 2 reactions 0 assignees View on GitHub
external-component
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**
Some devices require flow control when communicating via UART. In this case, it will be useful to add the ability to configure flow control in the UART component. ESP8266 has a hardware implementation of flow control(RTS, CTS, DTR, DSR), which is enabled through the UARTCONF register.
This improvement will make it possible to use MAX485 for communication under the RS485 protocol.

**Please describe your use case for this integration and alternatives you've tried:**
I am integrating the electricity meter through the TTL2RS485 converter based on the MAX485 chip, and I need to control the direction of information transfer. At first I wanted to implement a software switch, but delving deeper into the topic, I realized that it was enough to use the hardware capabilities of the board.

**Additional context**
[ESP8266_NONOS_SDK/.../uart.h](https://github.com/espressif/ESP8266_NONOS_SDK/blob/master/driver_lib/include/driver/uart.h)
```
typedef enum {
USART_HardwareFlowControl_None = 0x0,
USART_HardwareFlowControl_RTS = 0x1,
USART_HardwareFlowControl_CTS = 0x2,
USART_HardwareFlowControl_CTS_RTS = 0x3
} UART_HwFlowCtrl;
```
[future-request: RS485 serial support / tx enable pin control]( https://github.com/esphome/feature-requests/issues/421) that can be resolved by this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked ESP8266_NONOS_SDK/.../uart.h definition of UART_HwFlowCtrl and the ESP8266 UARTCONF register reference. Compare the requested RTS/CTS options with the linked RS485 serial support request, then identify how the UART component could expose hardware flow control and satisfy MAX485 direction-control use cases.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.