Preface:
Raspberry send end, the printer is connected through the USB port, to configure the printer, controlling the printer to print and scan functions.
This configuration of a printer uses HP
First, print a configuration
Configuration process
1. Drive OK
Since the determination using the HP printer at home, so enter HP's official website:
https://developers.hp.com/hp-linux-imaging-and-printing/supported_devices/index
Query whether the printer driver supports Linux
2. Driver Installation
-
Raspberry Pi into the control window, run the following command:
sudo apt-get install hplip
China is best replaced by a mirror to download:
https://blog.csdn.net/la9998372/article/details/77886806
Note : after the change occurs the case where the source could not be installed automatically dependent package needs to be
stretch
replacedbuster
, for example:deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
modifydeb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
-
Then run the command, will join pi user to the lpadmin :
sudo usermod -a -G lpadmin pi
-
After a successful installation
hplip-gui
, the following command:
sudo apt-get install hplip-gui
-
After successful installation the following steps:
-
An input terminal
hp-setup
-
In the pop-up window select
Universal Serial Bus(USB)
--->next
-
Select the printer, the printer is where I
HP LaserJet MFP m227-m231
choose it --->next
-
Note: If there is no printer, then plug USB cable with the printer
-
-
On the next screen, check
Printer Setup
--->Add Printer
-
Fax Setup
Function as a fax machine, do not check
-
-
Input box will pop up a user name and password, you can enter
-
So far success has been configured printer
-
-
Select the default printer, I was through
菜单栏
->Preference
->HPLIP Toolbox
->Printer Control
in the selected printer as the default printerSet as Default
-
If you do not set up successfully, restart it and then set that is
-
manual
-
lsusb
: USB device connected View -
CUPS
command:the lpstat - A # display reception status of the printer. - c # Display print classes. - the p-# display the print status: enabled or disabled. -s # displays the default printer, and one or more classes. Equivalent to -d, -c, and - V. Note that multiple options must be separated because the specified value can be a number of options. -s # display and printer devices.
-
lp
: Print Commandlp - P Specify the printer (if already set the default printer, you do not need to specify) file name # EG: lp ./Desktop/test.jpg
More advanced instruction is not posted here
Second, the scanner configuration
install driver
-
Open a terminal run the following command:
sudo apt-get install sane sudo hp-plugin
In operation
sudo hp-plugin
command, prompted to enter the relevant y / n or the like;NOTE: If circumstances arise such as the installation fails, you can go to the site to download plug-ins: https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/
ps:
My installation failed, the question arises error: Unable to recieve Key from the keyserver , do not control select 'y' to continue the installation; after that accept the license, complete the installation;
Follow-up: from the table-driven websites whether HP support printing, there is
Driver Plug-in
such a column, mentioned in the subsequent explanation:8 ("Required") A downloadable driver plug-in is required for printing support. ("Optional") A downloadable driver plug-in is optional for printing support and may increase the speed, quality, or other aspect of printed output. ("No" or "None") A driver plug-in is not required nor available. Driver plug-ins are released under a proprietary (non-open) license and are not part of the HPLIP tarball release. For more information, please refer to this KB article
That is, if NO, then the driver plug-in is not required
-
Check the printer device
sudo sane- the Find - Scanner # information in the output, I can find such a bunch of information # found the USB Scanner (Vendor = 0x03f0 [the HP], Product = 0x642a [the MFP the HP LaserJet M227-M231]) AT libusb: 001 : 004
Use the command scanimage -L
to view specific scanner models
Scanned documents
# 1 plus the device name. Scanimage device name -d printer (available through the above-mentioned scanimage -L command)> address and the name of the output file # scanimage -d hpaio: / the USB / Serial HP_LaserJet_MFP_M227-M231 VNL3D12026 => ./? Desktop / test.jpg # -------------------------------------------- ---------------- # # 2 You can choose not to add the device name scanimage > path + filename # EG: scanimage > ./Desktop/scan.jpg
By
scanimage --help
acquiring help change command, for example, set the scan size, format parameters
Reference Documents
https://blog.csdn.net/u012939880/article/details/93748342
https://developers.hp.com/hp-linux-imaging-and-printing/install/install/index
https://blog.csdn.net/nullpointer2008/article/details/79664253
scanning
https://blog.csdn.net/wdkirchhoff/article/details/52536846