ratgdo / esphome-ratgdo

ratgdo for ESPHome
GNU General Public License v2.0
357 stars 108 forks source link

ESP32 hardware UART issue #1

Closed mariusmuja closed 1 year ago

mariusmuja commented 1 year ago

Using an esphome builtin uart component does not work on ESP32 because it uses a hardware uart, for which transmitting stops working after the TX pin is (re-)initialized in RATGDOComponent::setup().

Currently, on ESP32 only the 1305us high / 1260us low sequence appears on the wire and nothing after that. If the TX pin setup() and pin_mode() calls are commented out, the UART transmission appears on the wire, but not the 1305us high / 1260us low sequence.

The ESP8266 uses software UART and doesn't have this issue.

bdraco commented 1 year ago

I don't see a solution here since esphome doesn't support software uart on esp32

I removed the esp32 option so nobody else tries it

If we come up with a solution later, we can always add it back

mariusmuja commented 1 year ago

Yes, probably the solution would be to use a software serial implementation, similar to what theratgdo project does.

bdraco commented 1 year ago

It will probably work with https://github.com/ESPHome-RATGDO/esphome-ratgdo/commit/2f9882102db6aaad8ba9ad76a121e237a69caa8a reverted but I'm traveling for the next few weeks so I won't be able to test

bdraco commented 1 year ago

Happy to take a PR to re-add it if someone wants to fix in the mean time. Otherwise I'll look when I get back home.

bdraco commented 1 year ago

@mariusmuja latest push should fix it

The firmwares are building now

Unfortunately I can't validate the fix since I'm traveling. All I can test right now is that it doesn't regress the 8266

bdraco commented 1 year ago

I had someone test it for me. Report is it works as expected

mariusmuja commented 1 year ago

I switched to using an esp8266 and can confirm that the latest update works fine. I'll probably switch back to an esp32 now. Thanks for the quick fix @bdraco !