User Tools

Site Tools


lenz-static-linux-nl

Lenz

InhoudCentral Stations


Static method (install driver at boot time)

This method is proven to work with openSUSE 11.1.

You need to modify the file rocrail.ini. However, when you are new to Rocrail, you do not yet have a file rocrail.ini. First start the rocrail server. This will create a directory rocrail in your home directory. Then start the rocview client. You should now have a number of files in your rocrail directory, but no rocrail.ini yet. Now select File → Rocrail Properties from the main menue bar at the top of the client window. This should open a dialog window. At this stage, do not worry about the many tabs it offers you, simply press OK. This now generates the rocrail.ini file in your rocrail directory. Next Shutdown Rocrail and exit.

Now that we have got the rocrail.ini file, we use an editor to replace the following line:

<digint lib="virtual" iid="vcs-1" stress="false" libpath="/opt/rocrail"/>

with the new line:

<digint iid="lenz-1" lib="lenz" sublib="usb" device="/dev/ttyUSB0"/>

Please note the /dev/ttyUSB0 may have to be changed to point to the actual device, if you have other USB devices connected. However, you cannot verify at this stage, therefore we leave it for now as is.

In the interface box, Lenz use a chip from Future Technology Devices International, Ltd. That chip works with the driver ftdi_sio. However, when the interface is plugged in, the driver is not loaded automatically, because the kernel does not know the Lenz product ID. Based on http://forums.opensuse.org/hardware/395149-ftdi-usb-serial-adapter-unknown-vendor-device-id.html do the following:

Use an editor to modify the file /etc/sysconfig/kernel such that the driver ftdi_sio gets always loaded at boot time. You will have to do this as root. The only change you need to make, is insterting ftdi_sio in between the "", as shown in the following extract of /etc/sysconfig/kernel.

## Type:		string
## ServiceRestart:	boot.loadmodules
#
# This variable contains the list of modules to be loaded
# once the main filesystem is active
# You will find a few default modules for hardware which
# can not be detected automatically.
#
MODULES_LOADED_ON_BOOT="ftdi_sio"

Now you also need to make sure the driver knows about the vendor and procut ID of the Lenz interface, by adding that data to the file /etc/modprobe.conf.local . Again, you can do this as root by using an editor. This is what an example modprobe.conf.local looks like:

#
# please add local extensions to this file
#
options ftdi_sio vendor=0x0403 product=0xd780

The above vendor and product id are the ones my interface came with. This should in theory be the same for all the Lenz boxes.

Lenz may have shipped some with dummy values of vendor=0x1111 and product=0x1234. You can find out the values of your box by connecting it and typing lsusb, e.g:

hans@Taurus:/> lsusb
Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 004: ID 0403:d780 Future Technology Devices International, Ltd
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 046a:0050 Cherry GmbH
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 0c4b:0100 Reiner SCT Kartensysteme GmbH cyberJack e-com/pinpad
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
hans@Taurus:/>   

Having done all of the above, you will find that rocrail still cannot talk to the Lenz interface. This is because the device /dev/ttyUSB0 is created with rw permissions for root and goup uucp only. Ordinary users do not have permission. Therefore, you need to make your users who want to use rocrail, a member of the group uucp.

You can do this e.g. in yast with Security and Users → User and Groupmanagement → double click on the user you want to add → Details → check the box for uucp on the right (you may have to scroll down to see uucp). Finish by clicking OK twice.

Now

  • reboot your machine
  • plug in the interface and switch on the power to your Lenz equipment
  • check in the /dev directory that ttyUSB0 is the correct device. It may be ttyUSB1 or so, if you have other devices connected to your USB. If needed, modify your rocrail.ini file to point to the correct device.
  • start the rocrail server
  • start rocview
  • go to Tables → Locomotive table… and create a new locomotive table
  • the new locomotive table will appear above the clock - double click on it
  • don't forget to switch on the power using Control → Power on
  • and hopefully you're off running your first loco !!!!!!
lenz-static-linux-nl.txt · Last modified: 2018/11/12 08:56 by 127.0.0.1