Open jeroen85 opened 1 year ago
It should work...
Can you be more specific about UART's not functioning? It would be helpful to know if it is RX and or TX not working in all three cases. Maybe you could do some measurements with a USB-serial-converter/logic analyser/scope.
In order to use 3 uarts, one of them has to use the default pins for UART0.
In order to use 3 uarts, one of them has to use the default pins for UART0.
It looks like you are correct here. Previously the YAML below was not working (last UART config; TX to my Multical was not functioning). When I change the pin of my first UART instance from GPIO23 to GPIO3, my Multical setup is (also) working :-)
uart:
#Uart for DSMR P1-meter
- rx_pin: GPIO3
#rx_pin: GPIO23
baud_rate: 115200
id: uart_dsmr
rx_buffer_size: 1700
#Multical UART, 2 instances due to different baud-rates.
- rx_pin: GPIO22
baud_rate: 1200
data_bits: 8
parity: NONE
stop_bits: 1
id: uart_rx
- tx_pin: GPIO21
baud_rate: 300
data_bits: 8
parity: NONE
stop_bits: 1
id: uart_tx
Documentation seems to be be wrong in this case:
The ESP32 has three UARTs. Any pair of GPIO pins can be used, as long as they support the proper output/input modes.
Just wondering if there is a way to solve this without changing the pins to the default for UART0? I am attempting to create an ESPHome set-up with off-the-shelf devices that do not follow the original pinout and where I cannot rearrange them. Same UART configuration utilising all three UART's with the custom pins work well in Arduino-based project, but not in ESPHome. Would be great if we could make this possible.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Not solved.
The problem
I configure 3 UART instances on a ESP32 (see YAML below). One for P1 DSMR (utility meter; electricity) Two for Multical (second utility meter; district heating)
Logger UART is disabled (baudrate: 0). Also tried disabling complete logger integration... no help.
Depending on the order of the UART instances, only one of my setups is working. First 2 Multical UART, then 1 DSMR UART configuration --> result: Multical is working First 1 DSMR UART, then 2 Multical UART configuration --> result: DSMR is working
How can I ensure both setups are working?
Same software runs perfectly on a ESP8266 (software UARTs).
As I understand from documentation; ESP32 should have 3 UART instances.
Which version of ESPHome has the issue?
2022.9.4
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
2022.10
What platform are you using?
ESP32
Board
mhetesp32minikit
Component causing the issue
uart
Example YAML snippet
Anything in the logs that might be useful for us?
No errors or warnings.
First DSMR UART, then 2 Multical UART configurations --> result: DSMR is working
First 2 Multical UART, then 1 DSMR UART configuration --> result: Multical is working
Additional information
For reference; multical401.h