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?

asked Jul 18, 2019 at 20:33
2
  • 1
    No. It's not. It's too primitive. Commented Jul 18, 2019 at 20:42
  • tks. chad solved it elegantly with a python script. lightweight and easy to use. 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).

tony gil
3781 gold badge7 silver badges26 bronze badges
answered Jul 18, 2019 at 22:54
5
  • the port is stumping me. mind clarifying? I keep on getting Please give serial port number 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) Commented Jul 19, 2019 at 15:08
  • Spot on! Perfect, elegant, simple. UPVOTED, ACCEPTED & BOUNTIFIED. :) 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 Commented Jul 22, 2019 at 6:58
  • that is also very useful, tks @Juraj! 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.

answered Jul 19, 2019 at 4:55
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! 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.

answered Jul 18, 2019 at 20:47
1
  • Tried your suggestion: 2 windows - 1 process. Ubuntu creates a second process, unfortunately. 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.

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

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.