LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-21-2014, 04:22 PM   #1
CVAlkan
Member
 
Registered: Nov 2012
Location: Northwest suburbs of Chicago
Distribution: Ubuntu & Mint LTS, Manjaro Rolling; Android
Posts: 242

Rep: Reputation: Disabled
Revisiting an old unsolved problem with Parallel Port


Shortly after Ubuntu 12.04 was released, I added it as a dual-boot to my existing Windows XP installation.

I spent an inordinate amount of time attempting to get a dumb daisy wheel printer to function in some fashion under Ubuntu, but with no success whatsoever. All I require is that I be able to send raw files to the device, even if it is from the command line. In spite of a flood of responses with various suggestions, none of these got me any closer. Eventually, I gave up. For the record, it's not that I'm particularly enamoured of my daisy wheel device - I much prefer the latest of my dual-sided, amazingly fast ink-jet printers (and I even had the old Laser-Jet II for many years). BUT, there is a place for IMPACT printers. Since I have a perfectly good one, it seems to me that it shouldn't take a miracle to get it printing again with an OS that claims to be ready to replace Windows.

Recently, I added Ubuntu 14.04 to the machine, and decided to give the old printer another go. I went through all of my earlier notes - including all of the many discussions of this issue on various web forums. The problem with these, of course, is that many give conflicting advice, outdated information, and so forth.

I have a PCI card installed in the chassis with a parallel port and, during the earlier attempt, I purchased a USB-Parallel converter to see if that might work. Both, I should add, function just fine under Windows, so it appears there is nothing amiss with the hardware.

So I thought I would once more see if anyone has any suggestions. I've added the results from the commands suggested in the past as relevant. In summary, these are:
dmesg | grep par
dmesg | grep ppdev
ls -l /dev/lp* /dev/parport*
lpinfo -v
lspci -vv
lsusb
cat /etc/modules
ls -l /proc/sys/dev/parport/parport*/autoprobe*
ls -l /proc/sys/dev/parport/parport*/autoprobe*
modprobe -c | grep parport

The outputs from each of these commands is in the attachment, as the LQ BBS seems to think they are images for some reason:
=====================================================================================
COMMENT REGARDING I/O Ports for Parallel Adaptor:

I suspect (based on comments I've seen on the internet) that the port locations on this adaptor may be non-standard, specifically the location of cc00 for Region 3. See the entry in dmesg | grep par above, which says:
[ 20.402778] parport0: PC-style at 0xcf00 (0xce00), irq 21, using FIFO [PCSPP,TRISTATE,COMPAT,ECP]

To correct this, per a web posting I can no longer locate, I created a file '/etc/modprobe.d/options' with the single line:

options parport_pc io=0xcc00 irq=none

Once I did this, the command:
echo "Hello" > /dev/usb/lp3
actually "worked" ... (i.e. 'Hello' was printed)

At this point I had:
Results of: ls -l /dev (abbreviated)
crw-rw---- 1 root lp 6, 0 Jul 21 08:54 lp0
crw-rw-r-- 1 root lp 99, 0 Jul 21 08:54 parport0

Results of: ls -l /dev/usb
total 0
crw------- 1 root root 180, 0 Jul 21 08:54 hiddev0
crw-rw---- 1 root lp 180, 2 Jul 21 08:54 lp2
crw-rw---- 1 root lp 180, 3 Jul 21 08:54 lp3

Then, knowing that CUPS can't handle subdirectories, I created a symbolic link using the command:
ln -s /dev/usb/lp3 /dev/lp3

I was then able to enter:
echo "Hello" > /dev/lp3
... and this "worked" as well. At this point the results of ls -l /dev (abbreviated) were:
crw-rw---- 1 root lp 6, 0 Jul 21 08:54 lp0
lrwxrwxrwx 1 root root 12 Jul 21 11:00 lp3 -> /dev/usb/lp3
crw-rw-r-- 1 root lp 99, 0 Jul 21 08:54 parport0

I then attempted to add the printer to CUPS, which seemed to go ok, but it refused to do a test print; the printer showed up in my apps, but when I attempted to print, it told me that my printer wasn't configured properly. And this effort managed to kill the ability to echo something from the command line tellimg me I didn't have permission (even with sudo).

I rebooted, and the echo ability returned but, again, when I made any attempt to use the thing in any fashion at all, it went AWOL. This obviously suggests that something is clobbering something else but I got lost in the descent into the abyss.

So --- I'm further along than I was two years ago with Ubuntu 12.04, but sadly not up to the point I was in 1985 when I first moved from Xenix and AT&T Unix to these new-fangled personal computers. Trying to track down what is going on in Ubuntu is mystifying, as half the stuff I look at doesn't match what's shown on line, and everything seems to be redirected somewhere else - often several times. I'm beginning to believe that all these redirections are just meant to hide the fact the Ubuntu's underlying kernel is really MS-DOS 3.1. I rejected that, of course, as I don't recall it being this hard to get a printer working back then (although there were moments of course.)

=====================================================================================
SUMMARY:

The device I'm attempting to use (on either parallel port; I don't care) is not "smart" nor is it bi-directional; I have no idea how to tell if that is something that needs to be configured or how to do that. In any case, the output of lsusb -v for the USB-Parallel adaptor (Bus 006 Device 002) would seem to indicate that the USB port at least knows it's unidirectional.

It would be nice, although not mandatory, to be able to use the printer from CUPS or at least as a printer within Ubuntu. What I need as a minimum, though, is a way to use some command to send a raw file from the command line to the printer. (Is there a way to just direct a file to the USB port directly?)

Ultimately, I would like to use the printer with an old accounting application that runs in DOS (under DOSEMU and in a Virtual Machine with Windows), both of which are dependent on the printer working in the Ubuntu host so far as I know.

Thanks in advance for any suggestions.
Attached Files
File Type: txt Par_Port.txt (17.7 KB, 38 views)
 
Old 07-21-2014, 05:31 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
This command should work by changing /home/user/raw.file to whichever file you want to print:

lp -d /dev/usb/lp3 /home/user/raw.file

----------------------
Steve Stites
 
Old 07-21-2014, 07:20 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,679

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
lp is still cups so I would suspect it isn't going to work either.

If echo worked then cat should also i.e.

cat filename > /dev/lp3

I'm not aware that cups can not subdirectories but it has been a while since I've played with a parallel port printer. Check your /etc/cups/printers.conf. The device URI should be something like:

DeviceURI = parallel:/dev/lp3

If you get it working in cups then it should be doable in both dosemu and windows. With windows you can set up a samba share or direct via ipp.
 
Old 07-21-2014, 08:05 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
I'd yank out the pci card and only use a fully supported usb.


See this link maybe. http://www.novell.com/documentation/...html/ch06.html


extra stuff

http://superuser.com/questions/30175...port-in-ubuntu

[url]http://www.linuxquestions.org/questions/blog/ted_chou12-538462/parallel-port-with-cups-lpt-35083/[/url

In some of those it is possible to get a new style cable and set the card or usb to a bidirectional transfer and that sometimes helps. Also we assume pci you shouldn't have to fool with irq's and such.

Depending on bios this add on card may or may not be what you think. The onboard uart chip may hold a 0 lp port and you'd have to add so it would be either lp1 or lp2 or even higher.

Last edited by jefro; 07-21-2014 at 08:07 PM.
 
Old 07-22-2014, 03:38 PM   #5
CVAlkan
Member
 
Registered: Nov 2012
Location: Northwest suburbs of Chicago
Distribution: Ubuntu & Mint LTS, Manjaro Rolling; Android
Posts: 242

Original Poster
Rep: Reputation: Disabled
Thanks to all of you for your responses.

For jailbait: Ubuntu 14.04 tells me that "The printer or class does not exist" when I give the lp command you provided. I thought perhaps you meant lpr instead, but there is no -d format modifier for that (at least on my OS).

For michaelk: You are right, and I should have mentioned that "echo Hello > /dev/lp3" and "cp Test.txt /dev/lp3" work as well as the "cat Test.txt > /dev/lp3" you suggested and the "echo Hello > /dev/lp3" command I mentioned (less typing). The entry in /etc/cups/printers.conf is actually "DeviceURI parallel:/dev/lp3" (i.e. there is no equals sign in the entry), but that seems consistent with the entries for my inkjet printers, so I assume that's correct.

For jefro: I'll have to read through the links you provided, but since they're not ones I had stumbled upon before, thanks much more pointing them out. Your comment about yanking the PCI parallel card our also seems like something I'll try when I get a little time, as I guess there may be some possibility that my system is getting confused by having two supposed parallel ports hanging around.

But, something is still amiss somewhere, as even though CUPS seems to have everything it needs, it won't print to the device. michaelk mentioned not being aware of the subdirectory name limitation of CUPS. I haven't located anything that confirms that, but if I don't issue the command "sudo ln -s /dev/usb/lp3 /dev/lp3" CUPS doesn't see it at all. With the link, CUPS sort of sees it, but doesn't use it.

A further quirk that seems like some sort of clue to me is that the link is not permanent. I need to recreate it for each session.

But, again, thanks for the suggestions and thoughts. I'll try to report back if I get a chance to yank out the PCI parallel port card.
 
Old 07-22-2014, 04:31 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,679

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
Basically /dev is a virtual file system i.e. it exists in memory only and recreated at boot time. If you want a permanent link you would need to create a udev rule. Oops don't know how the = sign got there but you are correct.

cupsd may not have write permissions to /dev/lp3
 
Old 07-23-2014, 08:52 AM   #7
CVAlkan
Member
 
Registered: Nov 2012
Location: Northwest suburbs of Chicago
Distribution: Ubuntu & Mint LTS, Manjaro Rolling; Android
Posts: 242

Original Poster
Rep: Reputation: Disabled
Thanks Michael.

As near as I can tell, the permissions seem to be ok (at least they match permissions on the devices that work).

I don't recall ever hearing of udev rules back in the past, but after poking around, and finding many, many sets of instructions on the web, I didn't spot one that permitted just an execution of a command, but that's undoubtedly because I wouldn't recognize it if I did.

Could I ask what the syntax would be for just having a rule that just executed the "ln -s /dev/usb/lp3 /dev/lp3" command on startup? I would like this to be executed regardless of whether I remembered to turn on the device or not. Then at least I'll be able to copy things from the command line to the device even if CUPS doesn't like it. I presume I would add a new file to the /etc/udev/rules.d directory, as the only file there now is "70-persistent-net.rules." Or, do I create the rule file in my own user directory?

It also seems from what I read that the file would have to be named beginning with a number less than 70 and have the extension ".rules" but I'm sort of inferring this from the examples, so would appreciate confirmation.

Thanks again for your patience; I was thinking of dropping Mark Shuttleworth a line suggesting that this might be an example of why Linux isn't likely to replace Windows for the masses quite yet. What was also interesting to me was that, in poking through the CUPS documentation on line, their recommended method for determining if there was a hardware problem when encountering issues with printing in CUPS was to - hold your breath - try using the device under Windows. Uh-Oh...

Again, thanks ...
 
Old 07-23-2014, 02:49 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
You might try a few older live cd's to double check this setup. Some of the Knoppix 3.x to 5.x might work directly. For the most part, no one uses parallel printers anymore. I'd also try a number of other live cd's to see what is possible. If you get one to work then look at how it works and try to re-create it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pci-e parallel port problem Mr Bits Linux - Hardware 9 01-07-2012 08:33 AM
pci-e parallel port problem Mr Bits Linux - Hardware 1 11-18-2011 03:55 PM
Parallel port problem in 9.3 jolphil SUSE / openSUSE 2 12-06-2005 05:28 PM
parallel port cd install problem gwg300 Slackware - Installation 1 07-16-2005 03:12 AM
Parallel port problem longnam Linux - Hardware 1 03-31-2005 04:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration