Using Multiple Serial Monitors (Read more about Serial Monitors) If you work with multiple Serial connections, then you can open multiple Serial Monitor windows, one for each COM port. This can be useful if you work with an Arduino board that has multiple serial ports, or with multiple boards attached to your PC.
Serial-to-Network Proxies
![Arduino uno multiple serial ports Arduino uno multiple serial ports](http://www.visualmicro.com/documentation/pics/Arduino-Serial-Adapter.jpg)
These programs allow you to communicate with an Arduino board via a network connection. This is useful if, for example, your programming language doesn't provide access to serial ports (e.g. Flash).
- swDuino 2.0 is used to build interactive Human Machine Interfaces (HMIs) in just couple of minutes. The purpose of swDuino is to empower client programs (desktop, web and mobile applications) to monitor and control Arduino using set of powerful Web APIs.
- It is a free, state-of-the-art, windows-based 'Serial-to-Web' proxy software that drastically simplifies the streaming, two-way exchange of variables between Arduino and any client program which supports HTTP protocol. It comes with a dedicated Arduino library and an embedded, configurable, built-in Serial/COM and a multi-threaded HTTP/Web Server.
- Very interactive and stunning HMIs of your home, office, scientific rigs etc. can be build using swDuino. With these HMIs, one can control and monitor the devices that are connected with Arduino. Also, with swDuino, saving sensors' data into computer databases (e.g. SQL, MySQL, Oracle etc.) is not a hassle anymore.
- You can quickly learn from examples of Interfacing swDuino with several platforms. The details of Web APIs are also available.
- Arduino Terminal Server - Serial Proxy Server using old computer hardware.
- One line Serial Proxy Command - Why bother with all these utilities, when you can have a proxy with a one line command that uses standard OS provided commands.
- Internet to Serial Proxy works on OS X Lion. Acting like a little web server, this open source application opens a USB serial port you can acces via your web scripts, has PHP.
- JavaProxy, Simple Java serial proxy source code that further integrates with arduino.
- serproxy. Available on the main Arduino software page, probably sourced from here. Original here is older, but the zip has a detailed readme and a more readable config file. Serproxy handles multiple serial ports, configured with a text file.
- a fast *.exe executable. Not quantified, but feels faster.
- multi-threaded and can redirect multiple com ports to multiple sockets simultaneously.
- Can close and re-open client (e.g. flash), and it still connects.
- No 'debug' option to view traffic?
- Mac, Win and probably (old version at least) Linux.
- Source code available.
- How to modify 0.1.3 to use com10 or above here.
- Does not work on Mac 10.6 without installing Rosetta.
- Tinkerproxy2 - Seems like a good replacement for serproxy. Serproxy doesn't work under OSX 10.6 ( Snow Leopard ) without installing Rosetta. However you can also try Tinkerproxy2. That works in the same way as serproxy, and runs fine under 10.6. The configuration file and code is exactly the same as the serproxy.cfg.
- SerialNet.pde - a Processing sketch that acts as a serial-net proxy. Configured by modifying the code.
- Funnel - a project for interfacing multiple microcontroller platforms with many programming languages. Includes a serial-to-network proxy server.
- SerialServer (aka ss6): A Java-based proxy with a small GUI for selecting the serial and network port.
- Need complex installation of Java COM port libraries.
- May not be that fast/efficient (Java calling C bindings is supposedly quite slow).
- Does not appear to reconnect if client re-opened.
- Has a potentially handy debug mode, but high volumes of traffic can almost crash the computer.
- Source code available.
- Arduino2Flash: a command-line Java based proxy. The author says 'Some people using Intel Macs and OS X were unable to get serproxy configured correctly to connect Flash and the Arduino board. To work around this problem, I have written a replacement for serproxy in java called Arduino2Flash. This is experimental code, hacked together quickly, and probably buggy. Please test, let me know if it works, and I'll upload improved versions over time.'
- TinkerProxy (Old with more documentation, [[http://tinker.it/now/2007/06/03/new-tinkerproxy-for-windows | New). Nice GUI, easy to use, but very limited. Great for beginners, but bad for pros.
- TinkerProxy is one way, from serial to socket. You can't talk to the arduino over the socket. The same team is building another app called serialsocket, but haven't released it to public yet.
- No documentation. So the above issue caused me lots of grief until I eventually found a comment in a associated post.
- It doesn't start as soon as you run it - you have to click 'start'. So unusable for automated situations?
- If you close and re-open a client (e.g. flash app), it doesn't seem to recconnect.
- Runs on PC and OSX.
- While it is an *.exe executable, it seems quite slow (on the PC). Reportedly faster on a Mac.
- It does have a nice GUI.
- It does have a nice 'remember last settings used'.
- Source code NOT available.
- SerialXMPP: A serial to serial connection via XMPP/Gtalk. This does not require knowledge of the remote IP address on dynamic IP networks or require holes in the firewall.
- The SerialIP library can provide the Arduino with network connectivity over the serial port using SLIP. No software is required on the host, beyond configuring a SLIP connection over the serial port (like dialup Internet.)
MultiSerialMega
Sometimes, one serial port just isn't enough! When trying to communicate with multiple serial enabled devices, while also sending info back to the main serial window, a few extra RX/TX ports can be a welcomed thing. This example makes use of one of Arduino and Genuino Mega's 3 auxiliary serial ports, routing any incoming data read on that connection straight to the main TX line, and, in turn, to the main serial window for you to view.
Hardware Required
- Arduino or Genuino Mega Board
- Serial enabled device (a Xbee Radio, a Bluetooth module, or RFID reader, or another board, for instance).
Circuit
After checking the data sheet of whatever serial enabled device you choose to use for this example, make sure that it is both properly wired and powered. Connect the RX pin and TX pins of your device to the TX1 and RX1 pins of your Mega, as shown in the schematic below.
Make sure that your Mega is connected to your computer, via USB, to enable serial communication.
image developed using Fritzing. For more circuit examples, see the Fritzing project page
Schematic
Code
This sketch assumes that you connect your serial enabled device is attached to TX1 and RX1.
/*
Multiple Serial test
Receives from the main serial port, sends to the others.
Receives from serial port 1, sends to the main serial (Serial 0).
This example works only with boards with more than one serial like Arduino Mega, Due, Zero etc.
The circuit:
- any serial device attached to Serial port 1
- Serial Monitor open on Serial port 0
created 30 Dec 2008
modified 20 May 2012
by Tom Igoe & Jed Roach
modified 27 Nov 2015
by Arturo Guadalupi
This example code is in the public domain.
*/
voidsetup(){
// initialize both serial ports:
Serial.begin(9600);
Serial1.begin(9600);
}
voidloop(){
// read from port 1, send to port 0:
if(Serial1.available()){
int inByte =Serial1.read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if(Serial.available()){
int inByte =Serial.read();
Serial1.write(inByte);
}
}
Multiple Serial test
Receives from the main serial port, sends to the others.
Receives from serial port 1, sends to the main serial (Serial 0).
This example works only with boards with more than one serial like Arduino Mega, Due, Zero etc.
The circuit:
- any serial device attached to Serial port 1
- Serial Monitor open on Serial port 0
created 30 Dec 2008
modified 20 May 2012
by Tom Igoe & Jed Roach
modified 27 Nov 2015
by Arturo Guadalupi
This example code is in the public domain.
*/
voidsetup(){
// initialize both serial ports:
Serial.begin(9600);
Serial1.begin(9600);
}
voidloop(){
// read from port 1, send to port 0:
if(Serial1.available()){
int inByte =Serial1.read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if(Serial.available()){
int inByte =Serial.read();
Serial1.write(inByte);
}
}
See Also
- serial.begin()
- serial.read()
- serial.available()
- if()
- ASCIITable - Demonstrates Arduino's advanced serial output functions.
- Dimmer - Move the mouse to change the brightness of an LED.
- Graph - Send data to the computer and graph it in Processing.
- Midi - Send MIDI note messages serially.
- PhysicalPixel - Turn a LED on and off by sending data to your board from Processing or Max/MSP.
- ReadASCIIString - Parse a comma-separated string of integers to fade an LED.
- SerialCallResponse - Send multiple variables using a call-and-response (handshaking) method.
- SerialCallResponseASCII - Send multiple variables using a call-and-response (handshaking) method, and ASCII-encode the values before sending.
- SerialEvent - Demonstrates the use of SerialEvent().
- VirtualColorMixer - Send multiple variables from Arduino to your computer and read them in Processing or Max/MSP.
Last revision 2015/07/29 by SM