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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-08-2004, 08:18 AM
|
#1
|
Member
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 814
Rep:
|
What's using my parallel port?!
Hi Folks,
I'm trying to get a compiler and debugger going that uses the parallel port to communicate with the on chip debugger on a microprocessor. When I run the program it tells me:
"Cannot open target interface. Parallel port is already in use."
Is it possible to find out what Linux thinks is using the parallel port and then freeing it up?
I'm not using the parallel port for printing (in fact I'm doing all my printing over the network) and before I ran this program I didn't have a parallel port setup and had to run mknod for parport0...
I'm using Mandrake 9, btw...
Many thanks,
Rob.
|
|
|
03-08-2004, 05:35 PM
|
#2
|
Member
Registered: Aug 2003
Location: Trento, Italy
Distribution: Debian testing
Posts: 394
Rep:
|
Not sure it will work, but worth trying: as root or whatever your parallel port is called
|
|
|
03-08-2004, 05:46 PM
|
#3
|
Member
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 814
Original Poster
Rep:
|
Sadly, no. That doesn't list anything using it. Looked like the right command though did lsof!
Of course, there may well be nothing using it, but the software might be flaky!
|
|
|
03-08-2004, 05:59 PM
|
#4
|
Member
Registered: Aug 2003
Location: Trento, Italy
Distribution: Debian testing
Posts: 394
Rep:
|
Try making "ln -s /dev/parport0 /dev/par0" maybe the error description is misleading, and it can't just open the interface.
|
|
|
03-08-2004, 06:13 PM
|
#5
|
LQ Guru
Registered: Jan 2002
Posts: 6,042
Rep:
|
It happens to me in VMware if I have CUPS or a printer service setup. You can remove that module (I think lp) and try it again. You may want to set the parport to mode 666. Do not forget to load up lp module after you are done.
|
|
|
03-08-2004, 07:34 PM
|
#6
|
Senior Member
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368
Rep:
|
If you're using VMWare, then you may want to disable parallel port support the the client OS and use a share your printer as a network printer, and then use network printing (even though it's on the same machine). The problem, as I see it, is that both the host and the client OS are trying to access the parallel port and only one is allowed to do so. The answer: eliminate the problem.
|
|
|
03-09-2004, 06:47 AM
|
#7
|
Senior Member
Registered: Sep 2001
Location: Brisvegas, Antipodes
Distribution: Slackware
Posts: 4,590
Rep:
|
Check to see if the 'lp' module is loaded with "lsmod" (as root), if it is then unload it with "rmmod lp".
'lp' is the pp printer module.
|
|
|
03-09-2004, 09:47 AM
|
#8
|
Member
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 814
Original Poster
Rep:
|
Aussie, you beaut, that's it! Thanks!
At the risk of sounding ignorant (not so far from the truth) - what am I doing there by entering rmmod lp? I guess I'm removing a "module" - whatever that is - for lp (line printer?). Is a module a piece of code that allows the kernel to interface with hardware?
Bear in mind that I'm a programmer, and I'm not stupid, but all my experience is low level code - assembler and C for microcontrollers...
Oh, btw thanks to the other suggestions I'm running Mandrake 9.1, not VMware.
Many thanks!
Rob.
|
|
|
03-09-2004, 05:45 PM
|
#9
|
Senior Member
Registered: Sep 2001
Location: Brisvegas, Antipodes
Distribution: Slackware
Posts: 4,590
Rep:
|
Quote:
Originally posted by DiBosco
Aussie, you beaut, that's it! Thanks!
|
Your welcome :-)
Quote:
Originally posted by DiBosco
At the risk of sounding ignorant (not so far from the truth) - what am I doing there by entering rmmod lp? I guess I'm removing a "module" - whatever that is - for lp (line printer?).
|
Yes, if Mandrake uses hotplug you can stop it loading the lp module at boot by adding it to /etc/hotplug/blacklist.
Quote:
Originally posted by DiBosco
Is a module a piece of code that allows the kernel to interface with hardware?
|
Yes, but thats not all a module can do, you can have filesystem support compiled as modules (but it's not a good idea to have your primary filesystem as a module) and iptables support is usually compiled as modules.
Quote:
Originally posted by DiBosco
Bear in mind that I'm a programmer, and I'm not stupid, but all my experience is low level code - assembler and C for microcontrollers...
Oh, btw thanks to the other suggestions I'm running Mandrake 9.1, not VMware.
Many thanks!
Rob.
|
Have a look at file:/usr/src/linux/Documentation/modules.txt for more info on dynamically loadable kernel modules.
|
|
|
06-19-2004, 08:33 AM
|
#10
|
Member
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 814
Original Poster
Rep:
|
This problem has raised its ugly head again now I've installed Mandrake 10.
Initially I didn't have a parallel port listed at all, (and the application was telling me /dev/parport0 didn't exist) so I did:
modprobe parport_pc
which I saw recommended somewhere else here, but it seemed to do nothing, so I did:
modprobe parport
as well. This didn't quite work properly, it was still saying /dev/parport0 didn't exist, though the directory /dev/lp0 had suddenly appeared.
I did:
ln -s /dev/lp0 /dev/parport0
Which eventually stopped the message telling me /dev/partport0 didn't exist, but then told me:
"Can't open target interface, parallel port already in use"
So, I thought, no problem, I'll do:
rmmod lp
as I did last time. However, whenever I run the application, lp reappears in the lsmod listing.
I now have parport_pc, parport and lp0 in my lsmod. If I remove parport_pc, parport and lp an do lsmod, they all go. As soon as I try connecting to the parallel port with my application they all appear as below in lsmod
parport_pc 32832 1
lp 12200 0
parport 38952 2 parport_pc,lp
I seem to have got myself in a real tangle! Anyone have any ideas what I've done wrong?!
Many thanks.
Rob.
Last edited by DiBosco; 06-19-2004 at 08:44 AM.
|
|
|
06-20-2004, 11:18 AM
|
#11
|
Member
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 814
Original Poster
Rep:
|
Sussed it, I needed to do mknod, not just make a symbolic link to parport0.
Sorreeeee!
|
|
|
All times are GMT -5. The time now is 06:25 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|