user30341: How can I display / capture Arduino IDE's Serial1 output?
Can I display it using Arduino IDE or using a script in Python?
This python script (courtesy of Chad G) works for the Serial:
#!/usr/bin/env python3


import serial 
import sys

if len(sys.argv)<2:
    print("Please give serial port number")
    exit()
port=sys.argv[1]
ser= serial.Serial('/dev/ttyUSB'+port,9600,timeout=5)

while True:
    try:
    stringMe = str(ser.readline().strip())
    if len(stringMe)>3:
        print(stringMe)

    except:
    print(sys.exc_info())
    ser.close()
    exit()

called as (for USB0): 
python3 Arduino/tools/multiMonitor/monitorUsb1.py 0

or, if I want to save to a log file:
python3 Arduino/tools/multiMonitor/monitorUsb1.py 0 >> Arduino/tools/multiMonitor/log/usb00.txt


user4143: Serial1 (on most Arduino boards that have Serial1) is connected to a pair of pins on the GPIO headers and nowhere else.
To get it to your computer you will have to feed those TX and RX pins through a USB to TTL UART (FT232, CP2102, etc) adaptor.
From there on in it's exactly the same as using Serial but of course with a different device name.

30341: <p>How can I display / capture Arduino IDE's <code>Serial1</code> output?
Can I display it using <code>Arduino IDE</code> or using a script in <code>Python</code>?</p>

<p>This python script (<a href="https://arduino.stackexchange.com/a/67229/30341">courtesy of Chad G</a>) works for the Serial:</p>

<pre><code>#!/usr/bin/env python3


import serial 
import sys

if len(sys.argv)&lt;2:
    print("Please give serial port number")
    exit()
port=sys.argv[1]
ser= serial.Serial('/dev/ttyUSB'+port,9600,timeout=5)

while True:
    try:
    stringMe = str(ser.readline().strip())
    if len(stringMe)&gt;3:
        print(stringMe)

    except:
    print(sys.exc_info())
    ser.close()
    exit()
</code></pre>

<p>called as (for USB0): </p>

<pre><code>python3 Arduino/tools/multiMonitor/monitorUsb1.py 0
</code></pre>

<p>or, if I want to save to a log file:</p>

<pre><code>python3 Arduino/tools/multiMonitor/monitorUsb1.py 0 &gt;&gt; Arduino/tools/multiMonitor/log/usb00.txt
</code></pre>
 4143: <p><code>Serial1</code> (on most Arduino boards that have <code>Serial1</code>) is connected to a pair of pins on the GPIO headers and nowhere else.</p>

<p>To get it to your computer you will have to feed those TX and RX pins through a USB to TTL UART (FT232, CP2102, etc) adaptor.</p>

<p>From there on in it's exactly the same as using <code>Serial</code> but of course with a different device name.</p>
