Open SmartieBjelovar opened 1 year ago
Did you managed to solve this? I currently have the same problem.... I need a DAC output on my ESP32-S2, but unfortunately not supported (yet?)
We gave up and made a new PCB with ESP32 Wroom, works without a problem now :)
uto, 14. velj 2023. u 19:14 Bart-1992 @.***> napisao je:
Did you managed to solve this? I currently have the same problem.... I need a DAC output on my ESP32-S2, but unfortunately not supported (yet?)
— Reply to this email directly, view it on GitHub https://github.com/esphome/issues/issues/3787#issuecomment-1430173391, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZTOB5TJ63QKOOHH2UNGRHLWXPDPLANCNFSM6AAAAAAR7WAFSU . You are receiving this because you authored the thread.Message ID: @.***>
I got it working by modifying the references to GPIO25 & 26 in these two files:
...\Lib\site-packages\esphome\components\esp32_dac\output.py
def valid_dac_pin(value):
num = value[CONF_NUMBER]
cv.one_of(17, 18)(num)
return value
...\Lib\site-packages\esphome\components\esp32_dac\esp32dac.cpp `auto channel = pin->get_pin() == 17 ? DAC_CHANNEL_1 : DAC_CHANNEL_2;`
@jesserockz can the above named fix be added to the Output component?
Your standard HAOS install on a Pi doesn't allow access to the esp32_dac.cpp files. Would be nice if the ESPHome developers just put this in their code and updated the integration.
Anyway, shouldn't
auto channel = pin_->get_pin() == 17 ? DAC_CHANNEL_1 : DAC_CHANNEL_2;
be instead (to make sure people who still use the GPIO25 and GPIO26 pins to not break)?
auto channel = ((pin_->get_pin() == 17 || pin_->get_pin() == 25) ? DAC_CHANNEL_1 : DAC_CHANNEL_2);
The problem
DAC function is not available for ESP32S2 modules. Internal DAC pins for ESP32S2 are GPIO17 and GPIO18 but esphome allows pins GPIO25 and GPIO26.
Am I doing something wrong, is there any other way to use an internal DAC on ESP32S2?
Which version of ESPHome has the issue?
2022.10.2
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2022.11.2
What platform are you using?
ESP32-IDF
Board
esp32-s2-saola-1
Component causing the issue
esp32_dac
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response