[Solved]How to make a photocopy using a USB scanner and a network printer
Re: How to make a photocopy using a USB scanner and a network printer
With GhostBSD reinstalled, just configure your printer and set as default destination (in CUPS)
If the option "Copy" of XSane doesn't work out of the box, then create the environment variable PRINTER, edit your ~/.xsession and add the next line
export PRINTER=HP_LaserJet_200_color_M251nw
For the changes to take effect, logout from your session and login again
To validate the change, open a terminal and run the command echo $PRINTER it should display
HP_LaserJet_200_color_M251nw
GhostBSD came with CUPS installed/enable by default, if you enable LPD/LPR, you have to disable CUPS (only one print system should be enable), and maybe an update to GhostBSD may revert all your configurations
In the terminal run which lpr It should display /usr/bin/lpr, this mean that every time you run lpr, is running the lpr from CUPS
If the option "Copy" of XSane doesn't work out of the box, then create the environment variable PRINTER, edit your ~/.xsession and add the next line
export PRINTER=HP_LaserJet_200_color_M251nw
For the changes to take effect, logout from your session and login again
To validate the change, open a terminal and run the command echo $PRINTER it should display
HP_LaserJet_200_color_M251nw
GhostBSD came with CUPS installed/enable by default, if you enable LPD/LPR, you have to disable CUPS (only one print system should be enable), and maybe an update to GhostBSD may revert all your configurations
In the terminal run which lpr It should display /usr/bin/lpr, this mean that every time you run lpr, is running the lpr from CUPS
-
- Posts: 50
- Joined: Thu Oct 29, 2015 3:05 pm
Re: How to make a photocopy using a USB scanner and a network printer
With GhostBSD reinstalled, just configure your printer and set as default destination (in CUPS)
My printer has always been configured as my default printer.
edit your ~/.xsession and add the next line
export PRINTER=HP_LaserJet_200_color_M251nw
Done.
# echo $PRINTER
PRINTER: Variable pas définie.
# which lpr
/usr/bin/lpr
No error message when using the "copy" function but no printing.
My printer has always been configured as my default printer.
edit your ~/.xsession and add the next line
export PRINTER=HP_LaserJet_200_color_M251nw
Done.
# echo $PRINTER
PRINTER: Variable pas définie.
# which lpr
/usr/bin/lpr
No error message when using the "copy" function but no printing.
Re: How to make a photocopy using a USB scanner and a network printer
Did you logged out and in after modifying ~/.xsession?
-
- Posts: 50
- Joined: Thu Oct 29, 2015 3:05 pm
Re: How to make a photocopy using a USB scanner and a network printer
Yes, I did.
One thing that could possibly work is that the lpd service would be activated automatically at startup, which is not the case when adding lpd_enable="YES" to the "/etc/rc.conf" file. However, a manual "# service lpd start" activates the service and xsane works.
So how to activate the lpd service automatically?
One thing that could possibly work is that the lpd service would be activated automatically at startup, which is not the case when adding lpd_enable="YES" to the "/etc/rc.conf" file. However, a manual "# service lpd start" activates the service and xsane works.
So how to activate the lpd service automatically?
Re: How to make a photocopy using a USB scanner and a network printer
If you enable LPD/LPR, you need to disable CUPS, also need to make sure that when using lpr it is the /usr/bin/lpr
GhostBSD use OpenRC, I recently solve my problem about SSH not running when the PC boot
GhostBSD use OpenRC, I recently solve my problem about SSH not running when the PC boot
mapsware wrote: ↑Sat Jun 06, 2020 1:05 am Para que el servicio de SSH inicie al arrancar GhostBSD, ejecutamos el siguiente comando como root (o con sudo)
Esto es debido a que GhostBSD utiliza OpenRCCode: Select all
rc-update add sshd
-
- Posts: 50
- Joined: Thu Oct 29, 2015 3:05 pm
Re: How to make a photocopy using a USB scanner and a network printer
Yes, it works !
"rc-update add lpd" allows to automatically activate the lpd service at boot (I had stupidly tried rc-service add lpd, of course without success ...).
So, I deleted the content of "~/.xsession", removed "lpd_enable="YES"" from the file "/etc/rc.conf", from the file "/etc/rc.conf.ghostbsd" and from the file "/etc/defaults/rc.conf ", etc ...
Running # which lpr :
/usr/bin/lpr
I also rewrote "/etc/printcap" as follows on one line :
lp:lp=:rm=<ip-of-my-printer>:rp=raw:sh:mx#0:sd=/var/spool/lpd/lp:lf=/var/log/lpd-errs:
which allows me to have a blank "chkprintcap".
It is not very clear to me, but the fact is that xsane and its "copy" function are now operational.
So, a big thank you to both of you.
"rc-update add lpd" allows to automatically activate the lpd service at boot (I had stupidly tried rc-service add lpd, of course without success ...).
So, I deleted the content of "~/.xsession", removed "lpd_enable="YES"" from the file "/etc/rc.conf", from the file "/etc/rc.conf.ghostbsd" and from the file "/etc/defaults/rc.conf ", etc ...
Running # which lpr :
/usr/bin/lpr
I also rewrote "/etc/printcap" as follows on one line :
lp:lp=:rm=<ip-of-my-printer>:rp=raw:sh:mx#0:sd=/var/spool/lpd/lp:lf=/var/log/lpd-errs:
which allows me to have a blank "chkprintcap".
It is not very clear to me, but the fact is that xsane and its "copy" function are now operational.
So, a big thank you to both of you.
Re: How to make a photocopy using a USB scanner and a network printer
It should be /usr/local/bin/lpr, this mean that XSane was using /usr/bin/lpr from LPD/LPR instead /usr/local/bin/lpr from CUPS
Renaming /usr/bin/lpr to /usr/bin/lpr.bsd should make XSane work
-
- Posts: 50
- Joined: Thu Oct 29, 2015 3:05 pm
Re: How to make a photocopy using a USB scanner and a network printer
Not sure if the solution is very clean, but it works.
And I don't understand. How to rename ?It should be /usr/local/bin/lpr, this mean that XSane was using /usr/bin/lpr from LPD/LPR instead /usr/local/bin/lpr from CUPS
Renaming /usr/bin/lpr to /usr/bin/lpr.bsd should make XSane work
Re: How to make a photocopy using a USB scanner and a network printer
I am not sure it's going to work since the environment variable PRINTER is not defined
To rename, you need to be root and run the next commands
To rename, you need to be root and run the next commands
Code: Select all
root@computer ~/# cd /usr/bin
root@computer /usr/bin/# mv lpr lpr.bsd
-
- Posts: 50
- Joined: Thu Oct 29, 2015 3:05 pm
Re: How to make a photocopy using a USB scanner and a network printer
OK understood !
Result:
ls /usr/bin/lp
lp* lpq* lpr.bsd.save lpr.bsd* lprm*
ls /usr/local/bin/lp
lp_solve* lpoptions* lpr-cups@ lprm* lpstat*
lp* lpq* lpr* lprsetup.sh*
So,
# which lpr
/usr/local/bin/lpr
And you're right, it's all good for the xsane "copy" function to work.
So I deleted everything I done before.
I can consider this problem as solved (finally !)
Many thanks.
Result:
ls /usr/bin/lp
lp* lpq* lpr.bsd.save lpr.bsd* lprm*
ls /usr/local/bin/lp
lp_solve* lpoptions* lpr-cups@ lprm* lpstat*
lp* lpq* lpr* lprsetup.sh*
So,
# which lpr
/usr/local/bin/lpr
And you're right, it's all good for the xsane "copy" function to work.
So I deleted everything I done before.
I can consider this problem as solved (finally !)
Many thanks.