![COMPORT | Embarcadero RAD Studio Delphi C++Builder Blogs comport](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2020/11/COMPORT-4503274.png?resize=512%2C512&ssl=1)
If you have worked with COM Port Applications on Linux before, this is the most convenient and quick way to connect, write, and read data.
Using COMPORT for Linux, you can do it in a matter of minutes; all you need to do is download the library and include it in your project, and that’s it.
First and foremost, you must prepare your Linux machine for the deployment of your Console application from a Windows machine.
In this example, I’m running a VM VirtualBox with Ubuntu on a Windows host.
Table of Contents
Installing Development Packages
To install the development packages on Ubuntu:
- Right-click your desktop and select Open Terminal.
- To upgrade the packages you have already installed, type
sudo apt update && sudo apt upgrade && sudo apt dist-upgrade
in the terminal. - Type your user password and press Enter
- Wait until prompted to agree to the package upgrade operation. Type Y and press Enter
- Wait until the package upgrade operation is complete. It may take a few minutes to complete.
- To add the development packages, type
sudo apt install joe wget p7zip-full curl openssh-server build-essential zlib1g-dev libcurl4-gnutls-dev libncurses5
in the terminal. - Type your user password and press Enter
- Wait until prompted to agree to the package installation operation. Type Y and press Enter
- Wait until the package installation operation is complete. It may take a few minutes to complete.
Preparing Your Linux Machine
To create Linux applications, you need to add a virtual machine, PAServer:
- Find the
LinuxPAServer21.0.tar.gz
file in the following location: C: Program Files (x86)EmbarcaderoStudio21.0PAServerLinuxPAServer21.0.tar.gz - Unpack the
LinuxPAServer21.0.tar.gz
file. - If needed Install the zlib library to your Ubuntu machine with the following command: Sudo apt-get install zlib1g-dev
- Open the current dir in the terminal and run it using./paserver
Now that the Linux Machine is ready let’s download and use the COMPORT Library.
Check out this step-by-step guide on how to download and use the Comport DLL Library to make your developer life easy and increase your efficiency.
Preparing Your Delphi Application
Creating a Connection Profile
- On the Tools > Options > Environment Options > Connection Profile Manager page, click the Add button. The Create a Connection Profile wizard opens
- On the Profile information page, enter the following:
- In the Profile name field, enter the needed name.
- In the Platform field, click the 64-bit Linux platform.
- Click Next.
- On the Remote machine information page, enter the following:
- In the Remote machine field, enter the IP address or machine name.
- Click Test Connection to check if the values are valid.
Adding the Installed SDK to RAD Studio
- On the Tools > Options > Environment Options > SDK Manager page, click the Add button.
- In the Add a New SDK dialog, enter the following:
- In the Select a platform field, click 64-bit Linux.
- In the Select a profile to connect, select a created profile from the drop-down list.
- In the Select an SDK version field, the name of the SDK that you just installed will automatically appear. If you have not installed SDK previously, you can do it on this step. If you have already installed the SDK, move on to the next step.
Download the package from WINSOFT, unzip it and open the demo application with Delphi, after that just add the library path on the project properties.
The entire tutorial for this process is here (available for Red Hat too).
You can easily work with a COMPort on Linux in Delphi using a WINSOFT Library with the use of IDE Software.
Try it out and make the most of it. Request a Free Trial here.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition