Skip to main content

RS232 / tty testing and simulation on Linux


Summary / TL;DR

If you are looking for a Docklight alternative on Linux, here is what we found out: Docklight Scripting works on Ubuntu Linux using the WineHQ package and winetricks . You can access and use both serial ports (tty) and the networking (TCP / UDP) functions. For installation, use a 32-bit WINEPREFIX and winetricks vb6run richtx32 comdlg32ocx comctl32ocx wsh57.

Docklight On Ubuntu Linux 20.04 - Serial Port Configuration

Experimental use only

“Use at own risk” - The below description of Docklight installation and use on Linux desktop computers is for experimental use. It is currently not recommended in production environments.

Limitations / known issues
* For tty / serial ports, use Docklight V2.2 versions (e.g. Docklight Scripting V2.2), not V2.3.
* Docklight may crash on application exit 
* Display output is slower than on Windows, which can lead to slower Receive Sequence reaction times.

Background

In the recent months, we noticed an increasing interest in a Docklight version for Linux. The bad news - our extremely reliable ‘classic’ Docklight code cannot be directly compiled to Linux. A Linux version essentially requires a rewrite of all Docklight core parts. The good news - Our existing Docklight releases can be installed and used via the www.winehq.org Windows Compatibility layer. 

We ran tests on a popular Ubuntu Linux desktop distribution, but WineHQ binaries are also available for Debian, Fedora and SUSE.

Here is what we did:

Example Installation for Ubuntu 20.04 LTS

Prepare: winehq.org and winetricks environment

  • Make sure 32 bit architecture is available:
~$ sudo dpkg --add-architecture i386

 

  • Install WineHQ 6.0 stable:
~$ wget -nc https://dl.winehq.org/wine-builds/winehq.key
~$ sudo apt-key add winehq.key
~$ sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
~$ sudo apt install --install-recommends winehq-stable

 

  • Create a separate 32 bit WineHQ prefix for Docklight, with the required VB& runtime packages and controls:

~$ sudo apt install winetricks
~$ winetricks arch=32 prefix=docklight32
~$ export WINEPREFIX=~/.local/share/wineprefixes/docklight32

~$ winetricks vb6run richtx32 comdlg32ocx comctl32ocx wsh57

 

TIP: When the Wine Mono Installer appears, use Cancel - it is not required. For the Wine Gecko Installer, choose Install, or the Docklight Help will not work correctly. 

Prepare: Serial port mapping and access rights

~$ sudo usermod -a -G dialout $USER
~$ sudo reboot


  • Use the ~/.wine/dosdevices/ folder for finding out how the Linux /dev/tty files are mapped to Windows COM ports as used by Docklight. For example, use this to find ttyUSB type devices like our Docklight RS232 Adapter (ftdichip.com hardware):

~$ ls -l ~/.wine/dosdevices/ | grep USB

lrwxrwxrwx 1 wolf wolf 12 Mar 10 09:32 com33 -> /dev/ttyUSB0

 

Install Docklight

~$ export WINEPREFIX=~/.local/share/wineprefixes/docklight32

~$ wine $HOME/Downloads/DocklightScriptingSetup.exe

  • Confirm all installation defaults

Use Docklight

  • Start Docklight Scripting (or Docklight) from the new icon appearing in the Ubuntu unity menu.
  • Or find out the launch command from the .desktop shortcut file

~$ cat ~/.local/share/applications/wine/Programs/'Docklight Scripting V2.2'/'Docklight Scripting.desktop'

[Desktop Entry]

Name=Docklight Scripting

Exec=env WINEPREFIX="/home/wolf/.local/share/wineprefixes/docklight32" wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/wolf/.local/share/wineprefixes/docklight32/dosdevices/c:/ProgramData/Microsoft/Windows/Start\\ Menu/Programs/Docklight\\ Scripting\\ V2.2/Docklight\\ Scripting.lnk

Type=Application

StartupNotify=true

Path=/home/wolf/.local/share/wineprefixes/docklight32/dosdevices/c:/Program Files/FuH/Docklight Scripting V2.2

Icon=4813_Docklight_Scripting.0

StartupWMClass=docklight_scripting.exe


Some Screenshots

Docklight Installation - No Mono required

Docklight Installation - Do install Gecko

Docklight Standard Setup

Choose "Ignore" for any issues with DLL versions

Setting up serial ports (Linux tty / Windows COM)

Docklight serial communications running

Docklight Scripting with UDP loopback on Linux


Of course we would be happy to receive any feedback about the above solution, especially if you could or could not get this to work on your specific Linux distribution and version. 

Best regards,
Marco Flachmann and Oliver Heggelbacher
- The Docklight Developers -


Comments