Network Printer Support?

AmigaOne X1000 platform specific issues.
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Network Printer Support?

Post by Raziel »

my_pc_is_amiga wrote: Not sure if this will work but you can try:

ECHO > PRT: "*E[5*"r*E&l1S"

ESC is *E in shell
and *E[n"r means that this is a raw comand, n is the number of bytes in this case 5 bytes: *E&l1S
My understanding is tha raw means any command going directly to the printer without going to through the printer device
It's throwing out a paper with nothing on.
Unfortunately at least on my printer no setting has been changed either.

But at least it's not printing the command anymore ;-)
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
lucaricossa
Posts: 21
Joined: Mon Jun 20, 2011 1:12 pm
Location: Geneva CH
Contact:

Re: Network Printer Support?

Post by lucaricossa »

I use a Brother HL-4150CDN colour network laser printer. It works like a charm through lpr
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 4:06 pm
Location: North Florida, near the Big Bend

Re: Network Printer Support?

Post by LyleHaze »

lucaricossa wrote:I use a Brother HL-4150CDN colour network laser printer. It works like a charm through lpr
Nice to know. Are you using the standard PostScript driver, or one of the second-party print drivers?
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: Network Printer Support?

Post by xenic »

Raziel wrote:If one of you get that ESC sequence going, let me know.
Here it's only printing it, stupid driver :-)
I wonder if anyone advising you to "echo" an ESC sequence to PRT: has actually tried it. It didn't work for me but I did develop a method that works for me. It a little complicated but I'll try to explain what I did:

First I created a DOS driver for usbprinter.device so that USB could be accessed like old PAR: device. Find a PAR DOSdriver in DEVS: or SYS:Storage and copy PAR & PAR.info to ram: as USBPRT and USBPRT.info. EDIT the USBPRT file and change "StackSize" to a higher value like 16384. Then change "Device" from parallel.device to usbprinter.device. Save USBPRT and open USBPRT.info with Workbench menu Icons/Information and change or add the ACTIVATE tooltype to ACTIVATE=1. Then drag the new USBPRT DOSdriver to SYS:Devs/DOSDrivers. Reboot to activate the DOSdriver. Open a shell and enter "Assign" to check that USBPRT: shows up in the device list.

I've never been able to get escape codes to work on OS4 by using the echo command. Maybe there is a way but I use a workaround of typing the code to USBPRT: instead. Here is a short script I use to end a print session on my HP printer:

; Reset printer after a file is printed
echo "*E%-12345X" TO T:pout NOLINE
type T:pout TO USBPRT:
delete T:pout

The above escape code won't do anything for you but you should be able to change the escape code and use the same technique to send your escape code to your printer
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
danbeaver
Posts: 368
Joined: Thu Jan 19, 2012 9:58 pm
Location: Someplace you'd rather not be
Contact:

Re: Network Printer Support?

Post by danbeaver »

In the DEVS folder is the NSDConfig file that, among other things, is responsible for redirection of devices such as the PAR: to lpr.device; it's use is described in the file itself and the lpr.device docs.

I use it for the statram.device as well to mount a ram-based df1: for use.

I built a file of just the 5 byte codes using filex and tried it to force a duplex from my Dell printer without success. For now I am going back to editing GhostScript commands to get pdf's duplexed.
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Network Printer Support?

Post by Raziel »

@xenic

I tried your test setting but was only able to get an error telling me

"The driver was not able to access the device"

Might be because i don't have a printer on my USB.
The printer is on my network, through a LAN cable directly plugged into the router and can be accessed via html/browser.

I think i will need the server lylehaze was speaking about.

But thank you very much for the idea
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
danbeaver
Posts: 368
Joined: Thu Jan 19, 2012 9:58 pm
Location: Someplace you'd rather not be
Contact:

Re: Network Printer Support?

Post by danbeaver »

I use the standard PostScript driver; although I have TurboPrint V7 which works in OS4, I haven't had to bother with it.

Again, copying or echoing to the PRT: port runs it through the printer driver selected in Prefs (the PRT port is looking for standard Amiga control codes to correct into specific printer codes); I believe raw codes should go through the PAR: port, although my experiments have failed to invoke a duplex mode, as if the printer is only listening for PS codes and not raw escape sequences. Something to mull over as I look through the documentation again.
User avatar
lucaricossa
Posts: 21
Joined: Mon Jun 20, 2011 1:12 pm
Location: Geneva CH
Contact:

Re: Network Printer Support?

Post by lucaricossa »

LyleHaze wrote:
lucaricossa wrote:I use a Brother HL-4150CDN colour network laser printer. It works like a charm through lpr
Nice to know. Are you using the standard PostScript driver, or one of the second-party print drivers?
I use the standard Wb postscript driver and from Amipdf it's own postscript driver.
User avatar
danbeaver
Posts: 368
Joined: Thu Jan 19, 2012 9:58 pm
Location: Someplace you'd rather not be
Contact:

Re: Network Printer Support?

Post by danbeaver »

lucaricossa wrote:
LyleHaze wrote:
lucaricossa wrote:I use a Brother HL-4150CDN colour network laser printer. It works like a charm through lpr
Nice to know. Are you using the standard PostScript driver, or one of the second-party print drivers?
I use the standard Wb postscript driver and from Amipdf it's own postscript driver.
AmiPDF uses a call to GhostScript to print, but it is imbedded in the program so it can't be modified to allow other arguments, such as "-dDUPLEX -dTUMBLE;" this is why I am going to look into a script that can display and print via GhostScript. I'm not sure if FinalWriter uses its own PS engine, but it seems to due so, at least from my casual observation -- ergo, I haven't peeked into its code.
my_pc_is_amiga
Posts: 73
Joined: Sat Dec 08, 2012 7:58 pm

Re: Network Printer Support?

Post by my_pc_is_amiga »

Raziel wrote:
my_pc_is_amiga wrote: Not sure if this will work but you can try:

ECHO > PRT: "*E[5*"r*E&l1S"

ESC is *E in shell
and *E[n"r means that this is a raw comand, n is the number of bytes in this case 5 bytes: *E&l1S
My understanding is tha raw means any command going directly to the printer without going to through the printer device
It's throwing out a paper with nothing on.
Unfortunately at least on my printer no setting has been changed either.

But at least it's not printing the command anymore ;-)

1) I've been playing with the ECHO command and is working with a 932c deskjet (I didn't try the escape command above as I'm not sure if deskjets supports it). But I did try playing around with the PCL character sets and saw a difference. For example with my Amiga set to the ISO-8859-15 character set in Locale Prefs and also the keymap set to the same in Input prefs, I can type the following in the shell:

ECHO > PRT: "*E[5*"r*E(10U¹²³¢€67·«»"

Using the printtofile.device in printer Prefs, I can see how the driver is translating Amiga escape sequences into HP PCL ones without printing. The stuff below in bold is the PCL command I have above and the other things in normal text are coming from the printer prefs settings doing an "init" of the printer.

type hex <name of dumpfile> to see below:

0000: 1B266C32 411B2664 401B266C 36441B28 .&l2A.&d@.&l6D.(
0010: 394E1B28 73306231 30683271 30703073 9N.(s0b10h2q0p0s
0020: 33743075 3132560D 1B2A722D 34551B2A 3t0u12V..*r-4U.*
0030: 7631531B 266C316C 32653630 461B2661 v1S.&l1l2e60F.&a
0040: 346C3734 4D0D1B28 313055B9 B2B3A2A4 4l74M..(10U¹²³¢€
0050: 3637B7AB BB0D0A0C 67·«»...



The ESC(10U is the HP PCL escape sequence to choose the printer's PC-8 character set. If I now send this via lpr.device through my HP printer driver, I won't see ¹²³¢€67·«» but instead the printer will print see some strange symbols. These symbols that are being printed are matching the documentation I have from an old 550C manual for the PC-8 character set.

2) Now what is extremely cool, which I found out, is that character set we choose in the locale prefs is being reflected in what is being sent to the printer in that begining part of init. If you look above there is a ESC(9N command code and if you look here http://pclhelp.com/pcl-symbol-sets/ this corresponds to ISO 8859/15 Latin 9 (W. Eur.) -- which is exactly what I have set to in Locale. Now if I change to ISO 8859-1 in Locale, the command will show ESC(0N, which is the correct one!

3) I'm noticing that printer init is always happening, no matter if I have the "Always Init Printer" ticked or not in printer prefs. On 3.9, I was checking, and after the first init, it doesn't do it again unless I do a "avail flush" and so wondering if this is some behavior related to the new OS4 memory system.


But to bring back to the thread --- I would try to use the printtofile.device and see what escape code is really being sent and then compare the hex to see if it matches to what you are expecting. Escape character is is 1B in hex and is printed as a . in the output.
Post Reply