0

Using my BananaPi as a printer server (Armbian Debian 10 (buster))

Ran the following commands:

  • aptitude install cups
  • aptitude install printer-driver-escpr
  • aptitude install hplip
  • aptitude install hpcups

Printers were added to the CUPS server through the webgui. The Epson printer works, but sending jobs to the HP printer causes the following error: stopped "Filter failed" (I did have this working on my raspberry pi at one point, but after an apt-get update/upgrade it started getting the filter error, so I erased the OS and started new on a new device)

All the solutions I could find for this problem seem to indicate I need new drivers.

I found two driver sources for this printer (hp m1319f):

The driver installed by aptitude was 3.18.12. From what I can tell there are no older/newer versions I can choose from in the package manager.

I tried manually downloading the latest hplip and executing the .run file but that results in this:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 70, in <module>
    import traceback
ValueError: bad marshal data (unknown type code)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 70, in <module>
    import traceback
ValueError: bad marshal data (unknown type code)
./hplip-install: line 20: [: : integer expression expected
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 70, in <module>
    import traceback
ValueError: bad marshal data (unknown type code)

If I manually execute ./configure I get the following output:

...
checking for python3 version... 3.7
checking for python3 platform... linux
checking for python3 script directory... ${prefix}/lib/python3.7/site-packages
checking for python3 extension module directory... ${exec_prefix}/lib/python3.7/site-packages
checking for path to Python.h... Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'distutils.sysconfig'
"using  ....  python3.7/Python.h"
checking python3.7/Python.h usability... no
checking python3.7/Python.h presence... no
checking for python3.7/Python.h... no
checking python3.7mu/Python.h usability... no
checking python3.7mu/Python.h presence... no
checking for python3.7mu/Python.h... no
checking python3.7m/Python.h usability... no
checking python3.7m/Python.h presence... no
checking for python3.7m/Python.h... no
configure: error: cannot find python-devel support

However python-dev is already installed, and python-devel doesn't exist.

sudo aptitude  install python-dev
python-dev is already installed at the requested version (2.7.16-1)
python-dev is already installed at the requested version (2.7.16-1)
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

/var/log/cups/error_log:

E [04/Aug/2020:11:33:01 -0400] [Job 12] Job stopped due to filter errors; please consult the /var/log/cups/error_log file for details.
D [04/Aug/2020:11:33:01 -0400] [Job 12] The following messages were recorded from 11:32:38 AM to 11:33:01 AM
D [04/Aug/2020:11:33:01 -0400] [Job 12] Applying default options...
D [04/Aug/2020:11:33:01 -0400] [Job 12] Adding start banner page "none".
D [04/Aug/2020:11:33:01 -0400] [Job 12] Adding end banner page "none".
D [04/Aug/2020:11:33:01 -0400] [Job 12] File of type application/vnd.cups-pdf-banner queued by "bananapi".
D [04/Aug/2020:11:33:01 -0400] [Job 12] hold_until=0
D [04/Aug/2020:11:33:01 -0400] [Job 12] Queued on "HP_LaserJet_M1319f_MFP" by "bananapi".
D [04/Aug/2020:11:33:01 -0400] [Job 12] time-at-processing=1596555158
D [04/Aug/2020:11:33:01 -0400] [Job 12] 4 filters for job:
D [04/Aug/2020:11:33:01 -0400] [Job 12] bannertopdf (application/vnd.cups-pdf-banner to application/pdf, cost 32)
D [04/Aug/2020:11:33:01 -0400] [Job 12] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [04/Aug/2020:11:33:01 -0400] [Job 12] gstoraster (application/vnd.cups-pdf to application/vnd.cups-raster, cost 99)
D [04/Aug/2020:11:33:01 -0400] [Job 12] hpcups (application/vnd.cups-raster to printer/HP_LaserJet_M1319f_MFP, cost 0)
D [04/Aug/2020:11:33:01 -0400] [Job 12] job-sheets=none,none
D [04/Aug/2020:11:33:01 -0400] [Job 12] argv[0]="HP_LaserJet_M1319f_MFP"
D [04/Aug/2020:11:33:01 -0400] [Job 12] argv[1]="12"
D [04/Aug/2020:11:33:01 -0400] [Job 12] argv[2]="bananapi"
D [04/Aug/2020:11:33:01 -0400] [Job 12] argv[3]="Test Page"
D [04/Aug/2020:11:33:01 -0400] [Job 12] argv[4]="1"
D [04/Aug/2020:11:33:01 -0400] [Job 12] argv[5]="job-uuid=urn:uuid:adfed0df-3ddc-3aa7-4824-6e3bd8baa838 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1596555158 time-at-processing=1596555158"
D [04/Aug/2020:11:33:01 -0400] [Job 12] argv[6]="/var/spool/cups/d00012-001"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc-root"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[7]="CUPS_STATEDIR=/run/cups"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[8]="HOME=/var/spool/cups/tmp"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[9]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[10]="SERVER_ADMIN=root@bananapi"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[11]="SOFTWARE=CUPS/2.2.10"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[12]="TMPDIR=/var/spool/cups/tmp"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[13]="USER=root"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[14]="CUPS_MAX_MESSAGE=2047"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[15]="CUPS_SERVER=/run/cups/cups.sock"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[16]="CUPS_ENCRYPTION=IfRequested"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[17]="IPP_PORT=631"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[18]="CHARSET=utf-8"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[19]="LANG=en_US.UTF-8"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[20]="PPD=/etc/cups/ppd/HP_LaserJet_M1319f_MFP.ppd"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[21]="RIP_MAX_CACHE=128m"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[22]="CONTENT_TYPE=application/vnd.cups-pdf-banner"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[23]="DEVICE_URI=hp:/usb/HP_LaserJet_M1319f_MFP?serial=N810GF4"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[24]="PRINTER_INFO=HP LaserJet M1319f MFP"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[25]="PRINTER_LOCATION="
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[26]="PRINTER=HP_LaserJet_M1319f_MFP"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[27]="PRINTER_STATE_REASONS=none"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[28]="CUPS_FILETYPE=document"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[29]="FINAL_CONTENT_TYPE=application/vnd.cups-raster"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[30]="AUTH_I****"
D [04/Aug/2020:11:33:01 -0400] [Job 12] Started filter /usr/lib/cups/filter/bannertopdf (PID 2147)
D [04/Aug/2020:11:33:01 -0400] [Job 12] Started filter /usr/lib/cups/filter/pdftopdf (PID 2148)
D [04/Aug/2020:11:33:01 -0400] [Job 12] Started filter /usr/lib/cups/filter/gstoraster (PID 2149)
D [04/Aug/2020:11:33:01 -0400] [Job 12] Started filter /usr/lib/cups/filter/hpcups (PID 2150)
D [04/Aug/2020:11:33:01 -0400] [Job 12] Started backend /usr/lib/cups/backend/hp (PID 2151)
D [04/Aug/2020:11:33:01 -0400] [Job 12] pdftopdf: Last filter determined by the PPD: hpcups; FINAL_CONTENT_TYPE: application/vnd.cups-raster => pdftopdf will not log pages in page_log.
D [04/Aug/2020:11:33:01 -0400] [Job 12] OUTFORMAT=\"(null)\", so output format will be CUPS/PWG Raster
D [04/Aug/2020:11:33:01 -0400] [Job 12] PDF template file doesn\'t have form. It\'s okay.
D [04/Aug/2020:11:33:01 -0400] [Job 12] PID 2147 (/usr/lib/cups/filter/bannertopdf) exited with no errors.
D [04/Aug/2020:11:33:01 -0400] [Job 12] PID 2148 (/usr/lib/cups/filter/pdftopdf) exited with no errors.
D [04/Aug/2020:11:33:01 -0400] [Job 12] Color Manager: Calibration Mode/Off
D [04/Aug/2020:11:33:01 -0400] [Job 12] Calling FindDeviceById(cups-HP_LaserJet_M1319f_MFP)
D [04/Aug/2020:11:33:01 -0400] [Job 12] Failed to send: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
D [04/Aug/2020:11:33:01 -0400] [Job 12] Failed to get find device cups-HP_LaserJet_M1319f_MFP
D [04/Aug/2020:11:33:01 -0400] [Job 12] Calling FindDeviceById(cups-HP_LaserJet_M1319f_MFP)
D [04/Aug/2020:11:33:01 -0400] [Job 12] Failed to send: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
D [04/Aug/2020:11:33:01 -0400] [Job 12] Failed to get device cups-HP_LaserJet_M1319f_MFP
D [04/Aug/2020:11:33:01 -0400] [Job 12] Color Manager: no profiles specified in PPD
D [04/Aug/2020:11:33:01 -0400] [Job 12] Set job-printer-state-message to "Color Manager: no profiles specified in PPD", current level=INFO
D [04/Aug/2020:11:33:01 -0400] [Job 12] Color Manager: ICC Profile: None
D [04/Aug/2020:11:33:01 -0400] [Job 12] Ghostscript using Any-Part-of-Pixel method to fill paths.
D [04/Aug/2020:11:33:01 -0400] [Job 12] Ghostscript command line: gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dShowAcroForm -sstdout=%stderr -sOutputFile=%stdout -sDEVICE=cups -sMediaType=Plain -sOutputType=0 -r600x600 -dMediaPosition=7 -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -dcupsBitsPerColor=1 -dcupsColorOrder=0 -dcupsColorSpace=3 -dcupsRowCount=1 -dcupsRowStep=2 -dcupsInteger0=1 -scupsPageSizeName=Letter -I/usr/share/cups/fonts -c \'<</.HWMargins[18.000000 15.500000 18.000000 15.500000] /Margins[0 0]>>setpagedevice\' -f -_
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[0]=\"CUPS_CACHEDIR=/var/cache/cups\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[1]=\"CUPS_DATADIR=/usr/share/cups\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[2]=\"CUPS_DOCROOT=/usr/share/cups/doc-root\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[3]=\"CUPS_FONTPATH=/usr/share/cups/fonts\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[4]=\"CUPS_REQUESTROOT=/var/spool/cups\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[5]=\"CUPS_SERVERBIN=/usr/lib/cups\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[6]=\"CUPS_SERVERROOT=/etc/cups\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[7]=\"CUPS_STATEDIR=/run/cups\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[8]=\"HOME=/var/spool/cups/tmp\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[9]=\"PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[10]=\"SERVER_ADMIN=root@bananapi\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[11]=\"SOFTWARE=CUPS/2.2.10\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[12]=\"TMPDIR=/var/spool/cups/tmp\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[13]=\"USER=root\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[14]=\"CUPS_MAX_MESSAGE=2047\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[15]=\"CUPS_SERVER=/run/cups/cups.sock\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[16]=\"CUPS_ENCRYPTION=IfRequested\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[17]=\"IPP_PORT=631\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[18]=\"CHARSET=utf-8\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[19]=\"LANG=en_US.UTF-8\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[20]=\"PPD=/etc/cups/ppd/HP_LaserJet_M1319f_MFP.ppd\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[21]=\"RIP_MAX_CACHE=128m\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[22]=\"CONTENT_TYPE=application/vnd.cups-pdf-banner\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[23]=\"DEVICE_URI=hp:/usb/HP_LaserJet_M1319f_MFP?serial=N810GF4\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[24]=\"PRINTER_INFO=HP LaserJet M1319f MFP\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[25]=\"PRINTER_LOCATION=\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[26]=\"PRINTER=HP_LaserJet_M1319f_MFP\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[27]=\"PRINTER_STATE_REASONS=none\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[28]=\"CUPS_FILETYPE=document\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[29]=\"FINAL_CONTENT_TYPE=application/vnd.cups-raster\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] envp[30]=\"AUTH_INFO_REQUIRED=none\"
D [04/Aug/2020:11:33:01 -0400] [Job 12] Start rendering...
D [04/Aug/2020:11:33:01 -0400] [Job 12] Set job-printer-state-message to "Start rendering...", current level=INFO
D [04/Aug/2020:11:33:01 -0400] [Job 12] Processing page 1...
D [04/Aug/2020:11:33:01 -0400] [Job 12] Set job-printer-state-message to "Processing page 1...", current level=INFO
D [04/Aug/2020:11:33:01 -0400] [Job 12] STATE: +connecting-to-device
D [04/Aug/2020:11:33:01 -0400] [Job 12] STATE: +hplip.plugin-error
D [04/Aug/2020:11:33:01 -0400] [Job 12] prnt/hpcups/HPCupsFilter.cpp 489: m_Job initialization failed with error = 48
D [04/Aug/2020:11:33:01 -0400] [Job 12] double free or corruption (!prev)
D [04/Aug/2020:11:33:01 -0400] [Job 12] PID 2150 (/usr/lib/cups/filter/hpcups) crashed on signal 6.
D [04/Aug/2020:11:33:01 -0400] [Job 12] Hint: Try setting the LogLevel to "debug" to find out more.
D [04/Aug/2020:11:33:01 -0400] [Job 12] Processing page 2...
D [04/Aug/2020:11:33:01 -0400] [Job 12] STATE: -connecting-to-device
D [04/Aug/2020:11:33:01 -0400] [Job 12] STATE: -media-empty-error,media-jam-error,hplip.plugin-error,cover-open-error,toner-empty-error,other
D [04/Aug/2020:11:33:01 -0400] [Job 12] Rendering completed
D [04/Aug/2020:11:33:01 -0400] [Job 12] PID 2149 (/usr/lib/cups/filter/gstoraster) exited with no errors.
D [04/Aug/2020:11:33:01 -0400] [Job 12] prnt/backend/hp.c 376: read new pjl status: 10023
D [04/Aug/2020:11:33:01 -0400] [Job 12] prnt/backend/hp.c 378: read pjl job_end: 0
D [04/Aug/2020:11:33:01 -0400] [Job 12] prnt/backend/hp.c 376: read new pjl status: 10001
D [04/Aug/2020:11:33:01 -0400] [Job 12] ready to print
D [04/Aug/2020:11:33:01 -0400] [Job 12] PID 2151 (/usr/lib/cups/backend/hp) exited with no errors.
D [04/Aug/2020:11:33:01 -0400] [Job 12] End of messages
D [04/Aug/2020:11:33:01 -0400] [Job 12] printer-state=3(idle)
D [04/Aug/2020:11:33:01 -0400] [Job 12] printer-state-message="ready to print"
D [04/Aug/2020:11:33:01 -0400] [Job 12] printer-state-reasons=none

The ppd from openprinting doesn't fix the problem either.

One oddity I noticed is that driver says my printer is color: (HP LaserJet m1319f MFP, hpcups 3.18.12, requires proprietary plugin (color, 2-sided printing))

I am stumped. I saw this solution for bad marshal data, but I don't it will work in my case: https://stackoverflow.com/questions/30861493/how-to-fix-python-valueerrorbad-marshal-data

2
  • Do you have hpcups installed in addition to hplip?
    – Ned64
    Aug 4, 2020 at 16:49
  • @Ned64 I didn't specifically install it, but it is installed. (3.18.12+dfsg0-2) Aug 5, 2020 at 0:21

2 Answers 2

1
wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
tar zxf foo2zjs.tar.gz
cd foo2zjs
make
sudo make install
sudo make cups

This solved the issue. http://foo2zjs.rkkda.com/

2
  • 3
    Please explain the purpose of the commands you have included in your answer. Most importantly, explain why should anyone trust to run the script downloaded from a seemingly random website on their computer as root. Apr 19, 2021 at 18:12
  • Actually it is the right answer for me. In my occasion, foo2zjs will install the HP 1020 driver correctly. In the web GUI, when choosing printer driver, there will be a (recommended) foo2zjs version driver at hand. The default HP driver, seems not working at all.
    – spikeyang
    Oct 7, 2022 at 2:56
1

You gotta check system journal, it's likely that the plugin is outdated compared to hpcups version:

hpcups[1888334]: common/utils.c 140: validate_plugin_version() Plugin version[3.21.2] mismatch with HPLIP version[3.22.10]
hpcups[1888334]: common/utils.c 173: Plugin version is not matching
hpcups[1888334]: prnt/hpcups/HPCupsFilter.cpp 505: m_Job initialization failed with error = 48
hpcups[1888334]: common/utils.c 244: Invalid Library handler pLibHandler = NULL.

In which case you just need to run hp-setup -i in order to update it. You don't need to switch to the foo2zjs driver or anything like that like the other answer suggested...

1
  • This solved my problem in 2024: hplip 3.23.12, ubuntu 22.04, HP Laserjet 1020.
    – Dɑvïd
    Feb 9 at 16:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .