For Christmas I got a Raspberry Pi Zero-W single-board computer. They cost around $10 and are amazingly tiny and use very little power.
My goal was to attach this to the usb printer (HP LaserJet 1020) in my home to share it on the network without having to have a desktop computer attached to it and running all the time. This would be much cheaper than buying a new wireless enabled HP printer ($200). Also this would give me a good excuse to play with one of these little single-board computers...
There were a few hurdles to get everything working but I did succeed after some googling and tinkering. It's been working like a champ so far and now I can print from all our home computers and Android phones.
I mostly followed this tutorial. Here are the steps to set this up...
My goal was to attach this to the usb printer (HP LaserJet 1020) in my home to share it on the network without having to have a desktop computer attached to it and running all the time. This would be much cheaper than buying a new wireless enabled HP printer ($200). Also this would give me a good excuse to play with one of these little single-board computers...
There were a few hurdles to get everything working but I did succeed after some googling and tinkering. It's been working like a champ so far and now I can print from all our home computers and Android phones.
I mostly followed this tutorial. Here are the steps to set this up...
- Download the Lite version of Raspbian. This is a minimal Linux distro based on Debian.
- Use Etcher (or something similar) to copy the Raspbian image to a micro SD disk (you don't need to unzip it). In this case I had an old 2 GB micro SD card from an old phone. It worked great because I wasn't going to load much on this system.
- Insert the micro sd card into the Pi.
- Hook up a keyboard and monitor.
- Power up the Pi.
- Log in as 'pi' with password 'raspberry'
- Configure the Pi with the Pi Software Configuration Tool. You should set up wireless networking, change the root password and also enable SSH.
> sudo raspi-config - At this point you can look up your ip address and connect remotely via SSH. I recommend doing this so you can disconnect the monitor and keyboard.
> ip address - Be sure to update at this point
> sudo apt-get update
> sudo apt-get upgrade - Install CUPS
> sudo apt-get install cups - Add the pi user to the lpadmin group
> sudo usermod -a -G lpadmin pi - Set permissions to allow access from anywhere (assuming your behind a firewall)
> sudo cupsctl --remote-any
> sudo /etc/init.d/cups restart - Install Samba (assuming you want access from Windows machines)
> sudo apt-get install samba - Configure Samba printer sharing
> sudo nano /etc/samba/smb.conf
#CUPS printing.
[global]
printing = CUPS
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = yes
read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = no
guest ok = no - Add a spool directory
> sudo mkdir -p /var/spool/samba/
> sudo chmod 1777 /var/spool/samba/ - Restart Samba
> smbcontrol all reload-config
> sudo /etc/init.d/samba restart - Add HP Driver (optional)
> apt-get install hplip - You may need to add a root password for the HP stuff to work
> sudo passwd root - Install the HP driver plugin
> hp-plugin -l - Add a CUPS printer through a browser on another computer
http://[server_ip]:631
Go to the administration panel to add the printer - Restart samba again
> sudo /etc/init.d/samba restart - Add the printer on a Windows machine
- Goto Settings->Printers->Add Printer
- Click Local Printer, then next
- Create a new port
- Set Type = Local Port, next
- Set the SMB share name
- Example '\\MYPI\HP_LaserJet_1020'
(Hopefully)
Comments
Post a Comment