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?
-
1No. It's not. It's too primitive.Majenko– Majenko2019年07月18日 20:42:07 +00:00Commented Jul 18, 2019 at 20:42
-
tks. chad solved it elegantly with a python script. lightweight and easy to use.tony gil– tony gil2019年07月20日 09:09:19 +00:00Commented Jul 20, 2019 at 9:09
4 Answers 4
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).
-
the port is stumping me. mind clarifying? I keep on getting
Please give serial port number
tony gil– tony gil2019年07月19日 09:06:15 +00:00Commented Jul 19, 2019 at 9:06 -
1start 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– Chad G2019年07月19日 15:08:13 +00:00Commented Jul 19, 2019 at 15:08
-
Spot on! Perfect, elegant, simple. UPVOTED, ACCEPTED & BOUNTIFIED. :)tony gil– tony gil2019年07月20日 09:04:54 +00:00Commented 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 color2019年07月22日 06:58:56 +00:00Commented Jul 22, 2019 at 6:58
-
that is also very useful, tks @Juraj!tony gil– tony gil2019年07月22日 19:16:00 +00:00Commented Jul 22, 2019 at 19:16
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.
-
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– tony gil2019年07月19日 08:52:32 +00:00Commented Jul 19, 2019 at 8:52
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.
-
Tried your suggestion: 2 windows - 1 process. Ubuntu creates a second process, unfortunately.tony gil– tony gil2019年07月18日 20:49:25 +00:00Commented Jul 18, 2019 at 20:49
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.
-
1I use Sloeber. It is a very good integration of Arduino build tools and packages into Eclipse2019年07月19日 09:44:15 +00:00Commented Jul 19, 2019 at 9:44