vaginessa / ricoh-sp112-ppd

5 stars 3 forks source link

SP 112 Driver #1

Open bieniekmateusz opened 4 years ago

bieniekmateusz commented 4 years ago

Hi there, thanks for making the repo.

I followed the instructions to no avail. There is nothing in the log. However, this is in the /tmp directory:

ls -la /tmp/pstoricohddst-gdi*
/tmp/pstoricohddst-gdi-1fcecc88-92df-407c-8bfb-ce6cef422484:
total 0
drwx------  2 cups cups  40 Jun  3 15:19 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..

/tmp/pstoricohddst-gdi-316443b9-b218-4f15-aab4-e8f656950a04:
total 0
drwx------  2 cups cups  40 Jun  3 14:57 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..

/tmp/pstoricohddst-gdi-54af4e1f-bbd8-4986-92c4-eeeea356fcbc:
total 4
drwx------  2 cups cups  60 Jun  3 15:37 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..
-rw-------  1 cups cups 545 Jun  3 15:37 output.stream

/tmp/pstoricohddst-gdi-6b76df29-48cd-44f9-ac41-9d8b0f322efe:
total 0
drwx------  2 cups cups  40 Jun  3 15:06 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..

/tmp/pstoricohddst-gdi-6b821bdb-a8da-4d39-bc3a-3754766a1a11:
total 0
drwx------  2 cups cups  40 Jun  3 15:28 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..

/tmp/pstoricohddst-gdi-720125c8-f098-4f8e-b063-f8b156f4454d:
total 0
drwx------  2 cups cups  40 Jun  3 15:22 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..

/tmp/pstoricohddst-gdi-9d2ff6eb-efb2-46a7-809f-7743f096decb:
total 0
drwx------  2 cups cups  40 Jun  3 15:23 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..

/tmp/pstoricohddst-gdi-af33c892-670f-4102-976f-329b3c9a8c32:
total 0
drwx------  2 cups cups  40 Jun  3 15:05 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..

/tmp/pstoricohddst-gdi-b5c283e5-4a44-42d0-87c4-4aa98f9a2e6f:
total 4
drwx------  2 cups cups  60 Jun  3 15:32 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..
-rw-------  1 cups cups 545 Jun  3 15:32 output.stream

/tmp/pstoricohddst-gdi-ba7559b2-fab0-4e37-9780-f7d77f23328b:
total 0
drwx------  2 cups cups  40 Jun  3 15:18 .
drwxrwxrwt 35 root root 760 Jun  3 15:37 ..

The output.stream file contains this:

cat output.stream 
%%[ Error handled by opdfread.ps : invalidfileaccess; OffendingCommand: showpage ]%%
2345X@PJL
@PJL SET TIMESTAMP=2020/06/03 15:32:00
@PJL SET FILENAME=Document
@PJL SET COMPRESS=JBIG
@PJL SET USERNAME=dresio
@PJL SET COVER=OFF
@PJL SET HOLD=OFF
@PJL SET PAGESTATUS=START
@PJL SET COPIES=1
@PJL SET MEDIASOURCE=TRAY1
@PJL SET MEDIATYPE=PLAINRECYCLE
@PJL SET PAPER=A4
@PJL SET PAPERWIDTH=
@PJL SET PAPERLENGTH=
@PJL SET RESOLUTION=600
@PJL SET IMAGELEN=
@PJL SET DOTCOUNT=1132782
@PJL SET PAGESTATUS=END
@PJL EOJ
2345X

Do you have any hints about how to solve this? Thanks

Linux: Arch

ImagicTheCat commented 2 years ago

Hi, we are probably experiencing the same issue, I solved it for the Ricoh SP112SU. This fixes the ghost script SAFER/NOSAFER new policy issue, see https://ghostscript.com/doc/current/Use.htm.

diff --git a/pstoricohddst-gdi b/pstoricohddst-gdi
index f86f9b6..e252b37 100755
--- a/pstoricohddst-gdi
+++ b/pstoricohddst-gdi
@@ -133,7 +133,7 @@ EOF

        # Converting from PostScript to PostScript-monochrome, then to PBM image format (per page)
        #gs -sDEVICE=ps2write -sOutputFile=- -r$resolution -dQUIET -dBATCH -dNOPAUSE - |
-       gs -sDEVICE=pbmraw -sOutputFile=${uid}/%03d-page.pbm -r$resolution -dQUIET -dBATCH -dNOPAUSE -
+       gs --permit-file-all=${uid}/ -sDEVICE=pbmraw -sOutputFile=${uid}/%03d-page.pbm -r$resolution -dQUIET -dBATCH -dNOPAUSE -

        stop
        wait
@@ -144,7 +144,7 @@ EOF

        # Converting from PostScript to PostScript-monochrome, then to PBM image format (per page)
        log "Converting document to pages"
-       gs -sDEVICE=ps2write -sOutputFile=- -r$resolution -dQUIET -dBATCH -dNOPAUSE - | gs -sDEVICE=pbmraw -sOutputFile=${uid}/%03d-page.pbm -r$resolution -dQUIET -dBATCH -dNOPAUSE -
+       gs -sDEVICE=ps2write -sOutputFile=- -r$resolution -dQUIET -dBATCH -dNOPAUSE - | gs --permit-file-all=${uid}/ -sDEVICE=pbmraw -sOutputFile=${uid}/%03d-page.pbm -r$resolution -dQUIET -dBATCH -dNOPAUSE -
        log "Conversion complete"

        cat <<EOF

The lack of error propagation is not good.

gilex-dev commented 1 year ago

@bieniekmateusz did you ever got it working? I tried

Only the last two versions worked (I tried an older one because I had it working on a Raspberry Pi a couple of years ago) I'm planning to use a cheap Raspberry Pi Zero as an IPP print server (Under Fedora the Generic IPP Everywhere Driver worked and under Windows 10 one got installed automatically). Even printing from an old Phone (Android 8.0) worked like a charm. The only thing not working is the page count in the CUPS web-interface, but you can't have everything.

Here are the basic steps that got it working

assuming pi is the user

sudo apt update
sudo apt install git jbigkit-bin ghostscript imagemagick inotify-tools cups samba smbclient -y # I think the smb/samba packages are not necessary
git clone https://github.com/vaginessa/ricoh-sp112-ppd
cd ricoh-sp112-ppd
./check-requirements
sudo cp pstoricohddst-gdi /usr/lib/cups/filter
sudo usermod -a -G lpadmin pi # not sure if necessary
cupsctl --remote-admin --remote-any --share-printers # only when you want to print/administer from a different machine

Select yes when asked to install dhcp package ./check-requirements asks for pbmtojbg but for Fedora/RaspiOS it is jbigkit/jbigkit-bin ./check-requirements asks for identify but for Fedora/RaspiOS it is ImageMagick/imagemagick

Typo?

I noticed a small typo/error in https://github.com/vaginessa/ricoh-sp112-ppd/blob/a71ade36f229bea2a016e460b718958d895418fe/RICOH_Aficio_SP_112.ppd#L123 The line should be *% End of rsp112.ppd, 06096 bytes. like here: https://github.com/vaginessa/ricoh-sp112-ppd/blob/a71ade36f229bea2a016e460b718958d895418fe/RICOH_Aficio_SP_112.ppd#L8 right? But I think this does not matter.

Output of ./check-requirements

pbmtojbg     [REQUIRED] : Yes, version: PBMtoJBIG converter 2.1 -- creates bi-level image entity (BIE) as output file
identify     [REQUIRED] : Yes, version: Version: ImageMagick 6.9.10-23 Q16 arm 20190101 https://imagemagick.org
Ghostscript  [REQUIRED] : Yes, version: 9.27
ps2write     [REQUIRED] : Yes
pbmraw       [REQUIRED] : Yes
inotify-wait [optional] : Yes, version: inotifywait 3.14

...and CUPS is version 2.2.10

Hope this helps someone!

fraoustin commented 2 weeks ago

Have you a solution ?