Raspberry PI3 as a Printer server

Hi all,

I’m very new at using freedombox, so my question could be very silly.
I’m trying to use my raspberry pi2 as a printer server, so I want to install a CUPS server on the Freedombox system. Is this the best option to do that? or is there any better in Freedombox?

I have searched for this topic in this forum but with no success, but I have found several easy tutorial about it, like thiis:

https://circuitdigest.com/microcontroller-projects/raspberry-pi-print-server:

sudo apt-get update
sudo apt-get upgrade
sudo nano /etc/cups/cupsd.conf — and modify it:

# Only listen for connections from the local machine.

#Listen localhost:631

#CHANGED TO LISTEN TO LOCAL LAN

Port 631

# Restrict access to the server…

  • Order allow,deny*
  • Allow @Local*

# Restrict access to the admin pages…
<Location /admin>

  • Order allow,deny*
  • Allow @Local*

# Restrict access to configuration files…
<Location /admin/conf>

  • AuthType Default*
  • Require user @SYSTEM*
  • Order allow,deny*
  • Allow @Local*

sudo service cups restart
sudo cupsctl --remote-any
sudo /etc/init.d/cups restart

But when I try to enter to the CUPS server, for example: e.g 192.168.137.147:631

I got the error: this site can’t be reach

Any help will be very appreciated!
Thank you!

1 Like

Freedombox comes with integrated Firewall.
You will have to Modify it manually according to https://wiki.debian.org/FreedomBox/Manual/Firewall

I guess
This cold work
firewall-cmd --permanent --zone=internal --add-port=631
But I did not try and I’m no expert here. Please double check with the manual.
Hoping this helps.

1 Like

@auser is essentially right. Some modifications though:

firewall-cmd --permanent --zone=internal --add-port=631/tcp
firewall-cmd --zone=internal --add-port=631/tcp
firewall-cmd --permanent --zone=internal --add-port=631/udp
firewall-cmd --zone=internal --add-port=631/udp

The commands without --permanent allow you to use the service without a reboot. /tcp is needed because firewall-cmd accepts port only when protocol is specified. /udp command is to ensure that we open both tcp and udp ports as cups needs.

@sgaray, would be nice to hear from you on what motivated you to setup cups (we did think about implementing an app for cups earlier but didn’t prioritize it). I assumed that most printers these days are network capable.

1 Like

Thanks for providing the info on how to correctly use firewall-cmd! From a first curious reading of the wiki I did not fully understand it.

Thanks auser and sunil, with the auser’s commands I was finally able to get the cups web interface to apply the necesary settings.

Motivation of using CUPS:
I have a HP 1025nw printer and I couldn’t configure it to work using wifi (neither in Fedora 30 nor Debian Jessie), it only works by usb connection. So i decided to use my raspberry pi3 as a printer server, connecting my HP to my pi3.

Thank you very much for your time!
Serigo

I have also been thinking of using my FB as printserver. While my printer works on the network it doesn’t do WoL. Putting a switchable socket and automatically turning on the printer is on my ‘longer term’ Todo list.
This has been done before: https://www.google.com/url?sa=t&source=web&rct=j&url=http://forum.lemaker.org/thread-9962-1-1.html&ved=2ahUKEwiW0JWP8rToAhUGXpoKHSuTCB4QFjABegQIBBAB&usg=AOvVaw3sigbNomVffB150Szw4d76

I’m late to the CUPS party but just wanted to add my $0.02 here and to thank both @sgaray and @sunil for the their question and subsequent answer about how to get CUPS working with FreedomBox. I had struggled to get CUPS working in the past, given up, but yesterday followed these instructions and it’s now working fine.

My interest in running CUPS on the FreedomBox (RasPi 3-based in my case) was that I have an older printer without WiFi capability. It’s perfectly functional and I did not want to replace it merely because I was told that “wireless printing is more convenient” … true, but also a story promoted by printer manufacturers to sell more printers!

Running CUPS on the FreedomBox means that:

  1. I can now print wirelessly even though the printer hardware is not designed for this.
  2. I don’t have to buy a new WiFi-enabled printer and do not send my old printer to landfill.
  3. I don’t have to have yet another device forever in standby mode but still consuming energy. I turn on my printer when I need it, and turn it off when I don’t. In theory you can do that with a WiFi-equipped printer too, but who ever does?

Items 2 and 3 are important from an environmental and sustainability perspective. FreedomBox+CUPS means that I can extend the life of my older printer and avoid buying a new (vampire) device to replace it.

FreedomBox is already a modular set of tools that solves real world problems. Installing CUPS has delivered a valuable new solution to that already impressive toolkit. Should it be included in the default installation? I vote yes, but understand that my usecase is probably a shrinking market as people replace their older hardware.

Thanks again for a really useful thread on this excellent forum.

3 Likes

Above link no longer works, thanks to the archive we can still get the info here:
https://web.archive.org/web/20200129141649/http://forum.lemaker.org/thread-9962-1-1.html