elec:testgear:hp16500b:rc

# Remote-controlling the HP 16500B

The 16500B includes both FTP and NFS servers, and an X11 client interface. This allows it to be remote-controlled from the “UNIX workstations of old”, and more modern Linux systems.

This is easy.

1. Power up the 16500B, then select Communication on the main screen.
2. Set “Controller Selection” to “Ethernet”
3. Press “Ethernet” under the “Configuration” banner.
4. Give the analyser an IP address on your local LAN. The machine only supports static IP addresses, and you can't change the subnet mask either (as far as I can tell). To set the IP, press the “Internet Address” button. A dialog will appear with four buttons – one for each part of the IP address. Press each one in turn, then enter the digits for that section. Once you've entered all four parts, press Done.
5. You can also set the Gateway Address and timeout under the Advanced Settings menu. Leave the timeout at the default (1.5 seconds), but set the Gateway Address.

Now you can connect the 16500B to your LAN. If you have the 16500H LAN interface in your 16500B mainframe, you'll have a 10BaseT twisted-pair (RJ45) connector. That is to say, a standard Ethernet jack. This can be plugged into any normal Ethernet hub or switch with a straight-wired Cat5 cable, or into a PC with a crossover cable.

The 16500L operates similarly, but requires an AUI transceiver to interface between the analyser and the network. I'm using a HP 28685B “EtherTwist” twisted-pair (10BaseT) transceiver, which is the transceiver suggested in the 16500L documentation.

To access the analyser, tell your FTP client to connect to the analyser's IP address, on port 21 (the default FTP port). You need to tell your FTP client not to make multiple connections to the analyser, otherwise the analyser WILL crash. To do this in Filezilla, enable “limit number of simultaneous connections”, and set “maximum number of connections” to 1.

There are two valid usernames on the system:

• control: Allows full read and write access to the analyser, and instrument control. Only one 'control' user may be connected at a time.
• data: Allows read-only access to the instrument status/control files, and read/write access to the hard and floppy disc drives.

Neither of these usernames have a password set, nor can one be set. Usually you'll want to connect as “control.”

See the 16500H / 16500L manual, and the relevant plug-in card programming manuals for more information on the files in the FTP share.

This isn't too difficult either – but you need to bear in mind that the NFS server on the HP16500B will only be accessible as UID 0/GID 0 – i.e. root. This is hardly ideal… You may be able to use uid 65534 / gid 65534 as well, though I haven't tested this.

First you need to install nfs-common:

sudo apt-get install nfs-common

Then you can mount the data export on the analyser:

sudo mkdir /mnt/work
sudo mount <analyser IP>:/data /mnt/work -o nfsvers=2

Now you can do all manner of weird and wonderful things to the analyser, but only as your machine's local root user…

sudo ls -la /mnt/work
total 3
dr-xr-xr-x 7 daemon daemon 894 2010-02-13 22:18 .
dr-xr-xr-x 2 daemon daemon 638 2010-02-13 22:18 slot_d
dr-xr-xr-x 3 daemon daemon 766 2010-02-13 22:18 slot_e
dr-xr-xr-x 2 daemon daemon 766 2010-02-13 22:18 status
dr-xr-xr-x 4 daemon daemon 894 2010-02-13 22:18 system

sudo cat /mnt/work/status/mount.txt
Analyzer name: LOGIC ANALYSER

Hostname                         UID     GID      Directory
========                         ======  ======   =========
cheetah                           00000   00000   /data

sudo cat /mnt/work/status/frame.txt
Analyzer name: LOGIC ANALYSER

Slot      Module Name          Code Version  Card ID Code
======    ===========          ============  ============
CPU       System               V03.13
slot_c    expander of slot_d                 012
slot_d    Oscilloscope         V03.01        011
slot_e    100/500MHz LA        V03.09        032 

And, as always, don't forget to unmount the NFS share before powering down the 16500B…

sudo umount /mnt/work

Assumption Alert: This paragraph assumes you're using a recent version of Linux. It was tested on Ubuntu 9.10, 64-bit edition but should work on 9.04, and will probably work fine on 8.10 (and maybe 8.04) as well. Your mileage may vary.

First we need to copy some font files across. FTP into the analyser, and connect as either “control” or “data” (which one is of no relevance). Navigate to /system/disk/hard/system, and download the two .BDF font files (lg165.bdf and sm165.bdf).

Once we have these font files, they must be converted to the more recent “gzipped PCF” format. Open a shell, cd into the directory where you saved the BDF files, and enter these commands:

bdftopcf lg165.bdf > lg165.pcf
bdftopcf sm165.bdf > sm165.pcf
gzip *.pcf

Now we need to copy these files into a place the fontserver will see them, then rebuild the font cache:

sudo mkdir /usr/share/fonts/hp16500b
sudo cp *165.pcf.gz /usr/share/fonts/hp16500b
sudo fc-cache -rv
(cd /usr/share/fonts/hp16500b; sudo mkfontdir)

We also need to add this directory to the X11 font path. Enter this command in the terminal:

gksu gedit /etc/X11/xorg.conf

Feel free to substitute “gedit” for your favourite GUI text editor, or substitute “gksu gedit” for “sudo vim” if (like me) you prefer Vim.

When Xorg.conf opens, add this text to the bottom of it:

Section "Files"
FontPath "/usr/share/fonts/hp16500b"
EndSection

The 16500B fonts should now be installed, but they won't be available until the system is restarted (which we'll do in a moment). For now, we'll move on to making it possible for the analyser to use the PC's X11 server as a display.

Recent versions of Ubuntu Linux disallow TCP connections to the X server for security reasons. The theory behind this is that you don't want other people putting stuff on your screen. “xhost” access control does allow us to restrict who can access X11 via TCP, but the theory is that it's more secure if TCP access is just turned off (there's always a chance someone will find a security hole in xhost). So we need to turn this restriction off.

Go back to your terminal and (assuming X11 is still running), enter this command:

gksu gedit /etc/gdm/custom.conf

Look for this text in custom.conf:

[daemon]

[security]

[xdmcp]

After “[security]”, add “DisallowTCP=false”, so the new block looks like this:

[daemon]

[security]
DisallowTCP=false

[xdmcp]

Now we need to edit one other file:

gksu gedit /etc/X11/xinit/xserverrc

Change this:

exec /usr/bin/X11/X -nolisten tcp

To this:

exec /usr/bin/X11/X

Now we've enabled remote TCP connections for the X-server. Shut down and reboot the system. When it finishes rebooting, log in and open a terminal, then enter the following command:

xhost +<analyser IP address>
echo $DISPLAY (replace <analyser IP address> with your logic analyser's IP address) This will enable X11 access for the logic analyser, then print the Display and Screen numbers – the Display is the first number (between the colon and the full-stop), and the Screen is the second number (between the full stop and the end of the line). Write these two numbers down, you'll need them in a minute. You should now be able to display the analyser control window on the PC. Go back to the analyser, and open the Communications window (by pressing Communications on the System screen). Select “X Window”. Now enter your PC's IP address in “X Window Server - IP address”, and enter the Display and Screen numbers in the other two fields (these will probably both be zero). To connect the analyser to the PC, press the “Disconnected” button at the bottom of the “X Windows Configuration” screen. The analyser will hang for a few seconds, then a controller window should appear on your PC. If you see a warning about fonts, check that you performed all the steps above correctly (especially creating the font caches and adding the FontPath to xorg.conf). To display the current font path, you can type “xset q” in a terminal. Once everything is set up, you can connect the analyser to the PC by running the two commands above (“xhost” and “echo$DISPLAY”), then open the X Windows configuration screen on the analyser, set the display and screen numbers, and hit “Disconnected” to connect. Easy when you know how!