Tag Archives: LaserJet

HP10xx Hewlett-Packard LaserJet 1020 Debian Lenny (stable) english

We will use:

heh, I have installed many packages, so i might miss some packages please fix me if so… (maybe libusb, cupsys?)
So lets add squeeze resource:


deb http://debian.mirror.vu.lt/debian squeeze main
deb-src http://debian.mirror.vu.lt/debian squeeze main


to file: /etc/apt/sources.list.d/squeeze.list
then install p910nd:


apt-get update
apt-get install p910nd


and do not forget to remove squeeze from apt list 😉 using command:


rm /etc/apt/source.list.d/squeeze.list


Next we need just install drivers to our printer and launch printing daemon…
So p910nd printing daemon conf file: /etc/default/p9910nd


# Printer number, if not 0
P910ND_NUM=""
# Additional daemon arguments, see man 8 p910nd
P910ND_OPTS="-b -f /dev/usb/lp0 0"
# my printer connects to device: /dev/usb/lp0 ;)

# Debian specific (set to 1 to enable start by default)
P910ND_START=1


So lets start it:


/etc/init.d/p910nd restart


Next, Dowload firmware: sihp1020.dl extracting it:


wget http://lpic.lt/wp-content/uploads/2010/08/sihp1020.dl.tar.bz2
bunzip2 sihp1020.dl.tar.bz2
tar -xf sihp1020.dl.tar


drop firmware into yours printer:


cat sihp1020.dl > /dev/usb/lp0


As I mentioned /dev/usb/lp0 – my printer device in linux 🙂
so, 🙂 what’s next?
As i recall that’s it… Just go to http://localhost:631 ? (I appeared to be 🙂 after one of cups or cupsys is installed)

If something do not work after reboot or replugging USB printer we should copy paste script a to /usr/sbin/hplj1020 so script a:


#!/bin/sh

if [ -f /tmp/busy-prn ]; then
exit 99
fi

touch /tmp/busy-prn

sleep 2

D=$(awk '/Manufacturer/ {print $2} ' /proc/bus/usb/devices | grep -v Linux | wc -l)

if [ $D == 1 ]; then
# No daemon running
# Start daemon if printer is attached
if [ -e /dev/usb/lp0 ]; then
/etc/init.d/p910nd start
sleep 1
cat /root/sihp1020.dl > /dev/usb/lp0
fi
else
if [ $D == 0 ]; then
# No Printer attached but daemon running
# Kill daemon
/etc/init.d/p910nd stop
fi
fi

# Kill the spare process //hid3

kill `pidof p9100d | awk '{print $2}'`

rm -f /tmp/busy-prn


now copy:


cp a /usr/sbin/hplj1020


that’s it? 😉

External link:
https://answers.launchpad.net/ubuntu/+source/hplip/+question/45032

HP10xx Hewlett-Packard LaserJet 1020 Debian Lenny (stable)

Tam naudosime:

heh, daugybe paketu prisidiegiau, tai nezinia ar kazko nepraleidau… (Galbut libusb, cupsys?)
Taigi pradzioje prisijunkim:


deb http://debian.mirror.vu.lt/debian squeeze main
deb-src http://debian.mirror.vu.lt/debian squeeze main


i byla: /etc/apt/sources.list.d/squeeze.list
tuomet susidiekime p910nd:


apt-get update
apt-get install p910nd


ir nepamirskime squeeze pasalinti is resursu: komandele:


rm /etc/apt/source.list.d/squeeze.list


Toliau mums beliko sudiegti draiveriukus musu printeriui ir paleisti spausdinimo demona…
Taigi p910nd spausdinimo demono konfiguravimas byloje: /etc/default/p9910nd


# Printer number, if not 0
P910ND_NUM=""
# Additional daemon arguments, see man 8 p910nd
P910ND_OPTS="-b -f /dev/usb/lp0 0"
# pas mane jis prisijunge prie device: /dev/usb/lp0 ;)

# Debian specific (set to 1 to enable start by default)
P910ND_START=1


Ir paleiskime si demona:


/etc/init.d/p910nd restart


Toliau parsisiuskime failiuka: sihp1020.dl ir issiarchyvuokime:


wget http://lpic.lt/wp-content/uploads/2010/08/sihp1020.dl.tar.bz2
bunzip2 sihp1020.dl.tar.bz2
tar -xf sihp1020.dl.tar


tuomet numeskim si firmware’a musu printeriui:


cat sihp1020.dl > /dev/usb/lp0


Kaip minejau /dev/usb/lp0 i cia prisilinkino mano usb printeriukas 🙂
toliau 🙂 kas?
lyg ir reiktu tiesiog uzeiti i http://localhost:631 ?

Norint, kad ikisus USB laideli dar reiktu nukopinti skripta a i /usr/sbin/hplj1020 taigi byla a:


#!/bin/sh

if [ -f /tmp/busy-prn ]; then
exit 99
fi

touch /tmp/busy-prn

sleep 2

D=$(awk '/Manufacturer/ {print $2} ' /proc/bus/usb/devices | grep -v Linux | wc -l)

if [ $D == 1 ]; then
# No daemon running
# Start daemon if printer is attached
if [ -e /dev/usb/lp0 ]; then
/etc/init.d/p910nd start
sleep 1
cat /root/sihp1020.dl > /dev/usb/lp0
fi
else
if [ $D == 0 ]; then
# No Printer attached but daemon running
# Kill daemon
/etc/init.d/p910nd stop
fi
fi

# Kill the spare process //hid3

kill `pidof p9100d | awk '{print $2}'`

rm -f /tmp/busy-prn


Ir kopijavimas:


cp a /usr/sbin/hplj1020


Lyg ir tiek ;)

External link:
https://answers.launchpad.net/ubuntu/+source/hplip/+question/45032