• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: p910nd non-spooling printer daemon  (Read 3418 times)
monsterdog
Newbie
*

Karma: 0
Posts: 7


View Profile
« on: January 06, 2010, 10:05:33 PM »

I compiled this from : http://p910nd.sourceforge.net/

You will need to have gcc and make on your sheevaplug.

Download the file and unpack it on your sheevaplug, you will now have a build directory (for instance "p910nd-0.93")

Code:
cd p910nd-0.93

Uncomment the following line in the Makefile:

Code:
# If you don't have it in /var/log/subsys, uncomment and define
CFLAGS += -DLOCKFILE_DIR=\"/var/log\"

The small crucial change above took a long time to figure out, the binary would exit immediately when the line was commented out.

On your sheevaplug (with gcc and make)

Code:
make
cp p910nd /usr/sbin/
cp p910nd.8 /usr/share/man/man8/
chmod 755 /usr/sbin/p910nd
mkdir /etc/p910nd

Create a new filed named "/etc/p910nd/p910nd.conf" and Insert the following into the file, adjust for the device name of your usb printer:

Code:
# Additional daemon arguments, see man 8 p910nd

#p910nd Version 0.93 Copyright (c) 2008 Ken Yap, GPLv2
#Usage: p910nd [-f device] [-i bindaddr] [-bv] [0|1|2]

P910ND_OPTS="-f /dev/usb/lp0 -b 0"

Create another file named "/etc/init.d/p910nd" and inser the following into it (crude init script, but better than nothing):

Code:
#!/bin/bash
### BEGIN INIT INFO
# Provides:          p910nd
# Required-Start:    $syslog $remote_fs
# Required-Stop:     $syslog $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      1
# Short-Description: Printer device to network port translation demon
### END INIT INFO

P910ND_BINARY="/usr/sbin/p910nd"
P910ND_CONFIG="/etc/p910nd/p910nd.conf"

source ${P910ND_CONFIG}

case "$1" in
start)
echo "Starting p910nd"
${P910ND_BINARY} ${P910ND_OPTS}
;;
stop)
echo "Stopping p910nd"
kill -9 `cat /var/run/p9100d.pid`
rm /var/run/p9*.pid
;;
*)
echo "Use start or stop"
;;
esac

Then change the script so it can be executed with:

Code:
chmod 755 /etc/init.d/p910nd

You can then make it run at startup with:

Code:
update-rc.d p910nd defaults

It basically listens on port 9100 of your sheevaplug. It can be configured to listen on more ports for more printers, but you will need a better init script. You can then tell your PC to print with the AppSocket protocol and point it to your sheevaplug on port 9100, pick your driver and it should work.

The server does not spool, so will probably not handle several PCs trying to print at once unless you put cups or lprng on your plug. Cups will take up a LOT of space on it, so I would suggest lprng.
Logged

Pages: [1]
Print
Jump to: