<p><span style="color: #757575; font-size: 15px; background-color: #ffffff; font-family: &quot;courier new&quot;, courier, monospace;">HardwareSerial Serial1(1);<br />HardwareSerial Serial2(2);<br />void setup() {<br />// put your setup code here, to run once:<br />Serial.begin(115200);<br />Serial1.begin(115200);<br />Serial2.begin(115200);&nbsp;<br /><br />}<br />void loop() {<br />Serial.println("This message sent to USB serial");<br />Serial1.println("This message sent to UART1 serial1");<br />Serial2.println("This message sent to UART2 serial2");<br />delay(1000);<br />}</span><br style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;" /></p>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="font-family: &quot;courier new&quot;, courier, monospace;"><br /></span></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="font-family: inherit;">I down loaded to my wemos OLED ESP32, and it did not crash...</span></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="font-family: inherit;">According to the pin out I got from&nbsp;</span>http://www.instructables.com/id/ESP32-With-Integrated-OLED-WEMOSLolin-Getting-Star/</div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;">the RX/TX marked on my board is actually Rx0/Tx0 which is the same as USB one.</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both; text-align: center;"><a href="https://cdn.instructables.com/FAK/RKQ0/J3YPR3IJ/FAKRKQ0J3YPR3IJ.MEDIUM.jpg" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" data-original-height="386" data-original-width="620" src="https://cdn.instructables.com/FAK/RKQ0/J3YPR3IJ/FAKRKQ0J3YPR3IJ.MEDIUM.jpg" width="640" style="border: 0px; max-width: 100%; height: inherit;" /></a></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="font-family: inherit;"><br /></span></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="font-family: inherit;">which is consist with what I got on arduino monitor and the docklight with FTDI connected to RX/TX pins on board.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-WdzAw6KY2TM/WjI0gEYm0KI/AAAAAAAAr-c/ISgSkWyPzAQ4SLcxUn6DgGHpB-kEQkF8QCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.04.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: left; float: left; margin-bottom: 1em; margin-right: 1em;" target="_blank">&nbsp; &nbsp;&nbsp;<img border="0" data-original-height="559" data-original-width="542" src="https://3.bp.blogspot.com/-WdzAw6KY2TM/WjI0gEYm0KI/AAAAAAAAr-c/ISgSkWyPzAQ4SLcxUn6DgGHpB-kEQkF8QCLcBGAs/s320/Screenshot%2B2017-12-14%2B16.17.04.png" width="310" style="border: 0px; max-width: 100%; height: inherit;" />&nbsp; &nbsp;</a></div>
<p><span style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><br style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;" /></p>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><br /></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: left; float: left; margin-bottom: 1em; margin-right: 1em;" target="_blank"><img border="0" data-original-height="498" data-original-width="505" src="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s320/Screenshot%2B2017-12-14%2B16.17.08.png" width="320" style="border: 0px; max-width: 100%; height: inherit;" /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank">&nbsp;</a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a><a href="https://2.bp.blogspot.com/-cChnQ9dTXSY/WjI0gPEtLoI/AAAAAAAAr-g/OlhtiRpm9Y82J9SpqQJ3PQcV6qEXV-2cgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.17.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" target="_blank"><br /></a>&nbsp;&nbsp;</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">This surprised me, since the video is dated 2017 Oct, and it's corrected. I think there must be some change on the pin define, since ESP32 has very good pin muxing capability. according to the video, this is done with</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">\hardware\espressif\esp32\cores\esp32\HardwareSerial.cpp</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><br /></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">So I find and open it and find in hardware serial.begin</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><br /></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">{</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; if(0 &gt; _uart_nr || _uart_nr &gt; 2) {</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; &nbsp; &nbsp; log_e("Serial number is invalid, please use 0, 1 or 2");</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; &nbsp; &nbsp; return;</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; }</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; if(_uart) {</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; &nbsp; &nbsp; end();</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; }</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; if(_uart_nr == 0 &amp;&amp; rxPin &lt; 0 &amp;&amp; txPin &lt; 0) {</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<b>rxPin = 3;</b></span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;"><b>&nbsp; &nbsp; &nbsp; &nbsp; txPin = 1;</b></span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; }</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; if(_uart_nr == 1 &amp;&amp; rxPin &lt; 0 &amp;&amp; txPin &lt; 0) {</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<b>rxPin = 9;</b></span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;"><b>&nbsp; &nbsp; &nbsp; &nbsp; txPin = 10;</b></span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; }</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; if(_uart_nr == 2 &amp;&amp; rxPin &lt; 0 &amp;&amp; txPin &lt; 0) {</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<b>rxPin = 16;</b></span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;"><b>&nbsp; &nbsp; &nbsp; &nbsp; txPin = 17;</b></span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; }</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">&nbsp; &nbsp; _uart = uartBegin(_uart_nr, baud, config, rxPin, txPin, 256, invert);</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;">}</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: &quot;courier new&quot;, courier, monospace;"><br /></span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: inherit;">But I have no intention to change the pin define in the lib. in the messaging of the video, there is one example:</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">HardwareSerial Serial1(1);</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">HardwareSerial Serial2(2);</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><a class="yt-simple-endpoint style-scope yt-formatted-string" href="https://www.youtube.com/results?search_query=%23define" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; text-decoration-line: none; color: #2196f3; display: inline-block; font-family: Roboto, Arial, sans-serif; font-size: 14px; line-height: var(--yt-formatted-string-endpoint_-_line-height); white-space: pre-wrap;" target="_blank">#define</a><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"> TX1_pin  12</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><a class="yt-simple-endpoint style-scope yt-formatted-string" href="https://www.youtube.com/results?search_query=%23define" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; text-decoration-line: none; color: #2196f3; display: inline-block; font-family: Roboto, Arial, sans-serif; font-size: 14px; line-height: var(--yt-formatted-string-endpoint_-_line-height); white-space: pre-wrap;" target="_blank">#define</a><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"> RX1_pin  13</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><a class="yt-simple-endpoint style-scope yt-formatted-string" href="https://www.youtube.com/results?search_query=%23define" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; text-decoration-line: none; color: #2196f3; display: inline-block; font-family: Roboto, Arial, sans-serif; font-size: 14px; line-height: var(--yt-formatted-string-endpoint_-_line-height); white-space: pre-wrap;" target="_blank">#define</a><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"> TX2_pin  2</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><a class="yt-simple-endpoint style-scope yt-formatted-string" href="https://www.youtube.com/results?search_query=%23define" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; text-decoration-line: none; color: #2196f3; display: inline-block; font-family: Roboto, Arial, sans-serif; font-size: 14px; line-height: var(--yt-formatted-string-endpoint_-_line-height); white-space: pre-wrap;" target="_blank">#define</a><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"> RX2_pin  4</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">void setup() {</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">  Serial.begin(115200);</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">  Serial1.begin(115200, SERIAL_8N1, RX1_pin, TX1_pin);</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">  Serial2.begin(115200, SERIAL_8N1, RX2_pin, TX2_pin);</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">}</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">void loop() {</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">  Serial.println("This message is sent to USB Seriall"); </span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">  Serial1.println("This message is sent to UART1 Serial");</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">  Serial2.println("This message is sent to UART2 Serial");</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">  delay(1000);</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">}</span><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"></span></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"><br /></span></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">According to the pinout of my little wemos OLED, I make it as:</span></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"><br /></span></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="font-size: 14px; white-space: pre-wrap;"><span style="color: #111111; font-family: inherit;">HardwareSerial Serial1(1);
HardwareSerial Serial2(2);
#define TX1_pin  15
#define RX1_pin  16
#define TX2_pin  2
#define RX2_pin  4
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial1.begin(115200, SERIAL_8N1, RX1_pin, TX1_pin);
  Serial2.begin(115200, SERIAL_8N1, RX2_pin, TX2_pin);</span></span></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;"><br /></span></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">And it finally works....</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-WoGNfp1qPzU/WjI753NcbXI/AAAAAAAAr-4/o3rFWJSdcyoHx3xWDgjEx2Eej0P8md-sQCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.47.05.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" data-original-height="372" data-original-width="505" src="https://2.bp.blogspot.com/-WoGNfp1qPzU/WjI753NcbXI/AAAAAAAAr-4/o3rFWJSdcyoHx3xWDgjEx2Eej0P8md-sQCLcBGAs/s320/Screenshot%2B2017-12-14%2B16.47.05.png" width="320" style="border: 0px; max-width: 100%; height: inherit;" /></a></div>
<p><br style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;" /></p>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-GD_BDguIgfk/WjI75-DGAFI/AAAAAAAAr-0/fXW3uoF-ahYuMrFDAioLGrBSst11HYcPgCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.47.08.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" data-original-height="479" data-original-width="541" src="https://2.bp.blogspot.com/-GD_BDguIgfk/WjI75-DGAFI/AAAAAAAAr-0/fXW3uoF-ahYuMrFDAioLGrBSst11HYcPgCLcBGAs/s320/Screenshot%2B2017-12-14%2B16.47.08.png" width="320" style="border: 0px; max-width: 100%; height: inherit;" /></a></div>
<p><br style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;" /></p>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-zAtw5uYkPbQ/WjI755BzumI/AAAAAAAAr-w/L8G12aUlSWwTKYQwXj9PF_XiB1ENwt5eQCLcBGAs/s1600/Screenshot%2B2017-12-14%2B16.47.58.png" imageanchor="1" style="background: transparent; text-decoration-line: none; color: #2196f3; display: inline-block; margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" data-original-height="479" data-original-width="541" src="https://4.bp.blogspot.com/-zAtw5uYkPbQ/WjI755BzumI/AAAAAAAAr-w/L8G12aUlSWwTKYQwXj9PF_XiB1ENwt5eQCLcBGAs/s320/Screenshot%2B2017-12-14%2B16.47.58.png" width="320" style="border: 0px; max-width: 100%; height: inherit;" /></a></div>
<div style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff;"><span style="color: #111111; font-family: roboto, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">I did not understand why the original one did not crash, as saying that io9 and io10 is used for flash...</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: inherit;"><br /></span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: inherit;">Here is another very good program for using3 uarts mapping to 3 UDP port.</span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><span style="font-family: inherit;"><a href="https://github.com/AlphaLima/ESP32-Serial-Bridge" style="background: transparent; text-decoration-line: none; color: #2196f3;" target="_blank">https://github.com/AlphaLima/ESP32-Serial-Bridge</a></span></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><br /></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">So, currently I wish to use following pin muxing:</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">on uart 1</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;"><br /></div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">//#define RX1_pin&nbsp; 2// with this config RX=2, TX=4, I can't load the code with FTDI connected</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">//#define TX1_pin&nbsp; 4</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">#define RX1_pin&nbsp; 4// with this config Rx=4, Tx=2, I can load the code with FTDI connected</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">#define TX1_pin&nbsp; 2</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">HardwareSerial Serial2(2);</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">#define RX2_pin&nbsp; 14</div>
<div class="separator" style="color: #757575; font-family: Roboto, sans-serif; font-size: 15px; background-color: #ffffff; clear: both;">#define TX2_pin&nbsp; 16</div>