Skip to content

Instantly share code, notes, and snippets.

@ckunte
Last active June 7, 2024 18:44
Show Gist options
  • Save ckunte/fa1ff885a09d71f3d2cba31c9f8bd237 to your computer and use it in GitHub Desktop.
Save ckunte/fa1ff885a09d71f3d2cba31c9f8bd237 to your computer and use it in GitHub Desktop.
Brother HL-L2321D as a network-enabled AirPrint printer

Brother HL-L2321D as a network-enabled AirPrint printer

Brother HL-L2321D does one thing and does it well. It's fast, prints duplex, and is lean on cartridge usage. Its drivers are available for MacOS and Windows 10, and so installing it is a breeze. Despite the fact that it has one USB port for interface, making this printer accessible (a) over network and (b) on iOS devices is easy too. This requires setting up a print server. Here's why: The key difference between a non-network and a network printer is that the latter not only features hardware (viz., a network port and / or a wireless chip) but that it also has a print server built-in to the printer itself. These missing features in a non-network printer can easily be outsourced to, say, a Raspberry Pi, which may in fact make this a more capable printer than an off-the-shelf network printer.

Setting up a print server on Raspberry Pi

Connecting it to a Raspberry Pi on your home network to enable sharing requires a little work, but when done, it makes this printer not only a network printer, but also an AirPrint enabled printer. Here's how:

  1. Prep the Raspberry Pi to download and install CUPS via the command line terminal, compile and install Brother laser printer specific drivers, kindly made available by @pdewacht.

    # update Raspberry Pi 
    sudo apt update && sudo apt upgrade -y
    # install cups
    sudo apt install cups libcups2-dev libcupsimage2-dev -y
    # set printer admin to be raspberry pi user with <pi_username>
    sudo usermod -a -G lpadmin <pi_username>
    # enable remote administration of shared printer(s)
    sudo cupsctl --remote-admin --remote-any --share-printers
    # download brother laser driver(s) code
    git clone https://github.com/pdewacht/brlaser.git
    cd brlaser/
    # compile driver
    cmake .
    make
    # install driver
    sudo make install
    # restart cups
    sudo systemctl restart cups

    In the above, be sure to replace <pi_username> with the actual username you use on Raspberry Pi.

  2. Access the CUPS administration page on the home network at http://<pi_ip_address>:631/admin/. (Ignore the http browser warning and proceed to the page, since you're on your own home network.) Click on Add Printer button. When prompted for username and password, provide those you access with on raspberry pi.) Select Brother HL-L2320D series in Local Printers, and press continue.

  3. Note the name (typically Brother_HL-L2320D_series unless you change it). Enable Share This Printer, and press continue.

  4. Under Model, select Brother HL-L2300D series, using brlaser v6 (en), and press Add Printer button.

  5. In the next page, set default options as you require, and click on Set Default Options button.

  6. Under Printers tab, select second pull down menu under Administration and select Set as Server Default.

On iOS

The printer is duly recognised as an airprint printer once it is setup as above. No other settings or setup is required.

Installing on MacOS

Once a print server is set up, install the printer on MacOS in the usual way. Bonjour auto-finds the printer, pulls-in the required drivers, and sets it up.

Installing on Windows 10

Once a print server is set up, print drivers for Windows 10 are readily available, and therefore setting this up is pretty straight forward too. To install on Windows 10, select shared printers option under Add printers, and add the following URL:

http://<pi_ip_address>:631/printers/Brother_HL-L2320D_series

In the above instructions, remember to replace <pi_ip_address> with the actual IP address of Raspberry Pi on your home network.

@austinvdubs
Copy link

Thank you so much! This page was a life saver!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment