Programming an RP4000V under Wine

Today, I hooked up the recently-acquired UHF duplexer from TX/RX Systems to our UHF D-STAR repeater.  I needed to program the machine to the new frequencies to match the duplexer and decided to try running the programming tool under Wine (well Crossover Office) instead of hauling out the old Win2k backup machine.  It appeared that the programming interfaces on the repeater were just FTDI USB-to-serial adapters and that the programming tool just talked to it as a serial device.  I figured that would be simple enough for Wine to handle.

The software installed under Wine, but I noticed that when I plugged my Linux machine into the programming port(s), the FTDI driver didn’t load.  If I loaded it manually, it didn’t recognize and take over the USB device.  It appears that the vendor of the FTDI chip in the repeater is non-standard, but that’s the only difference.  I reloaded the ftdi_sio module with the proper parameters to get it to notice the device and it worked.  I was able to program the machine under Wine, by linking dosdevices/com1 to the proper serial device.

To make it easier and more repeatable, I wrote a little script:

#!/bin/bash                                                                    
#                                                                              
# ICOM RPx000V serial helper script                                            
#                                                                              
# Copyright 2008 Dan Smith
# <dsmith.AT.danplanet.DOT.com>                              
#                                                                              
# This script will scan the USB bus on this system and determine               
# the product ID of any attached ICOM repeater modules.  It will               
# unload and then reload the FTDI serial driver with the proper                
# options to detect the device.  After that, it will determine the             
# device name and link /dev/icom to that device for easy access.               
                                                                               
LINK=”icom”                                                                    
VENDOR=”0x0c26″                                                                
DEVICE=$(lsusb -d ${VENDOR}: | cut -d ‘ ‘ -f 6 | cut -d : -f 2)                
                                                                               
if [ -z “$DEVICE” ]; then                                                      
    echo “No devices found”                                                    
    exit 1                                                                     
fi                                                                             
                                                                               
if echo $DEVICE | grep -q ‘ ‘; then                                            
    echo “Multiple devices found:”                                             
    for dev in $DEVICE; do                                                     
        echo $dev                                                              
    done                                                                       
                                                                               
    exit 1                                                                     
fi                                                                             
                                                                               
modprobe -r ftdi_sio || {                                                      
    echo “Unable to unload ftdi_sio”                                           
    exit 1                                                                     
}                                                                              
                                                                               
modprobe ftdi_sio vendor=${VENDOR} product=0x${DEVICE} || {                    
    echo “Failed to load ftdi_sio”                                             
    exit 1                                                                     
}                                                                              
                                                                               
info=$(lsusb -d ${VENDOR}:0x${DEVICE})                                         
bus=$(echo $info | cut -d ‘ ‘ -f 2 | sed ‘s/^0*//’Smilie: ;)                            
dev=$(echo $info | cut -d ‘ ‘ -f 4 | sed ‘s/^0*//’Smilie: ;)                            
                                                                               
for usbserial in /sys/class/tty/ttyUSB*; do                                    
    driver=$(basename $(readlink -f ${usbserial}/device/driver))               
    device=$(basename $usbserial)                                              
    if [ “$driver” = “ftdi_sio” ]; then                                        
        ln -sf /dev/${device} /dev/${LINK}                                     
        echo “Device is /dev/${device} -> /dev/${LINK}”                        
        break                                                                  
    fi                                                                         
done    

This works for both the TX and RX side of the RP4000V and I’m sure it works for the RP2000V, etc.  Just run the script and, if all goes as planned, it should print out the real device name and link /dev/icom to it for easy access.  If you just link your dosdevices/com1 to /dev/icom, then you don’t have to do much switching around to program the repeater.  Very cool!

Category(s): Radio

Comments are closed.