Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: wonderfulll on June 09, 2010, 05:19:35 AM
-
Is there any way to redirect data from tcp port to parallel port?
-
Is there any way to redirect data from tcp port to parallel port?
For what purpose?
-
I've done that ;)
I had a laplink connection to an older laptop, and NAT'ed internet through that. Is this what you mean?
If not, for raw redirection you can use bash or netcat (can't remember the syntax for either, but something like ncat tcp:444 > /dev/lp0/parport0)
-
Is there any way to redirect data from tcp port to parallel port?
For what purpose?
to send data to thermal printer
-
Tiny Core has the socat.tcz extension which will probably work. There is a man page (http://www.dest-unreach.org/socat/doc/socat.html) with more information. In your case, this should work:
sudo modprobe lp
socat -u TCP4-LISTEN:44444,reuseaddr,fork OPEN:/dev/lp0
If you are sending binary data (rather than just text) to the printer, you will need raw access to the parallel port via /dev/parport0. This driver is not part of the base (http://forum.tinycorelinux.net/index.php?topic=5723.msg30437#msg30437), so you must compile the ppdev module yourself from the Linux kernel source. Perhaps we need a ppdev.tcz extension. :)
-
If you are sending binary data (rather than just text) to the printer, you will need raw access to the parallel port via /dev/parport0. This driver is not part of the base (http://forum.tinycorelinux.net/index.php?topic=5723.msg30437#msg30437), so you must compile the ppdev module yourself from the Linux kernel source. Perhaps we need a ppdev.tcz extension. :)
It is in 3.x.