1

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
asked Jul 26, 2019 at 16:13

1 Answer 1

1

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.

answered Jul 26, 2019 at 16:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.