0

I'm trying to add a printer on a yocto build with cups and the command line. this is the command I'm entering:

sudo lpadmin -p Deskjet_3050A -E -v usb://HP/Deskjet%203050A%20J611%20series?serial=CN15J4C3NF05PJ&interface=1 -m hp-deskjet_3050a_j611_series.ppd

The response I get is:

[1] 566
-sh: -m: command not found

The printer is actually added to the system. but when I try to do a print:

sudo lp -d Deskjet_3050A text.txt

The response is:

request id is Deskjet_3050A-6 (1 file(s))

Which I think means that the print request is send to the printer. The printing does not happen though. I think it has something to do with the ppd-file not being added. Why is -m command not found, the ppd file shows up in the list when I do lpinfo -m

Or is there something missing in the yocto build (cups is added)

Any help is very much appreciated, been losing way to much time on this

Gert Hermans
  • 769
  • 1
  • 9
  • 30
  • 1
    You have an `&` in the url. This is a shell special character that you need to quote, eg with `'&'`. – meuh Feb 24 '21 at 17:44
  • This fixed the command not found issue. thanx, still no printing though, I think it has something to do with the yocto build – Gert Hermans Feb 25 '21 at 09:29

1 Answers1

1

Escaping the special & character as meuh suggested in the comment fixed the 'command not found' issue. After this the printer is still not working though.

I was able to make the printing work when accessing the printer as a network printer (driverless)

First I needed to add some extra cups related recipes to the yocto build

In layer.conf I also need to add the cups-filters recipe:

# Printing
CORE_IMAGE_EXTRA_INSTALL += "cups cups-doc cups-filters"
CORE_IMAGE_EXTRA_INSTALL += "hplip"

When I use this build, the driverless command became available. when I enter 'driverless' as a command i get an ipp uri:

driverless
ipp://SomePrintert%203050A%20J611%20series%20%5B12984C%5D._ipp._tcp.local/

Using the 'lpstat -e' command I got the printer name of the printer that is listening on the network. I think you can use other printer name as well though.

The command to configure the network printer now is:

sudo lpadmin -p {printerName} -E -v {ipp uri} -m everywhere

The printing is now working over the network.

I did not get an usb printer to work yet

Gert Hermans
  • 769
  • 1
  • 9
  • 30