esp-smartmeter-reader icon indicating copy to clipboard operation
esp-smartmeter-reader copied to clipboard

add option to change RX/TX pins if blocked by USB bridge

Open ALfuhrmann opened this issue 2 years ago • 1 comments

Since on many 8266 boards the hardware UART is already used by the USB-bridge, I added the option to swap the serial pins to GPIO15 (TX) and GPIO13 (RX) . (See https://arduino.esp8266.com/Arduino/versions/2.1.0-rc2/doc/reference.html#serial) I added a #define in config_esp8266.h for this.

Tested it on an Wemos D1 mini, works fine at my home!

ALfuhrmann avatar Oct 25 '23 11:10 ALfuhrmann

Hi @ALfuhrmann! Thank you for your contribution! I think it is a very good idea to add this as a config option. Since I am abroad probably until Christmas, I am not able to test your addition, but the code looks good to me. However, before merging I would like to document and explain this option in the setup part of the README, which I am only able to do once I am back home.

aldadic avatar Nov 01 '23 18:11 aldadic

Thank you again for your contribution. I finally had the time to test your addition. I wasn't aware of the Serial.swap() functionality. By shorting GPIO2 (D4) to TX, it is possible to use Serial1 to send data to the serial monitor via USB, which is useful for logging purposes. I will change the documentation, such that this becomes the recommended setup for ESP8266.

aldadic avatar Jul 28 '24 15:07 aldadic

You are welcome, glad to contribute!

ALfuhrmann avatar Jul 30 '24 10:07 ALfuhrmann