Page 1 of 1

Tech2 communication with modern laptop

Posted: Mon Mar 29, 2021 10:35 am
by fenby
Tech2 communication with modern laptop

I’ve just bought a Tech2 clone and managed to set up TIS2000 on a modern laptop running running Windows 10 64 bit and also Linux Mint 20.1. In both cases I used the VirtualBox hypervisor. I used VirtualBox because it is free, open source, cross-platform and support for interfacing is good. I’ve not found much information on Saab forums about the use of VirtualBox for running TIS2000 and nothing about using on a Linux host, so I thought I’d share what I’ve learned in case it’s of any use to others.

Where possible, my preferred OS is something Linux based and for the past few years I’ve mostly been using Linux Mint, so I had a go at getting TIS2000 working on an Asus Aspire E15 laptop which I had knocking about. I installed the latest version of Linux Mint (20.1 at the time of writing) on it and then installed Virtual box from the ‘Software Manager’. I then created a virtual machine of type ‘Windows XP 32 bit’ with 1GB RAM, one virtual CPU core and a virtual hard drive of size 10GB, with the dynamic resize option selected. I then loaded a virtual Windows XP installation disc as an ISO image into the virtual CD drive and installed 32 bit Windows XP Pro SP3. I chose to turn off automatic updates during installation as I do not intend for this VM to connect to the internet.

Once XP was installed I installed the VirtualBox guest additions. This makes the VM much nicer to use: You can go full screen and have the option to share directories between the host machine and the VM, also copy and paste text and files between the host and the VM.

My laptop does not have an RS232 serial port (which is required to connect to the Tech2), but I already had a StarTech USB to serial RS232 converter. It has the Prolific PL2303 chipset. I plugged this, opened a terminal and ran the command ‘hwinfo –short’. At the bottom of the resulting output was ‘/dev/ttyUSB0 Prolific PL2303 Serial Port’. I wanted to test that the device was actually working so next I installed some terminal emulation software called ‘PuTTY’ with the command ‘sudo apt install putty’. I then started the application by running the comand ‘putty’. In the ‘Session’ section I then selected the ‘Serial’ Radio button. I entered ‘/dev/ttyUSB0’ in the ‘Serial Line’ text box. That was the path listed for this device when I ran the ‘hwinfo -short’ command. I entered ‘115200’ in the ‘Speed’ textbox as this seems to be the default speed that the Tech2 communications work at and I wanted to confurm that the USB to serial converter will actually work at that speed. My Tech 2 came with a 9 way D-type to RJ45 adapter and an RJ45 loopback connector. I plugged the loopback connector into the D-type to RJ45 adapter and then plugged the D-type adapter into the USB to serial adapter. I clicked ‘Open’ in PuTTY and started typing junk in the main text box. If all is well then what you type should be printed in the text box. If the loopback connector is removed, then what you type should not be echoed in the textbox. This test passed.

The next step was to add a virtual serial port to my XP VM. This is done with the VM powered down from within VirtualBox. I ticked the ‘Enable Serial Port’ checkbox, selected COM1 as the port number, selected ‘Host Device’ from the ‘Port Mode’ drop-down list and then entered ‘/dev/ttyUSB0’ in the ‘Path/Address’ text box. I clicked ‘OK’ and started the XP VM. I went into the ‘device manager’ in the XP VM to confirm that there was a serial port present on COM1 and that it was reported as working correctly. I then wanted to test that the virtual serial port was actually working, so I left the loopback connector plugged into the USB to serial converter and launched the ‘HyperTerminal’ application (which is included with Windows XP). I used the same speed setting as before and opened a terminal emulation session on COM1. I confirmed that when I typed into the text box that what I typed was echoed back and that when the loopback connector was removed, nothing was echoed back. This all worked.

I then installed TIS2000, plugged the Tech2 into the USB to serial converter and tried to make them talk. Each time I tried this a dialogue box from VirtualBox appeared stating that there had been a serial IO error and the connection failed. I’m not sure why this happened, because the loopback test using HyperTerminal from within the XP VM has already confirmed that the serial port is working at the correct speed.

I then thought that perhaps I was fighting a loosing battle trying to make this work on a Linux host, so I copied the VM files to the Windows 10 partition on my laptop (I have dual boot with Linux Mint and Windows 10 set up on this laptop). I ran ‘Device Manager’ and found that the USB to serial converter was installed and apparently all working on COM3. I did not need to install any drivers for the USB to serial converter. I then installed the latest version of VirtualBox on Windows 10 and added the XP VM that I had created in Linux Mint. I went into the serial port settings for the VM in VirtualBox and just changed the ‘Path/Address’ value to COM3. I then started the VM and ran the same loopback test using HyperTerminal. It passed. I then tried making TIS2000 and Tech2 talk, and it all just worked without any issues.

I though about leaving it there and use Windows 10 as the host of the XP VM, but decided to try a bit harder to get things working with Linux Mint running the VM as the host. My strategy was to abandon trying to do serial port passthrough, and instead try USB passthrough to the XP VM. For this the VirtualBox extension pack is probably required (which enables USB2.0). VirtualBox comes complete with USB1.1 passthrough, but I didn’t try using that. I installed the extension pack from ‘Software Manager’. I started the VM and searched for the USB serial converter in the ‘Devices’ menu of the VirtalBox session. It was not there. A bit of Googling revealed that I needed to add myself to the ‘vboxusers’ group to enable USB passthrough on the Linux host, so I shut down the VM and opened a terminal on the host and ran the command ‘sudo usermod -a -G vboxusers $USER’. I then restarted the laptop and started the XP VM. This time I could see and select the Prolific PL2303 USB serial converter in the ‘Devices’ menu of the virtual machine session. After a while a popup appeared in the XP VM stating that new hardware had been added and to offer to go searching for it on the internet. I cancelled that and instead went back to the host and downloaded the 'PL2303_Prolific_DriverInstaller_v1200.zip' from 'http://www.prolific.com.tw/UserFiles/files/PL2303_Prolific_DriverInstaller_v1200.zip' on the web page 'http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=225&pcid=41'. I dragged and dropped the zip file from my host machine into the XP VM and installed the driver. I then restarted the VM, opened device manager and confirmed that there was a working serial port on COM3 and went through the loopback test procedure using HyperTerminal. That worked OK. I then tried communication between the Tech2 and TIS2000, and this time it worked! Once a USB device is selected for passthrough its possible to add a ‘Filter’ which means that the device will be automatically selected for passthrough on startup of the VM.

Conlusions: TIS2000 running on a 32 bit Windows XP Pro VM on a Linux Mint 20.1 host with VirtualBox 6.1 can communicate with a Tech2 via a Prolific PL2303 USB to serial port adapter. I failed by doing a serial port passthrough from host to guest but doing a USB 2.0 passthrough from host to guest (using VirtualBox extension pack) and installing the PL2303 drivers in the XP VM worked. You need to add yourself to the vboxusers group. I suspect that this would work on most other Linux distros too. I don’t have access to a Mac, but I would suspect that it’s possible to use a similar method to get things up and running on one of those too. I found that things were a bit easier using Windows 10 as the host, as serial port passthrough just worked.

I’ve seen lots of forum posts suggesting that an old laptop with XP already installed and a built in serial port is the easiest way to go and I would agree that you would end up spending less time doing it that way, but there are advantages to using the VM option:
(1.) It’s probably going to be cheaper.
(2.) How reliable is an old XP laptop going to be? If you leave it on a shelf for months, will it boot up when you really need it to? If you use a VM, then once the VM has been set up, it can be backed up and you just transfer it to a new laptop if your old one breaks or if you just want to stay up to date.
(3.) VirtualBox has the option of creating ‘checkpoints’ which are snapshots of the Virtual machine at point in time. So, for example you can take a snapshot Tech2 communication with modern laptop

I’ve just bought a Tech2 clone and managed to set up TIS2000 on a modern laptop running running Windows 10 64 bit and also Linux Mint 20.1. In both cases I used the VirtualBox hypervisor. I used VirtualBox because it is free, open source, cross-platform and support for interfacing is good. I’ve not found much information on Saab forums about the use of VirtualBox for running TIS2000 and nothing about using on a Linux host, so I thought I’d share what I’ve learned in case it’s of any use to others.

Where possible, my preferred OS is something Linux based and for the past few years I’ve mostly been using Linux Mint, so I had a go at getting TIS2000 working on an Asus Aspire E15 laptop which I had knocking about. I installed the latest version of Linux Mint (20.1 at the time of writing) on it and then installed Virtual box from the ‘Software Manager’. I then created a virtual machine of type ‘Windows XP 32 bit’ with 1GB RAM, one virtual CPU core and a virtual hard drive of size 10GB, with the dynamic resize option selected. I then loaded a virtual Windows XP installation disc as an ISO image into the virtual CD drive and installed 32 bit Windows XP Pro SP3. I chose to turn off automatic updates during installation as I do not intend for this VM to connect to the internet.

Once XP was installed I installed the VirtualBox guest additions. This makes the VM much nicer to use: You can go full screen and have the option to share directories between the host machine and the VM, also copy and paste text and files between the host and the VM.

My laptop does not have an RS232 serial port (which is required to connect to the Tech2), but I already had a StarTech USB to serial RS232 converter. It has the Prolific PL2303 chipset. I plugged this, opened a terminal and ran the command ‘hwinfo –short’. At the bottom of the resulting output was ‘/dev/ttyUSB0 Prolific PL2303 Serial Port’. I wanted to test that the device was actually working so next I installed some terminal emulation software called ‘PuTTY’ with the command ‘sudo apt install putty’. I then started the application by running the comand ‘putty’. In the ‘Session’ section I then selected the ‘Serial’ Radio button. I entered ‘/dev/ttyUSB0’ in the ‘Serial Line’ text box. That was the path listed for this device when I ran the ‘hwinfo -short’ command. I entered ‘115200’ in the ‘Speed’ textbox as this seems to be the default speed that the Tech2 communications work at and I wanted to confurm that the USB to serial converter will actually work at that speed. My Tech 2 came with a 9 way D-type to RJ45 adapter and an RJ45 loopback connector. I plugged the loopback connector into the D-type to RJ45 adapter and then plugged the D-type adapter into the USB to serial adapter. I clicked ‘Open’ in PuTTY and started typing junk in the main text box. If all is well then what you type should be printed in the text box. If the loopback connector is removed, then what you type should not be echoed in the textbox. This test passed.

The next step was to add a virtual serial port to my XP VM. This is done with the VM powered down from within VirtalBox. I ticked the ‘Enable Serial Port’ checkbox, selected COM1 as the port number, selected ‘Host Device’ from the ‘Port Mode’ drop-down list and then entered ‘/dev/ttyUSB0’ in the ‘Path/Address’ text box. I clicked ‘OK’ and started the XP VM. I went into the ‘device manager’ in the XP VM to confirm that there was a serial port present on COM1 and that it was reported as working correctly. I then wanted to test that the virtual serial port was actually working, so I left the loopback connector plugged into the USB to serial converter and launched the ‘HyperTerminal’ application (which is included with Windows XP). I used the same speed setting as before and opened a terminal emulation session on COM1. I confirmed that when I typed into the text box that what I typed was echoed back and that when the loopback connecter was removed, nothing was echoed back. This all worked.

I then installed TIS2000, plugged the Tech2 into the USB to serial converter and tried to make them talk. Each time I tried this a dialogue box from VirtualBox appeared stating that there had been a serial IO error and the connection failed. I’m not sure why this happened, because the loopback test using HyperTerminal from within the XP VM has already confirmed that the serial port is working at the correct speed.

I then thought that perhaps I was fighting a loosing battle trying to make this work on a Linux host, so I copied the VM files to the Windows 10 partition on my laptop (I have dual boot with Linux Mint and Windows 10 set up on this laptop). I ran ‘Device Manager’ and found that the USB to serial converter was installed and apparently all working on COM3. I did not need to install any drivers for the USB to serial converter. I then installed the latest version of VirtualBox on Windows 10 and added the XP VM that I had created in Linux Mint. I went into the serial port settings for the VM in VirtualBox and just changed the ‘Path/Address’ value to COM3. I then started the VM and ran the same loopback test using HyperTerminal. It passed. I then tried making TIS2000 and Tech2 talk, and it all just worked without any issues.

I though about leaving it there and use Windows 10 as the host of the XP VM, but decided to try a bit harder to get things working with Linux Mint running the VM as the host. My strategy was to abandon trying to do serial port passthrough, and instead try USB passthrough to the XP VM. For this the VirtualBox extension pack is probably required (which enables USB2.0). VirtualBox comes complete with USB1.1 passthrough, but I didn’t try using that. I installed the extension pack from ‘Software Manager’. I started the VM and searched for the USB serial converter in the ‘Devices’ menu of the VirtalBox session. It was not there. A bit of Googling revealed that I needed to add myself to the ‘vboxusers’ group to enable USB passthrough on the Linux host, so I shut down the VM and opened a terminal on the host and ran the command ‘sudo usermod -a -G vboxusers $USER’. I then restarted the laptop and started the XP VM. This time I could see and select the Prolific PL2303 USB serial converter in the ‘Devices’ menu of the virtual machine session. After a while a popup appeared in the XP VM stating that new hardware had been added and to offer to go searching for it on the internet. I cancelled that and instead went back to the host and downloaded the 'PL2303_Prolific_DriverInstaller_v1200.zip' from 'http://www.prolific.com.tw/UserFiles/files/PL2303_Prolific_DriverInstaller_v1200.zip' on the web page 'http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=225&pcid=41'. I dragged and dropped the zip file from my host machine into the XP VM and installed the driver. I then restarted the VM, opened device manager and confirmed that there was a working serial port on COM3 and went through the loopback test procedure using HyperTerminal. That worked OK. I then tried communication between the Tech2 and TIS2000, and this time it worked! Once a USB device is selected for passthrough its possible to add a ‘Filter’ which means that the device will be automatically selected for passthrough on startup of the VM.

Conlusions: TIS2000 running on a 32 bit Windows XP Pro VM on a Linux Mint 20.1 host with VirtualBox 6.1 can communicate with a Tech2 via a Prolific PL2303 USB to serial port adapter. I failed by doing a serial port passthrough from host to guest but doing a USB 2.0 passthrough from host to guest (using VirtualBox extension pack) and installing the PL2303 drivers in the XP VM worked. You need to add yourself to the vboxusers group. I suspect that this would work on most other Linux distros too. I don’t have access to a Mac, but I would suspect that it’s possible to use a similar method to get things up and running on one of those too. I found that things were a bit easier using Windows 10 as the host, as serial port passthrough just worked.

I’ve seen lots of forum posts suggesting that an old laptop with XP already installed and a built in serial port is the easiest way to go and I would agree that you would end up spending less time doing it that way, but there are advantages to using the VM option:
(1.) It’s probably going to be cheaper.
(2.) How reliable is an old XP laptop going to be? If you leave it on a shelf for months, will it boot up when you really need it to? If you use a VM, then once the VM has been set up, it can be backed up and you just transfer it to a new laptop if your old one breaks or if you just want to stay up to date.
(3.) VirtualBox has the option of creating ‘checkpoints’ which are snapshots of the Virtual machine at point in time. So, for example you can take a snapshot just after installing XP, Just after installing ‘Guest additions’, just after getting TIS2000 communicating with Tech2, etc. and revert back to any of the checkpoints if the VM somehow becomes corrupt.

Note that there is actually virtualisation software built into Windows 10 Pro called Hyper-V. I have a lot of experience of using this. It does not have good support for serial interfacing out of the box, but it can be made to work using some additional open source software. It might be possible to get TIS2000 talking to the Tech2 from a Hyper-V XP VM. You might want to try this if you are already using Hyper-V, because I don't think it's possible to have Hyper-V and VirtualBox installed at the same time.