Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - G8B4Life

Pages: 1 2 [3] 4 5 ... 52
31
Part 3: Installling RailPro Assistant and HC Simulator

Download the RailPro Assistant and HC Simulator installers from Ring Engineering to your desktop.

Run the installers by double clicking them. Wine should have configured your system to recognise they are Windows executables and run them with Wine automatically. If not you may need to right click the installers and run them with the Wine Loader. When the installers show the prompt about running with Administrator rights just click the Yes button. Windows Administrator rights don't matter in Wine.

Wine does not create any desktop or menu entries for any program you install, so you will need to create them.

Download the RailPro-Blue.svg and RailPro-Orange.svg icons to your desktop, and then move them to the correct locations

Code: [Select]
sudo mkdir /usr/share/icons/RailPro
sudo mv ~/Desktop/RailPro-Orange.svg /usr/share/icons/RailPro
sudo mv ~/Desktop/RailPro-Blue.svg /usr/share/icons/RailPro

Download the HC Simulator.desktop file and RailProAssistant.desktop file to your desktop, or create them using your favourite editor.

HCSimulator.desktop
Code: [Select]
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=wine "c:\\program files\\ring engineering\\railpro hc simulator\\hc simulator.exe"
Name=HC Simulator
Icon=/usr/share/icons/RailPro/RailPro-Blue.svg
StartupWMClass=HC Simulator
Comment=Run HC Simulator
GenericName=RailPro HC Simulator


RailProAssistant.desktop
Code: [Select]
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=wine "c:\\program files\\ring engineering\\railpro assistant\\ringengassistant.exe"
Name=RailPro Assistant
Icon=/usr/share/icons/RailPro/RailPro-Orange.svg
StartupWMClass=RailPro Assistant
Comment=Run RailPro Assistant
GenericName=RailPro Assistant

Your should now be able to run RailPro Assistant and HC Simulator by double clicking the desktop icons, and RailPro Assistant and HC Simulator should see and communicate with the CI-1, HC-2, HC-2b and HC-1.


All ready to go

- Tim

32
Part 2: Setting up Wine and hardware access

We now need to set up Wine.

Download the CI-1.reg, HC-2b.reg and Disable-SDL.reg files to your desktop or using your favourite text editor create each of the files with the contents below.

CI-1.reg
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{4d1e55b2-f16f-11cf-88cb-001111000030}\##?#HID#Vid_04d8&Pid_f321#6&24b60e9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}]
"DeviceInstance"="HID\\Vid_04d8&Pid_f321\\6&24b60e9&0&0000"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{4d1e55b2-f16f-11cf-88cb-001111000030}\##?#HID#Vid_04d8&Pid_f321#6&24b60e9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\#]
"SymbolicLink"="\\\\?\\HID#Vid_04d8&Pid_f321#6&24b60e9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f321\6&24b60e9&0&0000]
"Capabilities"=dword:000000e0
"UINumber"=dword:00000000
"ConfigFlags"=dword:00000000
"HardwareID"=hex(7):48,00,49,00,44,00,5c,00,56,00,69,00,64,00,5f,00,30,00,34,\
  00,64,00,38,00,26,00,50,00,69,00,64,00,5f,00,66,00,33,00,32,00,31,00,26,00,\
  52,00,65,00,76,00,5f,00,30,00,30,00,30,00,32,00,00,00,48,00,49,00,44,00,5c,\
  00,56,00,69,00,64,00,5f,00,30,00,34,00,64,00,38,00,26,00,50,00,69,00,64,00,\
  5f,00,66,00,33,00,32,00,31,00,00,00,48,00,49,00,44,00,5f,00,44,00,45,00,56,\
  00,49,00,43,00,45,00,5f,00,55,00,50,00,3a,00,46,00,46,00,30,00,30,00,5f,00,\
  55,00,3a,00,30,00,30,00,30,00,31,00,00,00,48,00,49,00,44,00,5f,00,44,00,45,\
  00,56,00,49,00,43,00,45,00,00,00,00,00
"CompatibleIDs"=hex(7):00,00,00,00
"ClassGUID"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}"
"Class"="HIDClass"
"Driver"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\\0011"
"Mfg"="(Standard system devices)"
"DeviceDesc"="HID-compliant device"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f321\6&24b60e9&0&0000\Device Parameters]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f321\6&24b60e9&0&0000\LogConf]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_04d8&Pid_f321\5&269a58e2&0&8]
"DeviceDesc"="USB Human Interface Device"
"LocationInformation"="CI-1"
"Capabilities"=dword:00000084
"UINumber"=dword:00000000
"HardwareID"=hex(7):55,00,53,00,42,00,5c,00,56,00,69,00,64,00,5f,00,30,00,34,\
  00,64,00,38,00,26,00,50,00,69,00,64,00,5f,00,66,00,33,00,32,00,31,00,26,00,\
  52,00,65,00,76,00,5f,00,30,00,30,00,30,00,32,00,00,00,55,00,53,00,42,00,5c,\
  00,56,00,69,00,64,00,5f,00,30,00,34,00,64,00,38,00,26,00,50,00,69,00,64,00,\
  5f,00,66,00,33,00,32,00,31,00,00,00,00,00
"CompatibleIDs"=hex(7):55,00,53,00,42,00,5c,00,43,00,6c,00,61,00,73,00,73,00,\
  5f,00,30,00,33,00,26,00,53,00,75,00,62,00,43,00,6c,00,61,00,73,00,73,00,5f,\
  00,30,00,30,00,26,00,50,00,72,00,6f,00,74,00,5f,00,30,00,30,00,00,00,55,00,\
  53,00,42,00,5c,00,43,00,6c,00,61,00,73,00,73,00,5f,00,30,00,33,00,26,00,53,\
  00,75,00,62,00,43,00,6c,00,61,00,73,00,73,00,5f,00,30,00,30,00,00,00,55,00,\
  53,00,42,00,5c,00,43,00,6c,00,61,00,73,00,73,00,5f,00,30,00,33,00,00,00,00,\
  00
"ClassGUID"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}"
"Class"="HIDClass"
"Driver"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\\0010"
"Mfg"="(Standard system devices)"
"Service"="HidUsb"
"ConfigFlags"=dword:00000000
"ParentIdPrefix"="6&24b60e9&0"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_04d8&Pid_f321\5&269a58e2&0&8\Device Parameters]
"ExtPropDescSemaphore"=dword:00000001
"SymbolicName"="\\??\\USB#Vid_04d8&Pid_f321#5&269a58e2&0&8#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_04d8&Pid_f321\5&269a58e2&0&8\LogConf]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\0010]
"InfPath"="input.inf"
"InfSection"="HID_Inst"
"InfSectionExt"=".NT"
"ProviderName"="Microsoft"
"DriverDateData"=hex:00,80,62,c5,c0,01,c1,01
"DriverDate"="7-1-2001"
"DriverVersion"="5.1.2600.5512"
"MatchingDeviceId"="usb\\class_03"
"DriverDesc"="USB Human Interface Device"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\0011]
"InfPath"="input.inf"
"InfSection"="HID_Raw_Inst"
"InfSectionExt"=".NT"
"ProviderName"="Microsoft"
"DriverDateData"=hex:00,80,62,c5,c0,01,c1,01
"DriverDate"="7-1-2001"
"DriverVersion"="5.1.2600.5512"
"MatchingDeviceId"="hid_device"
"DriverDesc"="HID-compliant device"

HC-2b.reg
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{4d1e55b2-f16f-11cf-88cb-001111000030}\##?#HID#Vid_04d8&Pid_f320#6&2257ad39&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}]
"DeviceInstance"="HID\\Vid_04d8&Pid_f320\\6&2257ad39&0&0000"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{4d1e55b2-f16f-11cf-88cb-001111000030}\##?#HID#Vid_04d8&Pid_f320#6&2257ad39&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\#]
"SymbolicLink"="\\\\?\\HID#Vid_04d8&Pid_f320#6&2257ad39&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f320]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f320\6&2257ad39&0&0000]
"Capabilities"=dword:000000e0
"UINumber"=dword:00000000
"ConfigFlags"=dword:00000000
"HardwareID"=hex(7):48,00,49,00,44,00,5c,00,56,00,69,00,64,00,5f,00,30,00,34,\
  00,64,00,38,00,26,00,50,00,69,00,64,00,5f,00,66,00,33,00,32,00,30,00,26,00,\
  52,00,65,00,76,00,5f,00,30,00,30,00,30,00,32,00,00,00,48,00,49,00,44,00,5c,\
  00,56,00,69,00,64,00,5f,00,30,00,34,00,64,00,38,00,26,00,50,00,69,00,64,00,\
  5f,00,66,00,33,00,32,00,30,00,00,00,48,00,49,00,44,00,5f,00,44,00,45,00,56,\
  00,49,00,43,00,45,00,5f,00,55,00,50,00,3a,00,46,00,46,00,30,00,30,00,5f,00,\
  55,00,3a,00,30,00,30,00,30,00,31,00,00,00,48,00,49,00,44,00,5f,00,44,00,45,\
  00,56,00,49,00,43,00,45,00,00,00,00,00
"CompatibleIDs"=hex(7):00,00,00,00
"ClassGUID"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}"
"Class"="HIDClass"
"Driver"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\\0017"
"Mfg"="(Standard system devices)"
"DeviceDesc"="HID-compliant device"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f320\6&2257ad39&0&0000\Device Parameters]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f320\6&2257ad39&0&0000\LogConf]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_04d8&Pid_f320\5&269a58e2&0&5]
"DeviceDesc"="USB Human Interface Device"
"LocationInformation"="HC-2b"
"Capabilities"=dword:00000084
"UINumber"=dword:00000000
"HardwareID"=hex(7):55,00,53,00,42,00,5c,00,56,00,69,00,64,00,5f,00,30,00,34,\
  00,64,00,38,00,26,00,50,00,69,00,64,00,5f,00,66,00,33,00,32,00,30,00,26,00,\
  52,00,65,00,76,00,5f,00,30,00,30,00,30,00,32,00,00,00,55,00,53,00,42,00,5c,\
  00,56,00,69,00,64,00,5f,00,30,00,34,00,64,00,38,00,26,00,50,00,69,00,64,00,\
  5f,00,66,00,33,00,32,00,30,00,00,00,00,00
"CompatibleIDs"=hex(7):55,00,53,00,42,00,5c,00,43,00,6c,00,61,00,73,00,73,00,\
  5f,00,30,00,33,00,26,00,53,00,75,00,62,00,43,00,6c,00,61,00,73,00,73,00,5f,\
  00,30,00,30,00,26,00,50,00,72,00,6f,00,74,00,5f,00,30,00,30,00,00,00,55,00,\
  53,00,42,00,5c,00,43,00,6c,00,61,00,73,00,73,00,5f,00,30,00,33,00,26,00,53,\
  00,75,00,62,00,43,00,6c,00,61,00,73,00,73,00,5f,00,30,00,30,00,00,00,55,00,\
  53,00,42,00,5c,00,43,00,6c,00,61,00,73,00,73,00,5f,00,30,00,33,00,00,00,00,\
  00
"ClassGUID"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}"
"Class"="HIDClass"
"Driver"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\\0016"
"Mfg"="(Standard system devices)"
"Service"="HidUsb"
"ConfigFlags"=dword:00000000
"ParentIdPrefix"="6&2257ad39&0"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_04d8&Pid_f320\5&269a58e2&0&5\Device Parameters]
"ExtPropDescSemaphore"=dword:00000001
"SymbolicName"="\\??\\USB#Vid_04d8&Pid_f320#5&269a58e2&0&5#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_04d8&Pid_f320\5&269a58e2&0&5\LogConf]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\0016]
"InfPath"="input.inf"
"InfSection"="HID_Inst"
"InfSectionExt"=".NT"
"ProviderName"="Microsoft"
"DriverDateData"=hex:00,80,62,c5,c0,01,c1,01
"DriverDate"="7-1-2001"
"DriverVersion"="5.1.2600.5512"
"MatchingDeviceId"="usb\\class_03"
"DriverDesc"="USB Human Interface Device"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\0017]
"InfPath"="input.inf"
"InfSection"="HID_Raw_Inst"
"InfSectionExt"=".NT"
"ProviderName"="Microsoft"
"DriverDateData"=hex:00,80,62,c5,c0,01,c1,01
"DriverDate"="7-1-2001"
"DriverVersion"="5.1.2600.5512"
"MatchingDeviceId"="hid_device"
"DriverDesc"="HID-compliant device"

Disable-SDL.reg
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\winebus]
"DisableHidraw"=dword:00000000
"DisableInput"=dword:00000000
"Enable SDL"=dword:00000000

Open a terminal window and run Winecfg

Code: [Select]
winecfg

Wine will build a prefix on first run. During the building of the prefix it you haven't got Gecko and Mono already installed on your system Wine will ask you if you'd like to install them. You should answer Yes to install Gecko and Mono.

When the Wine configuration utility loads you can close it as you no longer need it open.

In the terminal window run the regedit command.

Code: [Select]
wine regedit

When the registry editor loads, import each of the CI-1, HC-2b and Disable-SDL registry files you downloaded (or created) into the registry editor. When done close the registry editor. You can then delete the registry files.

Download the 99-usb-rp-ci1.rules, 99-usb-rp-hc2b.rules and if you have a HC-1 or old version HC-2 (the non 2b version) 99-usb-serial-rp-hc1.rules files to your desktop or using your favourite text editor create each of the files with the contents below.

99-usb-rp-ci1.rules
Code: [Select]
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f321", SYMLINK+="railpro_ci-1", MODE="0666"

99-usb-rp-hc2b.rules
Code: [Select]
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f320", SYMLINK+="railpro_hc-2b", MODE="0666"

99-usb-serial-rp-hc1.rules
Code: [Select]
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="railpro_hc-1_2", MODE="0666"
rmmod ftdi_sio
rmmod usbserial



Note: If you need to use the rules file for the HC-1 / old HC-2 be aware that the idVendor and idProduct values are common to other devices that have an FTDI serial-usb chip in them and as such any device you plug in that has these id values will trigger the rule. This could potentially make these other devices inaccessible to any other program on the system. If this is a concern to you you can modify the rule as follows

Code: [Select]
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="xxxxxxxx", SYMLINK+="railpro_hc-1_2", MODE="0666"
rmmod ftdi_sio
rmmod usbserial

where xxxxxxxx is the serial number of the FTDI chip in the HC-1 / old HC-2. To find the serial number of the FTDI chip plug the HC-1 / old HC-2 in, turn it on and in the terminal run the dmesg command

Code: [Select]
dmesg


The serial number in this screen capture is not your serial number

If you do not wish to edit the 99-usb-serial-rp-hc1.rules yourself you can use the generator at rptools.pdc.ca (still being written) but you will need to copy the serial number accurately into the generator. Once you have found the serial number you can turn off and unplug the HC-1/ old HC-2.



In a terminal window type in the following command to move the rules to the correct location

Code: [Select]
sudo mv ~/Desktop/*.rules /etc/udev/rules.d/

Reload the rules so they take effect

Code: [Select]
sudo udevadm control --reload-rules

You should now test that the device rules are applying correctly. Plug the CI-1 / HC-2 / HC-1 into a USB port. In the terminal run the ls command on the symbolic link

For the CI-1
Code: [Select]
ls -al /dev/railpro_ci-1

For the HC-2b
Code: [Select]
ls -al /dev/railpro_hc-2b

For the HC-1 / old HC-2
Code: [Select]
ls -al /dev/railpro_hc-1_2

The symbolic link will show you the device path.



Now run the ls command on the device path that the symbolic link points to, for example

Code: [Select]
ls -al /dev/bus/usb/002/006

The device should have the permissions crwx-rw-rw. If the permissions do not match then there is a problem with the rules file for the device.


Correct permissions


Incorrect permissions

Repeat the test for each type of RailPro device your own.


If you have a HC-1 or older version HC-2 you will need to install the ftd2xx driver. Download the x86 (32bit) or x64 (64bit) depending on your system Linux drivers from https://www.ftdichip.com/Drivers/D2XX.htm to your desktop and extract the libftd2xx.so.1.4.8 driver file from the archive. The current version is 1.4.8.

In the terminal move the libftd2xx.so.1.4.8 file to /usr/lib/ and create the symbolic links needed

Code: [Select]
sudo mv ~/Desktop/libftd2xx.so.1.4.8 /usr/lib/
ln -s /usr/lib/libftd2xx.so.1.4.8 /usr/lib/libftd2xx.so
ln -s /usr/lib/libftd2xx.so.1.4.8 /usr/lib/libftd2xx.so.0


Download the ftd2xx.dll.so wrapper to your desktop and move it to the Wine lib directory, and create the symbolic link needed.

For Wine Stable
Code: [Select]
sudo mv ~/Desktop/ftd2xx.dll.so /opt/wine-stable/lib/wine/
ln -s /opt/wine-stable/lib/libwine.so.1.0 /usr/lib/libwine/libwine.so.1

For Wine Development
Code: [Select]
sudo mv ~/Desktop/ftd2xx.dll.so /opt/wine-devel/lib/wine/
ln -s /opt/wine-devel/lib/libwine.so.1.0 /usr/lib/libwine/libwine.so.1

For Wine Staging
Code: [Select]
sudo mv ~/Desktop/ftd2xx.dll.so /opt/wine-staging/lib/wine/
ln -s /opt/wine-staging/lib/libwine.so.1.0 /usr/lib/libwine/libwine.so.1
. . .
- Tim

33
How to: Installing and running RailPro in Linux with Wine

Previously I ran an experiment to see if I could get RailPro software to run on Linux. The post I made simply detailed what I did more as a running commentary than a how to and I didn't finish it up completely; once I got the software running I left it and moved on.

This how-to guide covers installing Wine and RailPro Assistant and HC Simulator on Ubuntu and Debian based distributions and getting them to run and making it easier to use than how I left things in my experiment post. Although Wine can be installed on Fedora (31 and 32), macOS (10.8 to 10.14), OpenSUSE, Slackware, FreeBSD and Android as well this guide does not cover those distributions. Full instructions for installing Wine in different Linux distributions can be found on the Wine webpage at winehq.org.  It is recommended you familiarise yourself with the instructions at WineHQ even though you are following this guide.

Depending on your terminals capability you may be able to copy and paste the commands into the terminal to save on typing them in. This guide makes the assumption that files that you download will be downloaded to your desktop. If you download the files to a different location you will need to substitute that location for the desktop in the commands.

Obligatory disclaimer

This guide was tested using Lubuntu (Ubuntu 18.04). It has not been tested under other versions of Ubuntu or Debian. If you are installing on Debian you may need to modify the commands entered into the terminal depending on your user permissions (you may be a root user in which case you may not need the sudo command).
. . .

Part 1: Installing Wine

There are two methods for this part, the slightly harder way and the slightly easier way.

The slightly easier way:

Use the install script generator at rptools.pdc.ca (still being written) and follow the instructions there for using the install script.

The slightly harder way:

Open a terminal window and type in the following commands in order.

If your distribution is 64 bit and you haven't previously done this enable 32 bit architecture in your distribution

Code: [Select]
sudo dpkg --add-architecture i386

Download and add the repository key for Wine

For Ubuntu based distributions
Code: [Select]
wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -

For Debian based distributions
Code: [Select]
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key

Add the repository for Wine. You will need to choose the correct repository based on the version of Ubuntu or Debian you have or your distribution is based on. See WineHQ for further information.

For Ubuntu 20.04 based distributions
Code: [Select]
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'

For Ubuntu 19.10 based distributions
Code: [Select]
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ eaon main'

For Ubuntu 18.04 based distributions
Code: [Select]
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'

For Ubuntu 16.04 based distributions
Code: [Select]
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'

For Debian 10 based distributions
Code: [Select]
deb https://dl.winehq.org/wine-builds/debian/ buster main

For Debian 9 based distributions
Code: [Select]
deb https://dl.winehq.org/wine-builds/debian/ stretch main

If you are installing to Unbuntu 18.04 based or Debian 10 based distributions you need to add a repository to be able to install FAudio which Wine requires. Though you can install these manually if you are confident in your ability to do so by following the instructions linked on the WineHQ site most users will find it easier to let the system handle the installation.

If you want the system to handle the installation add the repository key

For Ubuntu based distributions
Code: [Select]
wget -O - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key | sudo apt-key add -

For Debian based distributions
Code: [Select]
wget -nc https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/Release.key
sudo apt-key add Release.key

And add the repository for FAudio

For Ubuntu based distributions
Code: [Select]
sudo add-apt-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/ ./'

For Debian based distributions
Code: [Select]
echo "deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10 ./" >> /etc/apt/sources.list.d/faudio.list

Update the repository list

Code: [Select]
sudo apt update

And finally Install Wine. You will need to choose which version of Wine you wish to install. The choices are Wine Stable, Wine Development and Wine Staging. It is not recommended to use Wine Staging, this version receives the latest new features which are not fully tested which has the potential to cause regressions (break) Wine. Wine development receives more updates than Wine Stable and the updates have had more testing to not cause Wine to break but regressions are still common. Wine Stable receives the least updates and updates generally do not cause regressions due to the amount of time that is available to test features before being put into Wine Stable. This guide was tested using Wine Stable.

To Install Wine Stable
Code: [Select]
sudo apt install --install-recommends winehq-stable

To Install Wine Development
Code: [Select]
sudo apt install --install-recommends winehq-devel

To Install Wine Staging
Code: [Select]
sudo apt install --install-recommends winehq-staging

If the install notifies you of missing dependencies answer yes to install them.
. . .
- Tim

34
General Discussion / Re: Going Partially Back To DCC
« on: July 02, 2020, 04:13:10 AM »
That's sad to hear.

DCC is ingrained...
or stubbon, brainwashed, clueless, biased... I could go on.

Quote
It also appears that thanks to Ring that Digitrax has finally entered the early 2000's with the UI. Yeah!!

More than likely it was TCS's offering not RP that pushed them to do it if it was competition that got them off their backsides unfortunately.

- Tim

35
Welcome to the forum Trainbrain.

I'm really happy to see you trying to duplicate what I did but as it was just a "journal" of the experiment and not a proper how-to there is possibly steps I missed writing down, though I don't think I missed any steps, and one thing I didn't post at all. I always intended to go back and finish it up (make it so a person doesn't have to change the permissions every time, a desktop icon etc) and write a proper how-to but I got distracted by experiment 2 (which isn't going so well). I'll try and do a proper how-to tonight.

So, back to where you are stuck, the registry information I posted is only for the CI-1, there is a whole separate set of registry entries for the HC-2b which I didn't post in the experiment (remember, was going to come back and write a proper how-to). I've attached them to this post for the time being. Download them and import them in the Wine registry editor.

The registry files should be good for anyone, not just me. As to find a resource to understand the registry to be able to build keys? it's black magic and even I don't understand it! The registry information was extracted from a Windows PC that had already seen a CI-1 and HC-2b.

- Tim

 [ You are not allowed to view attachments ]  CI-1 registry entries
 [ You are not allowed to view attachments ]  HC-2b registry entries


36
RailPro Discussion & Help / Re: Revisiting UI and UX ...again!
« on: June 27, 2020, 09:24:31 AM »
I am always baffled when I see icons and text combined. Isn't the whole purpose of an icon to make text unnecessary?

Not really, think of everyday stuff you see and you'll see a lot have both, a pictogram and text. Two very quick examples I can think of are an exit sign and a fire extinguisher sign; both have the pictogram and text.  Road signs too have many cases with a pictogram and text. While there are very good reasons in the real world for combining a pictogram with text I kind of think of of it this way, the pictogram is the indicator of the function (whether to exit a building or to turn on the front light of your locomotive) and the text is the conformation of the function. With RailPro because you can make any button do anything regardless of the pictogram chosen you need to have the text as well.

There is an issue with having text only buttons if the text is user entered like the button text is now as certain function buttons actually control logic within the controller. It's not insurmountable though. I'll have to mock up a "just text" version of the function buttons.

Some time ago, Tim or someone else posted a nice chart of all the RP icons along with their descriptions. There's no way I would remember what they all stand for without descriptions.  :o 

Yep, that was me, and as usual got the evil stare from 10,000 miles away for the effort. I haven't looked at that guide in ages but I think I still don't know what all the buttons are supposed to be, and I still haven't seen an official buttons guide from RE yet.

and performance monitors (module temp-voltage-current)/throttle on same page.

That information is just one button press away on the control locomotive screen so I'm unsure if your just unaware that you can access it or if your wanting it on the same screen as as the main controlling screen. Given the way that info is presented I don't think you could fit all that on the controlling screen. If the controller was able to report those monitors in numbers and not graphs then it could be possible, but at the expense of what on the controlling screen? There is only an finite amount of space available.

- Tim

37
RailPro Discussion & Help / Another idea, this time function mapping
« on: June 26, 2020, 01:00:47 PM »
Yes, another idea. I'm a lost cause I know  :(

While doing some work on my UI idea's I found myself staring at the HC screen for about 20 minutes as I was pondering what to change the Next Page button text on the Control Locomotive screen to because it's misleading, at least to me, to something not so vague in meaning when I had a thought.

RailPro is seriously falling behind the industry in the number of functions available with most DCC systems now allowing control of nearly 30 functions. Some have had this capability for a very long time now. RailPro can control only 16 functions.

So my idea was this. What if, if we had 32 functions (4 pages worth) available, we could as an option:
  • Split the 32 functions down the middle (2 pages each) and have each set of functions be relative to the direction of the locomotive, and,
  • Be able to map function buttons to other function buttons.
This setup could be beneficial for bi-directional locomotives. Take a GP-9 for example, you could quite easily be driving that either short hood leading or long hood leading down the line. With the idea you could set the function pages something like this:

Page 1 (FN 1 - 8 ) for the main driving functions, and has the lighting functions for going forward, ie
BTN 1: Front Light On
BTN 2: Front Light Dim
BTH 3: Dynamic
BTN 4: Notch up
BTN 5: Horn
BTN 6: Bell
BTN 7: Brake
BTN 8: Notch Down

Page 2 (FN 9 - 16) for other forward functions like ditch lights on/off if fitted and other sounds you might have.

Page 3 (FN 17 - 24) would be for driving in reverse and has the functions for doing that, ie
BTN 1: Rear Light On
BTN 2: Rear Light Dim
BTH 3: Dynamic - Mapped to Button 3 (FN3) on Page 1
BTN 4: Notch up - Mapped to Button 4 (FN4) on Page 1
BTN 5: Horn - Mapped to Button 5 (FN5) on Page 1
BTN 6: Bell - Mapped to Button 6 (FN6) on Page 1
BTN 7: Brake - Mapped to Button 7 (FN7) on Page 1
BTN 8: Notch Down - Mapped to Button 8 (FN8) on Page 1

Page 4 (FN 25 - 32) would be for other reverse functions, ie reverse ditch lights etc, sounds mapped to page 3 functions.

The premise of the idea anyway is that when you change direction the controller would go automatically to the first page of functions for that direction so you have the lighting functions for that direction available straight away and you wouldn't have to go page hopping so much, and being able to map function buttons to other function buttons would save having to set effects on buttons more than the initial time.

I get that for modern stuff this really isn't a thing for, I know your not going to be driving an SD70Ace or a dash 9 with the locomotive running long hood leading on a train but for older stuff where running a train either end leading was fair game, or locomotives with a full cab at either end like we have down here it could be a handy set up.

Well, that's the idea. Does anyone else see any value in it or am I just dreaming up solutions to non existent problems (remember, thinking of 4 pages of function buttons)?

- Tim

38
RailPro Discussion & Help / Revisiting UI and UX ...again!
« on: June 25, 2020, 09:58:39 AM »
With DigiTrax's release of their new throttle, apart from the interesting choice of shape (see the picture on the second page of this MRH thread if you don't get the shape right away:https://model-railroad-hobbyist.com/node/39897) DigiTrax users just got a huge UI (User Interface) boost compared to what they previously had and that got me thinking, yet again, about what we have with our white and dark blue screen.

Personally I think the RP UI just doesn't look at good as it could, or should, for what RP is supposed to offer over other control systems. To me it's looking dated compared to what other systems that now offer a proper RGB screen (touch or not) have.

Many of you will remember my two and a bit year old thread on a less white UI: https://rpug.pdc.ca/index.php/topic,630.0.html and the comments then were favourable to what I had put up. What's everyone thoughts these days? Are you happy enough with the current UI? You'd like a new UI? Can't see the point in my pursuit? Tim just stop wasting bandwidth?

I did a little refresh work on one of the UI idea's from my Less White UI thread. If people are interested I'll post them for comment. If enough people like the different ideas then we could probably take the ideas to RE.

- Tim

39
Quote
Is it able to have RailPro installed in it and still maintain all or most of those features?

To put it bluntly, no. If you put RailPro in you'll take the DCC decoder that's in the model out which means you'll loose the sounds and other features the DCC decoder provided. Given what I've read about Scale Trains stuff you may very well be removing the existing electronics (wiring, motherboard) as well to get RP in and wired up. Other who've done Scale Trains installs can comment further on that one.

You can of course load the RailPro module up with sounds and play them manually (not automatically) when you hit the points etc but I don't think there's many sounds like flange squeal in the RP sound library yet. They do have a GTEL sound file though but it's probably not the quality of the sound included on the DCC decoder.

If you end up with a shelf queen because you don't / can't go through with the installation, I feel for you there; while I have many models without RP in them at the moment two of them are pretty much destined to be shelf queens forever; I don't think I'll ever work up the courage to be able to install RP in them.

- Tim

40
Ken,

No not an engineer. My job title has the word technician in it but it's a totally unrelated field.

Depending on what your an engineer of I can't say if you should be excited or not about experiment 2 but if your an engineer in the field of electronic devices then I think you'll certainly appreciate it, if not be excited.

Experiment 2, if successful, would allow you to get rid of the PC, but it's not a Mac experiment. Unfortunately I don't have access to a Mac to do experimenting with. I suspect it would be the same, or at least very similar to making it work under Linux with Wine but I just don't know for sure.

- Tim

41
Ok, so I mucked that comment to Bill up, it was not Sunday morning there but Monday morning. Public holidays on a Monday always throw me off on what day of the week it is. I feel so stupid  :-[

Cecil, I wasn't expecting anyone to get the technical side of what was in the experiment but hopefully you were able to follow the journey on the things I had to do to get it to work, even if you didn't understand it. That was my aim anyway.

Tim, I tried to use Google translate to convert your Greek Geek into English but no luck.  :P

I fixed it for you Alan  ;D

As to what I'm doing, Well not everyone has a PC with MS Windows to run RailPro Assistant and HC Simulator on. I just made it run on Linux. That should give you some clues.

- Tim

42
Thanks Bill,

Some light reading for your Sunday morning ?  ;) Unfortunately no matter what I did the forum just won't put two of those pictures inline in part 2.

Anyway, Experiment 2 (and 3) is on it's way to me. I still have to get a couple of things to do it though but I do have high hopes for the next experiment, and it should be a much more interesting subject for the group should it be a success.

- Tim

43
Part 3: The HC-1, the old HC-2 and wrapping the experiment up.

There's a lot less pictures in this part.

I had actually started this experiment with an old HC-2 because it should have been easier to get this working in Wine than the CI-1 and HC-2b but it proved to be around the other way around. The amount of text and pictures for this part do not do the amount of head scratching, research and typing in commands into the terminal justice.

Plugging in the old HC-2 (the HC-1 would be exactly the same for this) and running the dmesg and lsusb commands gives us a device on ttyUSB0 and not hidraw. This is because the HC-1 and old HC-2 are not USB HID devices like the CI-1 and HC-2b but present to the operating system as a serial device on a Com port, or to put that in a finer detail, a virtual Com port. This is due to them having what's called a usb to serial converter built into them.

 [ You are not allowed to view attachments ]

It was at this point I had some head scratching to do. There are two methods of accessing FTDI usb to serial converters, a way directly via the virtual com port, and another using the functions in FTDI's third party DLL file, ftd2xx.dll. Both ways seem to have a lot of propriety drivers on Windows to make this happen, which can not be used in Wine.Now if Ring Engineering had chosen to use the directly via the virtual com port method to talk to the old HC's this likely would have been quicker and much easier but they chose the ftd2xx.dll method for RailPro Assistant to access the old HC's. I knew it was highly unlikely that I'd be able to use this Windows dll in Wine, and trying it on the chance confirmed that to be the case so off I was to do more research, starting with FTDI themselves.

FTDI make drivers for many operating systems, and so make the functions in ftd2xx.dll available for Linux in a Linux library as well. This is now the reverse of the issue because RailPro Assisant being a Windows program would not be able to use the Linux version of the ftd2xx.dll. What was needed was a way for Wine to pass those ftd2xx.dll functions calls from RailPro Assistant to the Linux ftd2xx library. The web is littered with posts on various websites from people who want to get serial to usb working on wine and failed but I found a couple of "wrappers" amongst the litter to do the passing but they were all quite old and the instructions likely to be well out of date, if they would even work with the much newer version of Wine that I was using.

To save myself from having to compile code, and running in a virtual machine so security wasn't much of an issue I chose a compiled version wrapper that made reference to the latest Linux ftd2xx library to work with. Starting out, the instructions were definitely out of date, with the file locations wrong for then the files are located today

 [ You are not allowed to view attachments ]
libwine.so.1 not found, it's no longer in the place that the old ftd2xx.dll.so thinks it should be

Once I had located the location to put the files and created a link from the old location to the new location all was ready to go.

Code: [Select]
ln -s /opt/wine-stable/lib/libwine.so.1.0 /usr/lib/libwine/libwine.so.1

Success. RailPro Assistant was able to detect the old HC-2 through the Wine wrapper to the Linux ftd2xx library. All that was left to do was to try downloading something.This was a failure. While RailPro Assistant could see the old HC-2 the HC-2 gave that old message "Can not connect" when trying to download. Back to square one.

As I couldn't see what was going on I tried a different wrapper. This one had debug information in it which allowed me to see what was going on. The debug output indicated that ftd2xx could not get a handle on the file, meaning the HC-2. Some more research led me to an old  technical note from FTDI that stated that the virtual com port driver and ftd2xx were not compatible on Linux, and to use ftd2xx the virtual com port driver needs to be unloaded.

Code: [Select]
rmmod ftdi_sio
rmmod usbserial

After doing this the ttyUSB0 device disappears however when running RailPro Assistant the HC-2 can still be detected. Will it download now?

Click to enlarge
 [ You are not allowed to view attachments ]
Yes, it now downloads!

This was finally successful, with the old HC-2 downloading the file without issue.
. . .
Wrap up

The experiment was a success, I was able to successfully run RailPro Windows software on Linux using Wine, and communicate and use all the hardware as well. This means that there is a viable way to run RailPro on Linux until native Linux versions become available, if ever. I know that probably only interests me but...

It also means that there is likely another free way to run RailPro software on a Mac as well, Wine is available for Mac (some versions excepted) and Mac OS is really just an expensive Linux (both Linux and Mac OS are Unix derived).

While the experiment was a success there is more to do to make the experience better for a ready to go solution that I didn't bother to do for the experiment, like creating rules so one would not have to change the permissions of the hidraw every time a CI-1, HC-2b was plugged in, compiling a new version of ftd2xx and also making a script to do many parts of the setup automatically instead of having to type out every command needed.

I hope you enjoyed Experiment 1. Experiment 1 was a precursor for Experiment 2; hopefully coming in a couple of weeks.

Final thought? There were a lot of dead ends in this experiment. The internet is littered with out of date information on using HID and serial to USB converters. A lot of reading and testing went into extracting the still relevant parts from all the outdated stuff to put together into a working solution.

... and lastly, trying to do this a virtual machine running only 1 GB of RAM is painful to say the least!

- Tim

44
Part 2: The CI-1, the HC-2b and getting them working

With both RPA and HC Simulator running it under Wine it was time to find out the answer to the BIG question; can the software see the hardware; and does it work? I did a lot of research from this point as I knew from previous experiments that HC Simulator would not be able to see the CI-1 (or RPA see the HC-2b) with the way Linux permissions work with USB devices, and also that I'd likely have to help Wine know about the devices. Plugging in the CI-1 and passing it though to the VM Linux can see the CI-1 and identify it.

 [ You are not allowed to view attachments ]
lsusb and dmesg output showing the CI-1

The information given by the dmesg and lsusb commands gave me the information to know which device in Linux was the CI-1, which was Hidraw1 in this case. Changing the permissions for it  is easy.

Code: [Select]
sudo chmod 0666 /dev/hidraw1

No, that isn't a bad reference but just the way *nix permissions work, each number represents a user type on the system and the number relates to a set of permissions that the user has in relation to reading, writing and executing (running) a file, directory or device. The number 6 is read and write permissions which is what we need to be able to access the device.

With the permissions changed lets try HC Simulator. Can it see the CI-1?

Click to enlarge
 [ You are not allowed to view attachments ]
Nope, no luck there

I figured as much would happen but it was worth the shot. Now came the "fun" part. Previous study from years ago when I identified a bug in both RailPro Assistant and HC Simulator  that prevented the CI-1 and HC-2b from being detected by RailPro Assistant and HC Simulator on some computers I knew how they both got the information they needed to locate and use the CI-1 and HC-2b. This information was in the Windows Registry and was called from a Windows DLL file.  I'd have to duplicate this registry information into Wine manually and hope that the Wine version of that Windows DLL file implemented the functions needed to retrieve the information. Starting off in the Windows Registry I'd had to find where all this information relevant to the CI-1 and HC-2b was. Thankfully that previous knowledge came in handy again. Knowing that USB devices have a vendor id and product id and knowing what they were I was about to search quickly for them.

 [ You are not allowed to view attachments ]
One of the registry entries for the CI-1

One thing to note about this is that for every different port you plug the same USB device into an entry is created in the registry for it. You can see that I've had the CI-1  plugged into different ports over time. Because there are entries in different places of the registry and the different entries are tied together I'd have to find which entries matched which. In the beginning I did not do this and just duplicated all the entries for the CI-1 and HC-2b (or so I  thought) but this was not a good approach and it was messy and didn't work. After some more research to work out how the entries were tied together I redid the exercise methodologically and made a registry file each for the CI-1 and HC-2b that I could import into Wine.

Registry file for the CI-1
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{4d1e55b2-f16f-11cf-88cb-001111000030}\##?#HID#Vid_04d8&Pid_f321#6&24b60e9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}]
"DeviceInstance"="HID\\Vid_04d8&Pid_f321\\6&24b60e9&0&0000"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{4d1e55b2-f16f-11cf-88cb-001111000030}\##?#HID#Vid_04d8&Pid_f321#6&24b60e9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\#]
"SymbolicLink"="\\\\?\\HID#Vid_04d8&Pid_f321#6&24b60e9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f321\6&24b60e9&0&0000]
"Capabilities"=dword:000000e0
"UINumber"=dword:00000000
"ConfigFlags"=dword:00000000
"HardwareID"=hex(7):48,00,49,00,44,00,5c,00,56,00,69,00,64,00,5f,00,30,00,34,\
  00,64,00,38,00,26,00,50,00,69,00,64,00,5f,00,66,00,33,00,32,00,31,00,26,00,\
  52,00,65,00,76,00,5f,00,30,00,30,00,30,00,32,00,00,00,48,00,49,00,44,00,5c,\
  00,56,00,69,00,64,00,5f,00,30,00,34,00,64,00,38,00,26,00,50,00,69,00,64,00,\
  5f,00,66,00,33,00,32,00,31,00,00,00,48,00,49,00,44,00,5f,00,44,00,45,00,56,\
  00,49,00,43,00,45,00,5f,00,55,00,50,00,3a,00,46,00,46,00,30,00,30,00,5f,00,\
  55,00,3a,00,30,00,30,00,30,00,31,00,00,00,48,00,49,00,44,00,5f,00,44,00,45,\
  00,56,00,49,00,43,00,45,00,00,00,00,00
"CompatibleIDs"=hex(7):00,00,00,00
"ClassGUID"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}"
"Class"="HIDClass"
"Driver"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\\0011"
"Mfg"="(Standard system devices)"
"DeviceDesc"="HID-compliant device"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f321\6&24b60e9&0&0000\Device Parameters]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\Vid_04d8&Pid_f321\6&24b60e9&0&0000\LogConf]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_04d8&Pid_f321\5&269a58e2&0&8]
"DeviceDesc"="USB Human Interface Device"
"LocationInformation"="CI-1"
"Capabilities"=dword:00000084
"UINumber"=dword:00000000
"HardwareID"=hex(7):55,00,53,00,42,00,5c,00,56,00,69,00,64,00,5f,00,30,00,34,\
  00,64,00,38,00,26,00,50,00,69,00,64,00,5f,00,66,00,33,00,32,00,31,00,26,00,\
  52,00,65,00,76,00,5f,00,30,00,30,00,30,00,32,00,00,00,55,00,53,00,42,00,5c,\
  00,56,00,69,00,64,00,5f,00,30,00,34,00,64,00,38,00,26,00,50,00,69,00,64,00,\
  5f,00,66,00,33,00,32,00,31,00,00,00,00,00
"CompatibleIDs"=hex(7):55,00,53,00,42,00,5c,00,43,00,6c,00,61,00,73,00,73,00,\
  5f,00,30,00,33,00,26,00,53,00,75,00,62,00,43,00,6c,00,61,00,73,00,73,00,5f,\
  00,30,00,30,00,26,00,50,00,72,00,6f,00,74,00,5f,00,30,00,30,00,00,00,55,00,\
  53,00,42,00,5c,00,43,00,6c,00,61,00,73,00,73,00,5f,00,30,00,33,00,26,00,53,\
  00,75,00,62,00,43,00,6c,00,61,00,73,00,73,00,5f,00,30,00,30,00,00,00,55,00,\
  53,00,42,00,5c,00,43,00,6c,00,61,00,73,00,73,00,5f,00,30,00,33,00,00,00,00,\
  00
"ClassGUID"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}"
"Class"="HIDClass"
"Driver"="{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\\0010"
"Mfg"="(Standard system devices)"
"Service"="HidUsb"
"ConfigFlags"=dword:00000000
"ParentIdPrefix"="6&24b60e9&0"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_04d8&Pid_f321\5&269a58e2&0&8\Device Parameters]
"ExtPropDescSemaphore"=dword:00000001
"SymbolicName"="\\??\\USB#Vid_04d8&Pid_f321#5&269a58e2&0&8#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_04d8&Pid_f321\5&269a58e2&0&8\LogConf]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\0010]
"InfPath"="input.inf"
"InfSection"="HID_Inst"
"InfSectionExt"=".NT"
"ProviderName"="Microsoft"
"DriverDateData"=hex:00,80,62,c5,c0,01,c1,01
"DriverDate"="7-1-2001"
"DriverVersion"="5.1.2600.5512"
"MatchingDeviceId"="usb\\class_03"
"DriverDesc"="USB Human Interface Device"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}\0011]
"InfPath"="input.inf"
"InfSection"="HID_Raw_Inst"
"InfSectionExt"=".NT"
"ProviderName"="Microsoft"
"DriverDateData"=hex:00,80,62,c5,c0,01,c1,01
"DriverDate"="7-1-2001"
"DriverVersion"="5.1.2600.5512"
"MatchingDeviceId"="hid_device"
"DriverDesc"="HID-compliant device"

I imported the registry entries into Wine and called the "fun" part of the exercise done. Will we be successful with HC Simulator being able to detect the CI-1 now?

Click to enlarge
 [ You are not allowed to view attachments ]
Still no luck

At this point I figured that those dll functions that were needed weren't implemented in the wine version of the dll file. As I had run a debug trace on that dll while HC Simulator loaded when I checked the debug output I could see that the calls were being made and the information from the registry was being loaded. So what could be wrong? Some more research picked up a clue hidden away in a single blog post from years ago. With Wine there are three ways to detect HID devices; hidraw, evdev and SDL. The blog post was from a user who was seeking help on a game being broken by a Wine update. The solution was to disable SDL as it was being used as the default detection method since the update, which stopped the game working. After disabling SDL the game worked again.

Click to enlarge
 [ You are not allowed to view attachments ]
Disabling SDL in the Wine registry


Running HC Simulator again we have a Winner!!!

Click to enlarge
 [ You are not allowed to view attachments ]

But does it work?

Click to enlarge
 [ You are not allowed to view attachments ]
Throw your arms in the air and say yes! We can control RailPro devices.

With the CI-1 worked out and working, what about the HC-2b? After unplugging the CI-1 and plugging in the HC-2b and passing it to the VM running the dmesg and lsusb commands again gives us the same device identifier in Linux, hidraw1. Because we created a new hidraw1 device we need to change the permissions on it as we did for the CI-1. Loading up RailPro Assistant the HC-2b is detected so it was time for the big test, selecting a file to download would the HC-2b download the file?

Click to enlarge
 [ You are not allowed to view attachments ]

The file downloaded to the HC-2b without any problems.

Next in Part 3, The HC-1, the old HC-2 and wrapping the experiment up.

- Tim

45
Part 1: Introduction, the install and first tests

Obligatory disclaimer

This is not a step by step how-to but rather a commentary of the experiments journey. I don't think I've missed anything in the steps taken that doesn't affect the outcome but I've not included any links etc as it's not supposed to be a step by step how to.
. . .
Ok, so why?

Given it seems the there will not be native versions of RailPro software for Linux and Mac anytime in the foreseeable future, and I had a lot of time on my hands due to the Covid-19 pandemic I decided to do some experimentation. I've done experimentation on running RailPro software on alternate operating systems before, both with Wine on Linux and ReactOS but these were failures; Wine had no support for HID devices and ReactOS is based on a version of Windows that RailPro software no longer runs on (I could possibly workaround for that but that's another day).

What started this round of experiments was finding out Wine had come a long way since those early days experiments and now had support for HID devices. I had to try it! For this experiment I ran a 32bit version of Lubuntu (based on Ubuntu 18.04) in a virtual machine (VM) on a old host with not much RAM. By far not the best setup but it's all I had to work with at the time.
. . .
The experiment begins...

After setting up Lubuntu in the VM and updating everything I started the journey. Visiting the download page for Wine at WineHQ, the first thing I had to do was to find out which version of Ubuntu my installation of LUbuntu was matched to so I could download the correct version on Wine.

 [ You are not allowed to view attachments ]

After a little bit of mucking around I found out the version and started the installation process.

In the Lubuntu terminal I downloaded and added the repository key for Wine.

Code: [Select]
wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -

and then added the apt repository for the correct Ubuntu version for my copy of LUbuntu.

Code: [Select]
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'

A note at the top of the installation page mentioned that the version of Wine I needed to use required some extra packages that they didn't include so I had to download them separately. Given the choice of two ways to do this I opted to add the repository to Apt the same way as for Wine.

After updating the packages in apt we can then install Wine. For this I chose the stable branch (there is also the development and staging branches, which for non techies basically means beta), also installing the recommend packages.

Code: [Select]
sudo apt install --install-recommends winehq-stable

After this Wine should be ready to go. I had already downloaded the installers for RailPro Assistant and HC Simulator to the desktop. As they were automatically associated with Wine it was just a matter of double clicking the installers.

 [ You are not allowed to view attachments ]
 [ You are not allowed to view attachments ]
Well not quite ready to go

When first run, Wine will update it's prefix (configuration). It's at this point some not so well written words made me do the opposite of what I should have done. Wine will look for a couple of packages (Gecko and Mono) and after not finding them ask if it should fetch and install them. According to the installation guide at the WineHQ website you should answer YES here. The way I read the wording in the messagebox made me select no. This resulted in me having to install them later after working out which versions of each I actually needed; another not straight forward exercise because it wasn't specified anywhere.Once the prefix is updated the installation will continue.

Click to enlarge
 [ You are not allowed to view attachments ]
Looking good. You can ignore the admin notice and just click YES, Windows administrator permissions don't matter here

Click to enlarge
 [ You are not allowed to view attachments ]
Installation Done!

Will it run? Yes it does, and is connected to the Internet too!.

Click to enlarge
 [ You are not allowed to view attachments ]

Ok, so it wasn't quite that simple. When I first ran it Railpro Assistant didn't connect to the internet. I had forgotten to change the network adapter type in the VM from NAT to Bridge. For some reason RailPro Assistant doesn't work in NAT mode. I spent more  minutes than I'd like to admit pondering why it wouldn't connect in Wine before I remembered about the network adapter in the VM So, with RailPro Assitant able to connect to the internet it was time to see if RailPro Assistant could see HC Simulator when it was running.

Click to enlarge
 [ You are not allowed to view attachments ]
Success!

Being quite pleased at this point it came to the first real test; can we download anything?

Click to enlarge
 [ You are not allowed to view attachments ]
Yes we can!

More success. Knowing how RailPro Assistant and HC Simulator communicate to each other this was a pretty big deal to see this work right off the bat running in Wine. So we had gotten Wine installed and confirmed that the software runs in Wine. We we're off to a good start. Next in Part 2; The CI-1, the HC-2b, and getting them working

- Tim

Pages: 1 2 [3] 4 5 ... 52