Ricoh_Aficio_SP1XX_CUPS_driver
Ricoh_Aficio_SP1XX_CUPS_driver copied to clipboard
Duplex settings doesn't seem to have effect.
Printing with CUPS, I 've set the printer to duplex, but it outputs all pages. Expected behavior would be to print odd pages and then wait for me to push 'start'. How can I test the duplex setting from command line? Can I test with an LibreOffice .odt ?
ya... duplex is not really implemented in this driver. i checked code, and it just prints even pages and then odd. without any waiting of some "start" button.... but i do not know how to get the "start" button pushed. We must read some replies from the printer, but we do not know its protocol. So it looks the duplex cannot be really implemented...
aah. stop!. there is some flippages commands! i totally forgot details my code!!! i need to dig deeper into the code.
If 'start' button on printer is not working, then maybe this: zenity --info --text 'Please flip pages and click OKE to continue'
look: this is code part of the driver ** if find_option("Duplex=DuplexNoTumble"): __duplex = True elif find_option("Duplex=DuplexTumble"): __duplex = True ** so you see that both options he interprets in same way(becasue i do not know difference :) ) so if you give this substring in manual driver invocation, it must create a file, which can be sent to the printer, and it must wait page flipping.
so: to make duplex print of some TEST_FILE.txt try the next in terminal:
enscript --media=A4 -o - TEST_FILE.txt |python ricoh-sp1xx-drv.py Duplex=DuplexTumble > XXX.OUT
check if XXX.OUT has appeared.
then just send it to the printer:
sudo cat XXX.OUT >/dev/usb/lp0
try it on a short two page file, and report what is going on.
alex.
also there is some trouble in public version of the driver(which i localy fixed) when printer could infinitely print pages, because of wrong params given to him from the cups. i'll upgrade the public version soon.
~/RICOH $ enscript --media=A4 -o - TEST_FILE.TXT |python ricoh-sp1xx-drv.py PageSize=A4 Duplex=DuplexTumble > XXX.OUT [ 2 pages * 1 copy ] left behind in - (FIXME) 14 rules were broken off 4 non-representable characters It did produce a XXX.OUT of 0 bytes.
It does produce DOUT.OUT ~/RICOH $ file DOUT.OUT DOUT.OUT: HP Printer Job Language data
enscript --media=A4 -o - letter.txt |python ricoh-sp1xx-drv.py PageSize=A4 Duplex=DuplexTumble > XXX.OUT [ 1 page * 1 copy ] left in - 13 lines were wrapped
^that what it says to me for some test txt file. it makes binary for printer... your - "14 rules were broken off 4 non-representable characters" who said it? it is not driver. try just (without invoking driver) to create ouput of enscript(give your names to the files) enscript --media=A4 -o - letter.txt > test.out
Yes, it was enscript saying that.
DLOG.LOG looks good: line 53 says @PJL SET MANUALDUPLEX=FLIPSIDE This is not there when I omit Duplex=DuplexTumble I now have a file XXX.OUT but it refuses to copy to /dev/usb/lp0 sudo cat XXX.OUT >/dev/usb/lp0 gives me: permission denied
I solved it for now by the command: su - Output from printer gave me two printed pages, no break in between to flip paper.
check if command (text) exists in the file you're sending to printer: @PJL MANUALDUPLEX=FLIPSIDE open it with some binary editor. it must send printer to wait state, and he will be resumed by start button.
idea of duplex print is simple - i send odd pages to the file, then put this command @pjl MANUALDUPLEX=FLIPSIDE then send even pages. and send file to the printer, at this command he must wait for resume by start button.
http://h10032.www1.hp.com/ctg/Manual/bpl13208 it's reference for better understanding of the printer input file.
MANUALDUPLEX=FLIPSIDE is not in XXX.OUT
source file is longer than single page, there was Duplex=DuplexTumble in command line, and there is no FLIPSIDE inside output? check if file is really longer.
i just tested and there is FLIPSIDE command in my output.
I checked, it is two pages, I inserted the command by editor (nano) but that dit not generate output from the printer. I have to go now, maybe thursday....
ok... test bigger file via command line, for example 10 pages long, produce pjl file and try to find FLIPSIDE over there.
I checked, it is two pages, I inserted the command by editor (nano) but that dit not generate output from the printer. The file starts with: ^[%-12345X@PJL @PJL SET TIMESTAMP=2018/02/09 11:28:56 @PJL SET FILENAME=Duplex=DuplexTumble @PJL SET COMPRESS=JBIG @PJL SET USERNAME=Resolution=600dpi @PJL SET COVER=OFF @PJL SET HOLD=OFF @PJL SET PAGESTATUS=START @PJL SET COPIES=undefined @PJL SET MEDIASOURCE=AUTO @PJL SET MEDIATYPE=PLAINRECYCLE @PJL SET PAPER=A4 @PJL SET PAPERWIDTH=4958 @PJL SET PAPERLENGTH=7016 @PJL SET RESOLUTION=600 @PJL SET IMAGELEN=24687 But there is no "MANUALDUPLEX" in the file. Create with the command: enscript --media=A4 -o - Testfile.pdf |python ricoh-sp1xx-drv-test.py PageSize=A4 Resolution=600dpi Duplex=DuplexTumble > XXX.OUT
Hi Jef I was wrong, the real command is - @PJL SET MANUALDUPLEX=FLIPSIDE it's 3rd command of a piece of my output file: ... @PJL SET DOTCOUNT=777 @PJL SET PAGESTATUS=END @PJL SET MANUALDUPLEX=FLIPSIDE @PJL SET PAGESTATUS=START @PJL SET COPIES=1 @PJL SET MEDIASOURCE=AUTO @PJL SET MEDIATYPE=PLAINRECYCLE @PJL SET PAPER=A4 @PJL SET PAPERWIDTH=4958 @PJL SET PAPERLENGTH=7016 @PJL SET RESOLUTION=600 @PJL SET PURPOSE=MANUALDUPLEXEMPTYPAPER @PJL SET IMAGELEN=27833 ... For better understanding - how i developed the driver. Because format of ricoh printer input file is unknown, i just sniffed usb traffic under windows xp, from the ricoh windows driver. And I've found that to ask printer to wait flip windows driver had inserted command FLIPSIDE between end of odd pages and beginning of even. @PJL SET PAGESTATUS=END @PJL SET MANUALDUPLEX=FLIPSIDE //<---------------- @PJL SET PAGESTATUS=START and i implemented it in my driver. it was quite long ago, but i remember that i tested it. it is interesting, that although my output file has the command, printer does not wait, kinda ignores it...just now i cannot say why. I need to sniff windows driver traffic again and try to understand what is going on.
also the question - which printer model do you have?
line 142 of the driver program: if find_option("Duplex=DuplexNoTumble"): __duplex = True
So the command line option must be "Duplex=DuplexNoTumble" instead of Duplex=DuplexTumble Now this creates the "@pjl SET MANUALDUPLEX" in the file. To print the file I changed to: sudo bash -c 'cat XXX.OUT >/dev/usb/lp0' Maybe you could change this in the README
Jef, my fault.... locally i have more updated driver and there lines are:
#printer duplex mode if find_option("Duplex=DuplexNoTumble"): __duplex = True elif find_option("Duplex=DuplexTumble"): __duplex = True
when I found that CUPS could give also DuplexTimble I added it also in my local copy, but did not push in github.
but even you have FLIPSIDE, printer wait for flip, isn't it?
This is what happens at my SP112 Two blue leds blinking, then page 1 is printed, two blue leds burning continiously, no indicator for flipping pages, I flip page, press 'start' shortly, page two is printed. So, there is no indicator to flip the pages, maybe better to use a dialog?
so seem all is working for you? :) hmm. i never took care about indicators(I do not know how they have to blink :)). i just thought about stop between even and odd pages. Another one hidden problem - you must try not to print from command line, but from cups. i cannot guarantee that cups properly gives DuplexTimble/ DuplexTimble, to the driver.
I think it works from command line but not from CUPS.
Two separate jobs are created, no pause in between.
i do not understand how to use "dialog", because driver just creates a file, and cups sends io the printer, as i understand. when printer prints a first page, driver already exited.
in single print driver cannot create two jobs. kill them all. cups works in next way - it takes file for print, makes with him some magic, or nothing and sends this file to the "filter". filter must convert this file to some format and send it to output. cups takes it and sends to printer. so "filter" is a driver. things we did from command line is primitive emulation of how cups works. there is only couple of differences.
- cups runs driver as "lp" user
- cups calls driver with specific for cups params, when we manually gave proper params to the driver.
try to insert some python code after the first set (odd pages?) are created: cmd = 'zenity --question --text="Do you want to continue?"' subprocess.call(cmd, shell=True) Which line number would be best for this?
there is one critical bug in driver - find this line and comment it!!! __copies=param(4) #number of copies(just a number)
in reality cups calls driver in diffrent way and fourth param could not be really number of copies, but some string or something. because i gave this string as pjl command - number of copies, if it is not a number, ricoh goes mad, and begins to print some unknown number of copies, until the end of paper. so i decided that better to print only one copy in stable way, than to go to infinite print becausue of cups will.