EMerlin Repeater Station PC (RPC)

P. Burgess, Jodrell Bank Observatory 05/Feb/2004 (V1.3) Last Revision: 2008-10-13 v2.0 new OS

1.Introduction.

The Repeater PC is a straightforward ‘minimal’ PC for monitoring eMerlin fibre- optic repeater stations. It is intended normally to be accessed by dial-up modem. A local keyboard and display is provided. The unit operates under the Linux . This document provides sufficient information to rebuild a system from scratch, although normally it will be provided set up.

2. Design Requirements:

• Support Linux and dial-up modem, plus additional serial ports. • Provide simple on-site display and keyboard • Low cost and maintenance • Sustainable upgrade path to hardware changes

These requirements may be met by a simple combination of off-the-shelf motherboard, CPU and memory components. Although very small single-board PCs are available, space is not at a premium, so a commercial 4Ux19in. rack mount case has been chosen. This case includes a keyboard and VGA (640x480) colour display. The additional cost of this hardware (most of the cost of the complete unit in fact) is justified by convenience and robustness. Jodrell VLBI has experience with Asus motherboards and AMD CPUs and finds them well-supported. We have attempted to select devices with known Linux compatibility.

Choice of Modem: There is a problem using internal modems under Linux. Most internal cards are now so-called ‘Winmodems’, i.e. they have minimal (or no) controller hardware, and requires Windows to replace it. There are a small number of devices which do have internal hardware, usually known as ‘Linmodems’,which have drivers, or may be configured, for Linux. After a series of tests we found the Sitecom DC-015 56kbps internal V92 (www.sitecom.com) modem to be reliable.

3. Software Requirements

The requirement is for both operating system and user software to be maintainable by ourselves at minimum cost. At the moment Jodrell has adopted the Linux system for its outstation control work as it is open-sourced, robust and predictable and does not incur license fees.

There are numerous ‘distributions’ of Linux available with quite widely varying levels of detail changes. We require a simple, easily-maintainable one that is likely to be around in some form in the future. The system was selected for its long- term stability, easy package installation, and familiarity. Current release is 'Etch'.

4. Component Specifications

Rack Case 4U - Wordsworth EC-1040BATX/832AP wit DM64T display and Main Board - Asus A7N266VME-SE skt A incl. Ethernet Realtek 8201 PHY Nvidia AGP graphics CPU - AMD XP-1800+fan Memory - 256 Mbyte generic DDR SDRAM module Modem - ‘Sitemodem’ DC-015 internal PCI card Hard Drive - 40Gb Maxtor IDE in rack carrier module Cdrom - Samsung internal IDE OEM

5. General Assembly The ATX motherboard installs directly in the rack case. Our version had a slight misalignment between the rear panel opening and the metal plate insert supplied with the motherboard, fixed by slicing one end off the panel.

The DM640T (TFT) colour display is designed to fit directly into the left side of the front panel. The supplied VGA cable is used to pass the display connector to the lower rear panel. The connection between the VGA input and and the motherboard video output is completed by a JB-made 15-to-15 way VGA-D connector about 30cm long.

The hard drive was installed in a low-cost sliding module rack (Samcheer SC27) in the upper 5-1/4 drive bay space, connected to IDE 0 (master). The cdrom then fits in the middle bay (connect to IDE1), leaving the lowest bay free. The drive jumper should be set to ‘CS’ (Cable Select) for both units – default. (nb some units may be configured with the CD as ‘master’ and the drive as ‘slave’ – check if changing the drives).

The modem is located in PCI Slot 2 (centre white slot) The Vscom serial card should be in Slot 3 (outer / furthest from PSU). Slot 1 (nearest PSU) and the brown AGP slot are unused.

The integral keyboard and ‘mouse’ touchplate are connected via included mini-DIN (PS/2 style) connectors to the motherboard at the rear panel. There may be a couple of spare ‘sensor’ cables in the case: they may be tied out of the way. Some units were later fitted with a third 9-pin serial port connector on one of the previously-unused card slots, which allows access to the second onboard Com port (Com2/ttyS1). The 25-connector is not used, but could be internally reconnected in place of the 9-pin if needed. 6. Initial Testing

Power-up should be performed, checking for correct fan operation and display illumination. The display will normally attempt to configure itself but there is an auto/ manual option on its menu. Check that the BIOS detects the hard drive,floppy drive (if fitted) and cdrom correctly. Power-down again.

7. Installation of Linux Operating System

This section describes a ‘from scratch’ installation and may not be needed if an existing system can be copied (See Section 13). Currently we use Linux 9.1, requiring 2 CD’s.

BIOS Settings (required) : (Hit ‘Del’ during startup)

(a) ‘Audio’ on-board device set to ‘disabled’ under ‘Chip Config’ menu. (b) ‘MIDI’ port and irq disabled under IO submenu. (Frees up an irq) (c) PCI submenu: set Slot 3 (Vscom board) to IRQ 11; others on ‘auto’ (d) If the USB is not required, it may be disabled under ‘IO’ submenu. (e) Plug-and-Play OS: select ‘No’. (f) Virus Alert: Select ‘Disabled’

Download the Debian Etch Linux installation ISO CD images from a Debian mirror on the Web. The 'netinstall' CD is the best way provided a network connection is available. An ISO image will be placed on newton:/usr3/projects/Repeater. Make a CD’ using ‘Nero’ on the VLBI Windows PC or 'Brasero' (Linux) Boot the RPC with Etch netinstall in CD drive -The install is straightforward: ChooseUS english and keyboard The install should find a DHCP ip address Supply domain 'ast.man.ac.uk' Choose default 'guided' disk partitions with separate 'home' area. Choose a local mirror site (eg ftp.uk.debian.org) For System Type choose 'Standard'; deselect 'Desktop' a minimum non-X system will be installed Accept 'save grub to MBR'

7.1 Updating the Kernel

With the current default kernel options, the modem control driver cannot be loaded. The image, headers and source are updated – see Appendix 3

8. Configuring Linux

Debian install finds all the components, including the video and network drivers. (An 'X' system can be supported if it is installed)

8.1 TFT Display and Xwindows

The unit normally runs remotely or requires only console access. A simple ‘X’ configuration could be available for a 15in. external display or the TFT, although the latter is difficult to use under ‘X’. Debian install 'gnome'.

9. Install and Configure Modem Driver

9.1 HSF Modem Driver (Conexant Chipset)

Download the free ‘HSFModem’ package from linuxant.com

See: http://www.linuxant.com/drivers/hsf/downloads-license.php File: hsfmodem-7.18.00.03full.tar.gz

Download the Debian install package, unzip the '.deb' installer. The kernel image, headers, and extra tools must have been installed, which is easy via 'apt-get': see Appendix 3

Cd to the new directory ‘HSFmodemxxxx..’ Install the driver with 'dpkg -i hsfmodem_.deb Perform the initial configuration stage (hsfconfig: UK) Check that a new device in /dev/has appeared (‘/dev/ttySHSF0’) Check for ‘modem’ link: ls –ls /dev/modem Reboot; 'lsmod' should show two or more 'hsfxxx' modules. To uninstall do ‘make unistall’ in the hsfmmodem source directory

9.2 ‘mgetty’ TTY Driver

Download the latest ‘mgetty’ TTY driver for Linux (mgetty-1.1.3?)

See ftp://alpha.greenie.net/pub/mgetty/source/.

Installation is very easy: 'apt-get install mgetty' Make a new line in ‘/etc/inittab’ to initialise ‘mgetty’. (See Note 2 below) Reboot and use ‘ps ax’ to check an ‘mgetty’ process is active. (See Note 3)

9.3 Testing Dial-Up

Test the modem by dialling and logging-in. Provided the ‘ps ax’ display is correct, this system is robust, and any problems are likely to be due to connecting cables.

Any PC, laptop or PDA equipped with a standard dial-up modem may be used to test dial-up. The other PC may use either a dedicated terminal program or Windows Hyperterminal with manual dialling: see the user’s manual for the PC to be used.

Notes: i. The free ‘Linuxant’ drivers are limited to 14400 baud. If 28000 baud is required it is necessary to purchase a license from Linuxant for each site (at relatively low cost). ii. Example (useable) ‘inittab’ line for ‘mgetty’:

# Dialup lines: #d1:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS0 vt100 d1:23:respawn:/usr/local/sbin/mgetty -s 115200 -p"@ login: " /dev/modem

( - the first line is an example included in the default file).

There are a series of config files provided, however these are overridden by the command line parameters in the ‘inittab’ entry. The ‘sendfax’ options are not used and may safely be ignored. iii. Example ‘ps ax’ report for ‘mgetty’:

731 ? S 0:00 /usr/local/sbin/mgetty -s 115200 -p@ login: /dev/modem

- once this line is present in the ‘ps ax’ output the system is usable and should be robust. iv. Linux maintains logs in /var/log: see ‘mgetty.modem’ and ‘syslog’ for relevant entries. v. The modem follows the Hayes command set, which is widely documented. It is possible to use ‘kermit’ to talk directly to it and test it if nececssary. vi. The current configuration does not support ‘ppp’ dialup, only direct serial terminal access. vii. The modem should not be set to ‘auto-answer’ as ‘mgetty’ performs this function. The default mgetty ‘init’ will correctly set the auto-answer off. vii. Modem Init: The Hayes ‘AT’ commands apply. The ‘init’ string sent to the modem is defined in /usr/local/mgetty/policy.h and is generic. The minimum case of factory reset (AT&F) may well be adequate.

10. Additional Serial Ports

There are two ports available on the motherboard, which will be configured as ttyS0 and ttyS1 under Linux (Corresponding to com1 and com2). The 9-pin connector for ttyS0 is located on the motherboard connector panel. The second port (ttyS1) is a small header on the motherboard next to the outer PCI slot (Slot 3). A standard serial i/o panel may be mounted on one of the rear case locations and connected to this header (Pin 1 toward the rear of the unit).

Additional ports may be provided by installing a PCI card. The ‘Vscom PCI-200L’ two-port card is readily available at low cost and supported in terms of Linux drivers and documentation. Boards with more ports are available. Usually ttyS2 is the upper 9-pin connector and ttyS3 the lower. (See the cdrom included with the card, and further notes below).

Debian with the 2.6 kernel will find and set up all four ports itself. Checks:

(a) dmesg | grep ttyS* - should report ttyS0-ttyS3

(b) As root, set the permissions for the new ports: chmod a+rw /dev/ttyS2(3).

Check also /proc/tty/drivers/serial and /proc/interrupts

NB: It may be necessary to set the same permissions for /dev/ttyS)/1

Ref. Vision Systems, various Linux-compatible I/O boards:

http://www.visionsystems.de/produkte/462.html

Note 1: This board may be of the same family sold as a ‘Byterunner’ in the U.S. and elsewhere.

Note 2: The Vscom CD/Website has a kernel patch available which should be applied to make maximum use of the board’s functions. It is not supposed to be necessary for operation.without specialised settings.

Note 3: A DOS floppy with the ‘vsshow’ utility from Vscom will verify/check port settings. Use the BIOS settings given above for the Vscom IRQ setting.

Note 4: Testing: There is a standalone program call ‘vslxtest’ which can be searched and downloaded (.tgz file). This allows simple checking of the UARTS. Unfortunately it is linked to ‘libncurses.so.4’ which is not current. Quick fix: find the current ‘ncurses.so.X’ in /lib and make a soft link:

ln –sf libnurses.so.4 libnurses.so.X (where ‘X’ is your version).

− Normally it isn't necessary to use this test. A quick check is to inspect /proc/tty/driver/serial which holds current port information.

11. General Notes and Refs: a. Multiple kernel options and delays may be removed from/boot/grub/menu.lst, although not really necessary to do so. b. Using network connections: The system has secure shell access only. From another machine, try ssh then supply username/password. c. Kernel re-build: Debian does not usually need this, just see Appendix 3 for image, headers and source installation via apt-get.

Reboot, but keep a good kernel. Image Reinstall drivers. Remove old versions with ‘make clean’ first .

12. Using the Unit with Serial Devices (‘kermit’).

For the eMerlin Repeater sites communication to the receivers is via the RS232 serial port(s) as described above. The ‘kermit’ serial communication program from Columbia University provides a convenient way to talk to such external devices.

12.1 Installing ‘kermit’ (if not present)

Locate and download the ‘C-kermit’ source archive from Columbia at http://www.columbia.edu/kermit/ck80.html#source - the current package is called ‘cku211.tar.gz’. (Choose the ‘tar.gz’ version). Copy the package as root into /usr/local/kermit (make the ‘kermit’ directory manually first).

Untar the package: tar –xzpf cku211.tar.gz Type ‘make linux’ The package should compile in a couple of minutes or less.

The executable is called ‘wermit’ at the moment. Exit root, and as user, make a link in your home directory (ln –s /usr/local/kermit/wermit kermit) renaming the link to ‘kermit’ for convenience.

12.2 Running ‘kermit’

Execute kermit by typing it. The prompt should appear. A’?’ will provide a list of help keywords.

Set the port: set port /dev/ttyS0 (assuming ‘com1’ is being used). Set speed: set baud 9600 Set protocol set serial 8n1 set flow xon/xoff set duplex full set handshake none set carrier-watch off

- The necessary commands may be placed in a file called ‘.kermrc’ in the user’s directory (note the leading ‘.’ which makes it invisible to the ‘ls’ command). See the Web for extensive ‘kermit ‘ documentation; note they may need to change for some serial functions.

The command ‘show comm’ will return kermit’s present comms setup. Check that the correct tty device is showing.

When the port is correctly set up, connect to the remote device with ‘c’. It remains connected until an escape sequence (usually ctrl’/’-c or ctrl'[] -c) . Exit ‘kermit’ with ‘bye’, ‘quit’ or ‘exit’.

13. Simplified Installation Procedure

It is intended eventually to provide a built kernel image. The proposed installation will be a matter of copying a configured system from a template hard disk to a new one using the Linux ‘dd’ utility.

Procedure: (Requires a PC, an RPC system and a TomsRtBt floppy).

Mount an identical (or possibly a larger) hard drive in one of the ‘SC27’ plastic disk carrier modules.

Using dual-disk PC, shut down and insert master and blank disk cartridges.

Insert an existing RPC system drive into the upper carrier and the new drive in the lower carrier.

Insert the ‘TomsRtBt’ Linux floppy disk into the floppy drive and reboot. Whilst rebooting check that the BIOS has detected the two new drives and that TomsRtBt sees them as hda and hdb. Login as ‘root’, password ‘XXXX’

Start the copy process using the Linux ‘dd’ comand:

dd if=/dev/hda of=/dev/hdc bs=1024k

Take care that the parameters are correct before hitting ‘return’. The disk access lights should both flicker. The process will take some time, usually around 45 min to one hour. The console prompt will return to ‘#’ when finished. Usually the screen saver will have blanked the screen.

Power-down the machine and replace the original drives, reboot. Test the new cloned disk in the RPC system. Label the new carrier with the serial number of its host and place a blank modification label on the drive itself. Date the label.

14. Software Upgrades It is not envisaged that system software upgrades will be required for this PC, however if it does become necessary then the procedure described in this document for installing Linux should be followed. The Debian distribution remains the preferred one.

The user/home data areas have been configured on their own partition to allow a new system to be installed in the root partition without affecting them. The suggested procedure is to rename the individual directories, e.g. rn /home/oper /home/old_oper. Then after re-installation copy the contents of these directories into the new ones, leaving the old ones as backups. Do this as root, and set the user permissions – see man chmod and man chown:

chown –R /usr2/oper oper chmod -R og+rw /usr2/oper

15. Simple Troubleshooting.

System won’t boot from hard drive – check drive jumpers and location of sliding disk carrier. Check key is turned on. Check BIOS ‘sees’ drive during bootup. If boot fails partially, use 'TomsRtBt' to recover.

Boots but give ‘mgetty’ ‘respawning’ error – Modem device has not been found by the drivers. Probably due to BIOS IRQ settings not being correct: see Section 7. Note: If the bios battery (CR2032 coin cell) has gone flat, this may occur.

Can’t connect to external COM device: Make sure the correct Linux port designation is being used: COM1 (on motherboard) is ‘dev/ttyS0’ ; COM2 (internal MB) is ‘/dev/ttyS1’ and COM3/4 are ‘/dev/ttyS2/S3’. Check RW permissions on ports. Ensure the remote device is wired and set up correctly.Check device in .kermrc

Mouse pad and/or keyboard not working: check rear jumper cables have not come loose. Reboot if not detected.

Vscom ports not working: Check correct lines are in /etc/serial.conf as above and are not commented-out. Check the BIOS IRQ is set correctly. Do the four ports show up at the end of the bootup screens? (Use 'dmesg | more')

Appendix 1

VSCom Serial Connector Pinouts:

Pin No. Function Pin No. Function 1 DCD (Data Carrier Detect) 6 DSR (Data Set Ready) 2 RX (Receive Data) 7 RTS (Request To Send) 3 TX (Transmit Data) 8 CTS (Clear To Send) 4 DTR (Data Terminal Ready) 9 RI (Ring Indicator) 5 GND (Signal Ground) - Note: Implementation depends on OS/software: usually pins 2,3,5 only are used. Rarely, some hardware may require DCD or CTS/RTS handshaking. The data output (pin3) will normally be at -12V.

Appendix 2:

E-Merlin Repeater Station PC - VGA Extension Connector Wiring.

Type: 15way HD 'D' connector M-->F 30Cm in length.

Pin # Signal Name 1 Red 2 Green 3 Blue 4 NC 5 GND 6 GND 7 GND 8 GND 9 NC 10 GND 11 NC 12 DDC Data 13 H Sync 14 V Sync 15 DDC Clock

Wired pin for pin Eg. 1 --> 1 etc.

Appendix 2: Add-On device packages:

‘Sitecom’ DC-015 Internal PCI Modem with Conexant Chipset. (Dial-up connection cable is included). Appendix 3: Additional Installation Notes -

Debian Etch 32 install on eMerlin Repeater (emrpc) Mon 13 Oct 2008 11:05:59 BST

Debian Etch - new repeater install Minimal system - UK English Use mirror (ftp.uk.debian.org) Select 'standard' only; deselect 'desktop' Standard VLBI passwords grub install to MBR Reboot OK

Network DHC OK. apt-get install joe ; cp jstarrc joerc Remove cdrom from /etc/apt/sources.list apt-get install ssh login from desktop (easier)

Inst. 2.6.18-6-86 dmesg|grep ttyS0 shows all 4 tty's. chmod a+rw /dev/ttyS0(1/2/3) apt-get install linux-image-2.6.18-6-k7 apt-get install linux-headers-2.6.18-6-k7 apt-get install linux-source-2.6.18 cd /usr/src ; tar -xjpf linux-source-2.6.18 ln -sfn linux-source-2.6.18 linux reboot - correct kernel; OK apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential dpkg -i hsfmodem_7.68.00.14full_i386.deb hsfconfig (supply 'UK', email, accept FREE) Installed ok it seems: lsmod shows many hsfc modules kelvin:/usr2/oper/:> scp /usr/bin/kermit [email protected]: cp kermit /usr/bin/ emrpc:/home/oper# chmod a+x /usr/bin/kermit scp oper@kelvin:.kermrc . apt-get install mgetty - OK Edit into inittab (end): d1:23:respawn:/sbin/mgetty -s 115200 -p"@ login: " /dev/modem

Reboot. hsf modules look OK; ps ax looks OK; mgetty OK (good minimal system) Comms Tests: Belkin 9 to 25 way serial cable from ttySn to 25-way 'spare' port on kelvin mux unit, requires gender-changer. kelvin kermit to ('spare') port 8 ; emrpc kermit to port n (for n= 0 to 3) cat /proc/tty/driver/serial 0: uart:16550A port:000003F8 irq:4 tx:95 rx:0 1: uart:16550A port:000002F8 irq:3 tx:0 rx:0 2: uart:16550A port:0000C000 irq:177 tx:0 rx:0 3: uart:16550A port:0000B800 irq:177 tx:0 rx:0

Run kermit on both machines: enter chars, they appear on other machine; as root and as 'oper'. -All 4 ports are OK kelvin:/usr2/oper/:> cat .kermrc rem 081013 PB start ttyS9 test. set line /dev/ttyS9 set speed 9600 set carrier-watch off set serial 8n1 set duplex full set handshake none set flow xon/xoff connect

End of Document.