Cookie
Electronic Team, Inc. uses cookies to personalize your experience on our website. By continuing to use this site, you agree to our cookie policy. Click here to learn more.

Communication Between Android Serial Port and PC - Tutorial

Olga Weis Olga Weis

Creating a virtual serial port is beneficial in many scenarios during serial communication. Without this, you will need to connect hardware devices and swap them to enable serial debugging.

This standard device debugging technique involves creating a virtual serial port on a given computer. Next, you can utilize Android serial port communication in order to debug an Android device without connecting the device directly to that computer.

Table of contents:

  1. Virtual Serial Port Driver
  2. Oracle VM VirtualBox
  3. Serial debugging assistant

Virtual Serial Port Driver


The Virtual Serial Port Driver provides emulation of virtual serial ports and enables the creation of pairs of available serial ports over a virtual null-modem cable. This allows two applications to exchange data through the connection created by this software tool. The virtual serial ports are displayed in Device Manager and emulate the settings and functionality of a physical interface. Users no longer need to struggle with a lack of serial ports or excessive cabling. The application is fully compatible with ActiveX, DDL, and core-level utilities among other technologies

Virtual COM Port Emulator

Virtual COM Port Driver by Electronic Team takes the leading position in the market of software apps for serial data emulation.
VSPD logo

Virtual Serial Port Driver

Virtual Serial Port Driver
5 Rank based on 367+ users, Reviews(367)
Download 14-day fully-functional trial period
Virtual Serial Port Driver

Communication process

1
First, create two virtual ports COM2 and COM3 through Virtual Serial Port Driver. Of course, you can also create COM4 and COM5. This has no effect, as shown below:

Virtual Serial Port Driver
 Create a virtual machine
2
After the creation is successful, click the Settings button, then find the serial port item and set the COM port Android, (port 1).

Serial port settings
The port number COM1 corresponds to the Android virtual machine, /dev/ttyS0and the COM2 port of the address (p) corresponds to our virtual COM2 port. Of course, you can also set it to COM3 because we created two virtual ports in front.
3
Next, we start the Android emulator, I am using Genymotion, here we should note that the emulator we created is lower than the Android 4.4 version, otherwise the emulator does not support the virtual Android serial port.
 Creating the simulator
4
After starting the emulator, open the serial debugging assistant, let the serial debugging assistant connect to another (COM2 for the emulator, so connect COM3 here), click to open the Android emulator serial port after setting.
5
At this time, you will find that the status of the two virtual serial ports in the Virtual Serial Port Driver is active, as shown below:
 Virtual serial port activity status
6
Finally, we open the serial port in the apk /dev/ttyS0send analog data, you can see the received data, pay attention to both sides here you need to set the same baud rate in the serial debugging assistant.
 Received serial data

Oracle VM VirtualBox


VirtualBox is a powerful x86 and AMD64/intel64 virtualization product for businesses and home users. VirtualBox is not only an extremely feature-rich, high-performance product for enterprise customers but also the only professional solution available as open-source software under the terms of the GNU General Public License (GPL) version 2.

Currently, VirtualBox runs on Windows, Linux, Mac, and Solaris hosts and supports a large number of other operating systems, including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista, Windows 7, Windows 8, Windows 10). DOS/Windows 3.x, Linux (2.4, 2.6, 3.x, and 4.x), Solaris and OpenSolaris, OS/2, and OpenBSD.

With Oracle VM VirtualBox we can virtualize a Linux system and create a virtual Android serial port in the Android emulator (because the Android OS is based on Linux).

Serial debugging assistant


There are a lot of serial debugging assistants, which can be found in a quick search on Google. Here are some common tools:

Friendly serial debugging assistant (v2.6.5)



Advantages:

  • Easy to use;
  • Automatic identification of serial ports;
  • Support multi-serial port debugging;
  • COM numbers higher than COM 9 can be used;
  • Support sending of historical records;
  • Supports various baud rates up to 10 Mbps baud rate for compatibility with hardware devices.

Disadvantages:

  • Potential data loss;
  • Lack of a smooth display;
  • Not suitable for stability testing.

Serial debugging assistant (V2.2)

Advantages:

  • Easy to use;
  • Has the most user groups;
  • User-guide;
  • Free source code.

Disadvantages:

  • Due to the multi-threaded receiving technology, the number of received calls is sometimes lost, especially when the high baud rate or the USB to serial port function is used.
  • It only supports a maximum of 115.2K baud rate.
  • You can only select COM1~COM2. When using USB to serial port emulator, you must remap the serial port.

SSCOM3.2


Advantages:

  • Supports automatic identification of connected serial devices;
  • Easy to use;
  • No counting;
  • Good stability;
  • Simple interface that provides a good user experience.

Disadvantages:

  • Plugging and unplugging the serial port program will crash your machine, resulting in a blue screen;
  • The high baud rates are only 115.2K, 128K, 256K, and there is no 230.4K;
  • As a console, echo is not supported;
  • Save display data is not supported under Win10.

PCOMAPR1.5 (pcomtest)


Advantages:

  • High baud rate of up to 921.6K with no loss of reception.

Disadvantages:

  • Only COM1 through COM4 is available;
  • When using USB to a serial port Android, you need to remap the serial port.

Accesport1.33


Advantages:

  • Strong functionality;
  • Many configuration parameters;
  • No reception loss.

Disadvantages:

  • When the baud rate is high (such as 230.4K), large amounts of received data can cause disruption in the data sending process.
small logo Virtual Serial Port Driver
#1 at Serial Port Software
Virtual Serial Port Driver
Create virtual COM port pairs in Windows
5 rank based on 367+ users ( Learn more )
Get a download link for your desktop
Submit your email address to get a link for quick download on your desktop and get started!
or