Use N1Box and CUPS to make the usb Printer connecting Network
Because of the price, I bought a usb Printer. It is Cannon IP2780. And the N1Box can be installed Arabian OS. So I try to make the AirPrint of my MacBook and iPhone. Let’s do it.
install software:
sudo apt-get install cups
config the cups:
edit /etc/cups/cupsd.conf
#config listen address:
use 0.0.0.0:631 replace listen address localhost:631
#setting the Browsing
change the Browsing setting is on
Allow remote the manager cups
# Allow remote access
Port 631
Listen /run/cups/cups.sock
Browsing on
BrowseLocalProtocols dnssd
DefaultAuthType Basic
WebInterface Yes
<Location />
# Allow remote access...
Order allow,deny
Allow all
</Location>
<Location /admin>
</Location>
Try to install the driver of cups. Because most Cannon printers can be supported by cups. So I directly install driver. Maybe your printer can not be supported by cups , you can try using GitHub to find it.
Below is the Cannon Printer Driver install.
sudo apt-get install libcups2-dev
sudo apt-get install libcupsfilters-dev libpng-tools
sudo usermod -aG lpadmin zhangyuqing
sudo apt-get install cups-backend-bjnp
sudo apt-get install printer-driver-gutenprint
sudo apt-get install gutenprint-locales gutenprint-doc
Then install the AirPrint of iPhone and MacBook Pro.
sudo apt-get -y install avahi-daemon avahi-discover libnss-mdns
sudo service avahi-daemon restart
sudo service cups restart
Last,you can config the cups using website. If your linux has firewall you can allow the cups.
sudo ufw allow 631
Sudo ufw allow 548
Or
Sudo ufw allow cups
Sudo ufw allow avahi-daemon
Then open the website http://192.168.1.151:631 use Safari. 192.168.1.51 is the ip address of N1 Box.