Raspberry Pi cases, Raspberry Pi, Arduino, micro:bit, robots

Raspberry Pi Wireless Printer

Raspberry Pi Wireless Printer

This article is for the one looking to turn their conventional printers into a wireless printer or the hobbyist who want to gather new stuff. We have printers at our home which do not have the wireless printing options. We have to plug the wire into the printer every time we need to print something, here we’ll use Raspberry Pi to command the printer wirelessly using the software tool CUPS. 

The print server can be used at home or offices to allow everyone in the network to print wirelessly using laptops, mobile phones, or any other gadget on the same network.

Things You Need:

  • Raspberry Pi 3 B or higher
  • Printer with USB
  • Micro-SD card
  • Ethernet Cable
  • Power Adopter
  • Working Internet Connection

What is CUPS:

CUPS is the standards-based, open-source printing system developed by Apple Inc. for UNIX-like operating systems which allows a computer to act as a printer server. CUPS uses the Internet Printing Protocol (IPP) to support printing to local and network printers. For this article, we are using Raspberry Pi 3 Model B with Raspbian Buster. However, you can use any other Raspberry Pi or Raspbian version.

Setup

This article presumes that you have a working Raspberry Pi with a Raspbian OS. If not visit this link

INSTALLATION OF OPERATING SYSTEM IN RASPBERRY PI
to know more about Raspberry Pi OS installation.

Static IP Address

By default, you are connected to the internet via a dynamic IP address. Which means IP assignment is done by the router you are connected with. The problem with the dynamic IP address is that the IP address changes after an uncertain period of time. We need to make the IP static so that every time we print we don’t have to go through the process of extracting the IP address of the Raspberry Pi. 

To make the IP address static, go through the steps:

  • Open dhcpcd.conf as sudoer in any editor.
  • Edit/Add the following line:

interface wlan0

static ip_address=192.168.1.77/24

static routers=192.168.1.1

static domain_name_servers=8.8.8.8

Static IP

The interface is the name of the network interface you are setting it for.

For Wi-Fi, you can use eth0.

The static ip_address is the IP address you want for your printer

The static routers are the IP address of the gateway

The static domain_name_servers is the IP of your DNS, 8.8.8.8 is google’s DNS.

Install CUPS

You may get some errors if you install CUPS without an updated Raspbian. Update the Raspberry Pi using:

              sudo apt-get update
              sudo apt-get upgrade
Now that the Raspberry Pi is updated, install the CUPS with apt tools. Run the

CUPS Install

following command in the terminal to download CUPS nd its dependencies. 

              sudo apt-get install cups

We add the Pi user to the lpadmin group. This gives the Raspberry Pi the ability to perform CUPS administrative functions without being a sudoer. Use the following command to add the user

              sudo usermod -a -G lpadmin pi

To run the print server over the entire network, run the following commands:

              sudo cupsctl --remote-any

Restart the CUPS services to apply changes:

              sudo /etc/init.d/cups restart

You can configure functions of CUPS according to you like setting the port number. Open the cupsd.conf file as sudoer in the editor of your choice.

sudo nano /etc/cups/cupsd.conf

Edit or add the following lines to the configuration file. These changes will allow us to interact with CUPS.

Adding Printer

Make sure you are on the same network and go to https://IP:port through any of the browsers. Find the IP address using “hostname -I” if you don’t know it yet, default port number for CUPS is 631 if it is not changed. Check the port number in “/etc/cups/cupsd.conf” file.

The browser may show the warning of an insecure connection but you can proceed.

Adding Printer

Go to Administration > Add Printer

From the list of local printers select your printer and check the “Share This Printer” checkbox and continue.

All our setup for the printer server is now completed. In the next step, we have to add this printer to our device and send the print command as we would normally do.

Print through Linux Machine

On your machine go to Settings > Devices and Printers, click on the add button. The Linux machine will detect the network printer automatically and the network printer.

Print through Linux Machine

Now you are good to command your system to print. This is a very efficient way to make your printer wireless with a Raspberry Pi. For Windows system, you may need to install and configure samba on the Raspberry Pi. For macOS and Android, the process will be the same as for Linux.

Enjoy printing..!

People also visited: DC & Stepper Motor Hat for Raspberry Pi

 

Next article Voice Control Home Automation using PiRelay

Leave a comment

Comments must be approved before appearing

* Required fields



Net Orders Checkout

Item Price Qty Total
Subtotal £0.00 GBP
Shipping
Total

Shipping Address

Shipping Methods

x