LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to Change config to use USB serial interface (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-config-to-use-usb-serial-interface-52356/)

hughmax 03-29-2003 10:37 AM

How to Change config to use USB serial interface
 
I'm running a linux based program under windows via a command shell.
Is it possible to change the config file to accept a USB serial port
instead of a normal serial port?

What changes do I need to make to the config file?

Any help would be appreciated.


I've located the appropriate driver from the prolific web site. It has come in a zip containing the following:

Files Included in This Release:
pl2303.c
pl2303.h
usbserial.c
usb-serial.h
readme.txt
makefile

Below is an excerpt from the existing config file:

# Use "" for current working directory
#datadir = ""
#logdir = ""

# default debug modes (hex)
# initial value on start, and up to 4 values that can be toggled
# debug = initial deb1 deb2 deb3 deb4
debug = 01 01 03 07 ff

# default serial port debug modes (only linux)
# syntax as for debug
serdebug = 01 01 03 07 ff

...

unixdev = /dev/ttyS0

mcleodnine 03-30-2003 10:09 AM

The prolific driver is included in kernels from at least 2.4.18 (pl2303). 'modprobe pl2303' should load both the module and usbserial. You could just tell the config file to use /dev/ttyUSB0 as the device.

hughmax 03-30-2003 03:59 PM

This program was written in version 2.4.10 so presumably doesn't understand /dev/ttyUSB0 .

Can I add this driver within the main config script on my floppy disk load up?

Below are a few excerpts from the loading config script.Could you indicate where I would insert the script to do this and what it would be. Thanks.


# free space on ramdisk - the 2.4.10 kernel outdated those files :)
rm /lib/modules -R
rm /bin/traceroute
rm /bin/dhcpcd
rm /bin/netstat

# important - this copies the login scripts!
cp /mnt/floppy/etc/* /etc/

echo -e "Creating /lincardemu directory and setting permissions" >/dev/tty1
# create a lce directory inside the ramdisk and enter it
mkdir /lincardemu
chmod 777 /lincardemu
cd /lincardemu/
#decompress binary from floppy straight into ramdisk
gzip -d -c /mnt/floppy/lce.gz > /lincardemu/lce
# copy the files from floppy to ramdisk
cp /mnt/floppy/lce/* /lincardemu/
cp /mnt/floppy/loaf.txt /lincardemu/loaf.txt

mcleodnine 03-30-2003 05:39 PM

The program should be able to use the /dev/ttyUSB0 since it is merely another device that would present itself as just another serial port. If the program could use /dev/modem (a common symlink to /dev/ttySx) then it should be okay. You could even create your own link to /dev/ttyUSB0 as well.

As for where in the script - just insert a '/sbin/modprobe pl2303' and '/sbin/modprobe usbserial' (provided the modules are actually avialable) before you need to use the device.

hughmax 03-31-2003 03:34 PM

Thanks for your reply, but still no joy.
I tried inserting the '/sbin/modprobe pl2303' in various places.
Each time I got "syntax error in assignment value" and the appropriate line number.

It looks as though it doesn't recognise "modprobe".

If I key in "ls" 'on the fly' at the # prompt (by alt F3 ing out)
It says: insmod loadkmap etc, but not modprobe.

Is this where it should be? Can I "include" this command within the config file? What would the syntax be?


All times are GMT -5. The time now is 11:33 AM.