Rich Freeman via plug on 14 Jan 2025 04:57:18 -0800 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [PLUG] Parallel port with Debian 12 |
On Mon, Jan 13, 2025 at 8:55 PM N. Albert via plug <plug@lists.phillylinux.org> wrote: > > On 1/13/2025 8:36 PM, Michael Lazin via plug wrote: > > > I don't think you can write to the parallel port with bash > > directly. > > Hmm, from some research I did initially, it seemed like it should be > possible So, it has been eons since I've used this sort of hardware on linux, but I suspect it depends on your printer. Really old printers probably would just accept ascii text they receive and print it, unless preceded by escape codes and such. More modern printers may not still have this sort of legacy compatibility and may expect everything to be encoded in some sort of command language. Granted, if the printer actually HAS a parallel port it is probably for legacy purposes, but if it is just really old it might just be from the days when everything used Windows but USB wasn't ubiquitous. Bottom line is that it might depend. If you've been able to print this way on this particular printer in the past though I'd say it seems likely to work. I'm also not sure if CUPS can create a device node and then just translate via the printer driver. As far as your specific issue I can think of a few things that could go wrong, but that would be getting really into the weeds and I haven't dealt with a parallel printer in decades so I'm not sure you'd benefit from a lot of speculation. Questions that come to mind are whether the kernel driver is enabled, and whether the udev rule is sticking a device node where you think it ought to. > the ability to write raw bytes directly to the ... device address (e.g. 0x378) That isn't something done trivially. First, it is normally the role of a kernel module and you'd need to run as root to use instructions like OUT. Second, that IO address isn't the printer - it is probably just a base address of a series of addresses that control the parallel port at a low level and actually sending data to it probably requires a bunch of initialization/etc. I'd have to go dig up the old docs on how those interfaces work. It isn't actually that hard (that sort of hardware is 1970s technology and very simple), but it isn't like you can just write a string in python to an IO port. Once initialized you probably could just loop through a string and send one byte at a time. Really though you should just figure out how to get the kernel to do its job. You might try running "udevadm info -t" and looking for parport somewhere in the output. That might give you some clues as to whether udev knows about the device and where it put the device node. Your kenrel seems to know about it from dmesg mentioning it, so I'm guessing it isn't a missing kernel driver, but again I haven't messed with those ports in ages so maybe I'm missing something there. -- Rich ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug