add option to change RX/TX pins if blocked by USB bridge
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!
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.
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.
You are welcome, glad to contribute!