PDA

View Full Version : [SOLVED] 10.10 - cheap parallel port card linux driver not working



anewguy
November 24th, 2010, 05:44 AM
I recently purchased the cheapest pci parallel port card I could find off of Ebay. It looks like a serial port until you install drivers. I've done a search in the forum and there is only 1 thread with no solution. It appears to be something based on a single chip - CH352

For Windows, the driver works. They also provide a Linux driver and the instructions to copy install_p_80x86.o to /usr/sbin. My file doesn't have the ".o" extension - no extension at all, but none the less I copied it there. It then wants the path added to the /etc/rc.d/rc.local and reboot. There isn't such a path in Ubuntu. I tried executing it locally as sudo, with the following results:


dave@dave-MS-7576:~$ sudo ./install_p_80x86
ERROR: Module lp does not exist in /proc/modules
ERROR: Module parport_pc does not exist in /proc/modules
insmod: can't read '/lib/modules/2.6.35-22-generic/kernel/drivers/parport/parport_pc.o': No such file or directory
insmod: can't read '/lib/modules/2.6.35-22-generic/kernel/drivers/char/lp.o': No such file or directory
dave@dave-MS-7576:~$


EDIT: Forgot to mention - the .o file don't get created in the /lib/modules/2.6.35-22-generic/kernel/drivers/parport folder nor does it appear to modify any of the .ko files there.

I'm sure the file isn't built for Ubuntu's file structures.

Does anyone have any ideas on how to get this to work in Ubuntu?

A search of the net shows not much luck for anyone with Ubuntu, but no posts from people with other distros with more "normal" file structures.

Dave ;)

hounddog32
January 25th, 2011, 11:39 AM
I think I have the same card but worse problems - on 64 bit I get

pcilib: proc_read: tried to read 2 bytes at 64, but got only 0
pcilib: proc_read: tried to read 2 bytes at 68, but got only 0
pcilib: proc_read: tried to read 2 bytes at 66, but got only 0
pcilib: proc_read: tried to read 2 bytes at 64, but got only 0
pcilib: proc_read: tried to read 2 bytes at 68, but got only 0
pcilib: proc_read: tried to read 2 bytes at 66, but got only 0
pcilib: proc_read: tried to read 2 bytes at 64, but got only 0
pcilib: proc_read: tried to read 2 bytes at 68, but got only 0
pcilib: proc_read: tried to read 2 bytes at 66, but got only 0

Anyone got any ideas?

hounddog32
January 25th, 2011, 12:08 PM
Running the file from the right directory helped a little: I got what you did. Then I tried to modprobe lp and parport_pc, but I then got

insmod: can't read '/lib/modules/2.6.35-23-generic/kernel/drivers/parport/parport_pc.o': No such file or directory
insmod: can't read '/lib/modules/2.6.35-23-generic/kernel/drivers/char/lp.o': No such file or directory


There are two reasons for that: (a) I'm using the 2.6.35-24-generic kernel (according to uname -r) and (b) 2.6 kernels use .ko modules, not .o

Need someone who knows about these modules to advise now.

sdowney717
January 25th, 2011, 01:46 PM
found this help page

http://read.pudn.com/downloads92/sourcecode/embed/355821/pci-serial/LINUX/README__.htm


This installation guide describes the procedures to install and uninstall CH352 PCI to two serial ports and to one serial and one parport in Linux platform.
1-install and uninstall CH352 PCI to two serial ports
2-install and uninstall CH352 PCI to one serial port and one parport


1-install and uninstall CH352 PCI to two serial ports
(1)-install
<1>-copy install_ss_80x86.o to /usr/sbin
<2>-Add /usr/sbin/install_ss_80x86 at the end of the /etc/rc.d/rc.local.
<3>-reboot
The ttyS2 and ttyS3 are ready for application.
(2)-uninstall
(1)-Remove /usr/sbin/install_ss_80x86 at the end of the /etc/rc.d/rc.local.
(2)-Remove /usr/sbin/install_ss_80x86.o


2-install and uninstall CH352 PCI to one serial port and one parport
(1)install one serial
<1>-copy install_s_80x86.o to /usr/sbin
<2>-Add /usr/sbin/install_s_80x86 at the end of the /etc/rc.d/rc.local.
The ttyS4 are ready for application.

(2)install one parport
Enter the command more /proc/pci or lspci -v
we supply a script file "install_p",but you must be make sure I/O base address is right.
<1>get I/O base address
[root@WCH root]# lspci -v
......
//CH352 CHIP
01:00.0 Serial controller: Unknown device 4348:5053 (rev 10) (prog-if 02 [16550]
)
Subsystem: Unknown device 4348:5053
Flags: medium devsel, IRQ 10
I/O ports at df30 [size=8]
I/O ports at df38 [size=8] //parport I/O base address
......
I/O base address=0xdf38
<2>modify script file "install_p":
#!/bin/sh
cd /lib/modules/2.4.20-8/kernel/drivers/char
rmmod lp
cd /lib/modules/2.4.20-8/kernel/drivers/parport
rmmod parport_pc
insmod parport_pc.o io=0x378,0xdf38 //parport I/O base address
cd /lib/modules/2.4.20-8/kernel/drivers/char
insmod lp.o
warning:2.4.20-8 is my system kernel version,if your kernel is different from it,you must amend.
<3>copy install_p to /usr/sbin
<4>Open the /etc/rc.d/rc.local,then edit it.
Add /usr/sbin/install_p
at the end of the rc.local.
<5>reboot

(3)uninstall one serial
<1>-Remove /usr/sbin/install_s_80x86 at the end of the /etc/rc.d/rc.local.
<2>-Remove /usr/sbin/install_s_80x86.o

(4)uninstall one parport
<1>-Remove /usr/sbin/install_p

jamenlang
March 7th, 2011, 03:21 AM
has anyone gotten this to work with this cheap parallel controller? i can't get it to install with the drivers included or the post above, i can't get ubuntu to see the card as a parallel card as opposed to serial.

Frogs Hair
March 7th, 2011, 03:56 AM
I have a moschip parallel card that has worked out of the box , it was $19.00 new. I just looked and they're $ 10.00 new of the internet , but I bought mine at a local store.

aakash.ece
June 2nd, 2011, 08:18 PM
Hi all, just in case you're still stuck with the crap WCH351L PCI-to-parallel card, it worked for me in 10.04.

Here's how:

1. Run "lspci -v" and look for a section like:

04:05.0 Serial controller: Device 4348:5053 (rev 10) (prog-if 02)
Subsystem: Device 4348:5053
Flags: medium devsel, IRQ 20
I/O ports at d010
I/O ports at d000 [size=8]
Kernel driver in use: serial

The 0xd000 in green coloured line is what you really need. May be different in your system, but whatever. Note that address.
Rest all is on the lines of what sdowney717 (http://ubuntuforums.org/member.php?u=209280) told. Here are the exact commands (replace the kernel version in path to yours if its different) :

sudo bash
cd /lib/modules/2.6.32-29-generic/kernel/drivers/char
rmmod lp
cd /lib/modules/2.6.32-29-generic/kernel/drivers/parport
rmmod parport_pc
insmod parport_pc.ko io=0xd000 #replace 0xd000 with whatever you see in your system above

(at this stage, run dmesg and ensure that you see something to the order of this:
[SIZE=1][ 2379.794334] parport0: PC-style at 0xd000, irq -276406472 [PCSPP,TRISTATE]
[ 2379.794343] parport0: irq -276406472 in use, resorting to polled operation
)
cd /lib/modules/2.6.32-29-generic/kernel/drivers/char
insmod lp.ko

You can ofcourse make it all a script, save with the name "install_p" and have it run via rc.local on system bootup!

kcho
July 4th, 2011, 01:21 AM
Hi! your advice worked with my pci card, but now I've got problems trying to detect a Canon scanner connected to it.
I was doing some "research" on Google and executing a lot of commands with no results.
Some people's posts refer to problems with printers on pci cards and others refer to problems with scanners on onboard ports.
I think the problem is the ieee1284_open function, it doesn't try with the card direction (0xce00) just with the standards (0x278, 0x378, 0x3bc).
I'm not an expert on this :( so, do you have any advice? :D

anewguy
October 4th, 2011, 09:42 AM
Hi all, just in case you're still stuck with the crap WCH351L PCI-to-parallel card, it worked for me in 10.04.

Here's how:

1. Run "lspci -v" and look for a section like:

04:05.0 Serial controller: Device 4348:5053 (rev 10) (prog-if 02)
Subsystem: Device 4348:5053
Flags: medium devsel, IRQ 20
I/O ports at d010
I/O ports at d000 [size=8]
Kernel driver in use: serial

The 0xd000 in green coloured line is what you really need. May be different in your system, but whatever. Note that address.
Rest all is on the lines of what sdowney717 (http://ubuntuforums.org/member.php?u=209280) told. Here are the exact commands (replace the kernel version in path to yours if its different) :

sudo bash
cd /lib/modules/2.6.32-29-generic/kernel/drivers/char
rmmod lp
cd /lib/modules/2.6.32-29-generic/kernel/drivers/parport
rmmod parport_pc
insmod parport_pc.ko io=0xd000 #replace 0xd000 with whatever you see in your system above

(at this stage, run dmesg and ensure that you see something to the order of this:
[SIZE=1][ 2379.794334] parport0: PC-style at 0xd000, irq -276406472 [PCSPP,TRISTATE]
[ 2379.794343] parport0: irq -276406472 in use, resorting to polled operation
)
cd /lib/modules/2.6.32-29-generic/kernel/drivers/char
insmod lp.ko

You can ofcourse make it all a script, save with the name "install_p" and have it run via rc.local on system bootup!

Didn't see the replies here until today. Tried the suggestion, changing the kernel id since I'm in 11.04. The commands all ran fine and I did indeed substitute my i/o address. The dmesg looks the same. However, my Brother HL-1040 Laser Printer is still not seen.

Dave ;)

anewguy
October 5th, 2011, 07:04 AM
I did finally get this to work! Used the following steps:


EDIT: Removed a couple of steps that weren't needed.


Made sure the install_p script file created in the earlier post was correct. It had a couple of errors I had to fix.
Added /usr/sbin/install_p to /etc/rc.local (you may not have the file - the edit will create the file)
Rebooted, it found the printer, installed the driver, seems to work fine


Dave ;)

lee_elenbaas
November 25th, 2011, 01:53 PM
Thanks - this works like a charm for me on a new machine with the cheap card and ubuntu 11.10

jonlowe
February 19th, 2012, 01:07 AM
Outstanding! Worked for me also on 11.10 and the cheap ebay card. Could hardly believe it!

Jon

btindie
February 19th, 2012, 01:42 AM
insmod parport_pc.ko io=0xd000 #replace 0xd000 with whatever you see in your system above

You can ofcourse make it all a script, save with the name "install_p" and have it run via rc.local on system bootup!
parport_pc and lp are loaded by default when the system boots, you can avoid this step altogether by creating a file in /etc/modprobe.d/, it doesn't really matter what the name is but parport_pc.conf is a good choice, with the contents

options parport_pc io=0xd000then when the system automatically loads the module it'll use that option as the default, see "man modprobe.conf".

jonlowe
February 24th, 2012, 02:28 AM
parport_pc and lp are loaded by default when the system boots, you can avoid this step altogether by creating a file in /etc/modprobe.d/, it doesn't really matter what the name is but parport_pc.conf is a good choice, with the contents

options parport_pc io=0xd000then when the system automatically loads the module it'll use that option as the default, see "man modprobe.conf".

This works with my card. A lot easier, and you don't have to worry about updating when the kernels change.

BTW, my card is a PCMCIA version, the red labeled one currently all over ebay. Works great in my old Sony Vaio laptop.

Jon