0

Is it possible to monitor multiple USB ports simultaneously in Arduino IDE while running only ONE instance of the IDE?

If not, which solutions come alternatively to mind?

2
  • 1
    No. It's not. It's too primitive.
    – Majenko
    Commented Jul 18, 2019 at 20:42
  • tks. chad solved it elegantly with a python script. lightweight and easy to use.
    – tony gil
    Commented Jul 20, 2019 at 9:09

4 Answers 4

2
+50

If you are only interested in monitoring the output, a simply python script can be run to monitor the port. This sample takes an input of the port number(assuming they get named ttyUSB1, ttyUSB2, ect... Or you can modify it to be a hard coded port. Also make sure the baud rate matches with what your arduino is running (115200 in the example)

You can then run this script in two separate terminals, one for each port

#!/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,115200,timeout=5)

while True:
    try:
        print(str(ser.readline().strip()))
    except:
        print(sys.exc_info())
        ser.close()
        exit()

Start the program like so

python3 ./programName.py 1 (or ./programName.py 0, etc)

The number dictates which of the ttyUSBx devices you are trying to watch (will match with what you see in the arduino IDE).

5
  • the port is stumping me. mind clarifying? I keep on getting Please give serial port number
    – tony gil
    Commented Jul 19, 2019 at 9:06
  • 1
    start the program like so ./programName 1 or ./programName 0 the number dictates which of the ttyUSBx devices you are trying to watch(will match with what you see in the arduino IDE)
    – Chad G
    Commented Jul 19, 2019 at 15:08
  • Spot on! Perfect, elegant, simple. UPVOTED, ACCEPTED & BOUNTIFIED. :)
    – tony gil
    Commented Jul 20, 2019 at 9:04
  • 1
    @tonygil, to copy port input to output, you don't need python. the python script could monitor more ports and print them with different color
    – Juraj
    Commented Jul 22, 2019 at 6:58
  • that is also very useful, tks @Juraj!
    – tony gil
    Commented Jul 22, 2019 at 19:16
2

You can run multiple instances of the Arduino IDE to work with multiple boards at the same time. Start IDE second time with Start menu or desktop shortcut.

Of course you can monitor the COM/tty port with a common serial terminal program too.

1
  • UPVOTED because it addresses the root problem of monitoring multiple boards. NOT ACCEPTED becacuse the solution needed depended on one and only one instance of IDE. tks!
    – tony gil
    Commented Jul 19, 2019 at 8:52
1

Short answer : No.

Long answer : Noooooooooooooooooooooooooooooooooooooo, since one window can only work with one arduino.
That being said, if you open another file, or create new file (Ctrl + N) on existing window, it doesn't make another process.
It is still on the only javaw.exe process running on your computer (you kill that, both window gone for good.)

To make it simple :

  • Double click Arduino icon on your desktop, and double click it again, it will run as 2 separate process.
  • Double click Arduino icon on your desktop, and then use open file or new file, it won't make another process.

But I think I misunderstood your question. If you're asking for arduinos in multiple USB ports, yeah, one IDE can see wherever you plug it in.

1
  • Tried your suggestion: 2 windows - 1 process. Ubuntu creates a second process, unfortunately.
    – tony gil
    Commented Jul 18, 2019 at 20:49
1

Sloeber, an open source IDE based on Eclipse on which I am a proud contributor, does have this feature, but the Arduino IDE does not.

1
  • 1
    I use Sloeber. It is a very good integration of Arduino build tools and packages into Eclipse
    – Juraj
    Commented Jul 19, 2019 at 9:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.