2 2
hallmackenreuther

Banana Pi M1 GMAC won't work with AppleTalk

Recommended Posts

Nope, but since you provided the 'bash -x' output it seems all that has to be changed is the shebang line. In case the first line reads '#!/bin/sh' please change that to '#!/bin/bash' instead.

 

Is there a copyright notice? How old is this script?

 

You mean the script at /usr/lib/cups/backend/pap? It's the one I've downloaded from your website: http://kaiser-edv.rexdev.de/de/tipps-und-tricks/cups/appletalk-backend.html. (You had referred to your site in post #8 a few months ago.) With a few amendments as discussed in this thread since post #25.

 

I've now changed it to '#!/bin/bash'. The 'OffendingCommand' is gone:

$ /usr/lib/cups/backend/pap
network pap "Unknown" "AppleTalk Devices via pap"
%%[ status: idle ]%%
%%[ status: idle ]%%
%%[ status: idle ]%%
%%[ status: idle ]%%
%%[ status: idle ]%%
%%[ status: busy; source: LocalTalk ]%%
%%[ status: busy; source: LocalTalk ]%%
%%[ status: busy; source: LocalTalk ]%%
network pap://A2SERVER/LaserWriter%204%2f600%20PS/LaserWriter "LaserWriter 4/600 PS" "LaserWriter 4/600 PS@A2SERVER (pap)"

The response to '$ /bin/bash -x /usr/lib/cups/backend/pap' didn't change.

 

 

 

Is the following output as it is supposed to be?

$ /bin/bash -x /usr/lib/cups/backend/pap
…

+++ echo -e '%%?BeginFeatureQuery: *Product\nstatusdict begin\nproduct print\nend\n%%?EndFeatureQuery: Unknown\n%%EOF'
%%[ status: idle ]%%
%%[ status: idle ]%%
%%[ status: idle ]%%
%%[ status: idle ]%%
%%[ status: idle ]%%
%%[ status: busy; source: LocalTalk ]%%
%%[ status: busy; source: LocalTalk ]%%
%%[ status: busy; source: LocalTalk ]%%

…

 

As it says "FeatureQuery" here, I suppose it should return somewhat more detailed information and not just the status? Could that be related to the fact that I haven't installed a PPD yet? (I did not yet sort out how to do that …)

Share this post


Link to post
Share on other sites

As it says "FeatureQuery" here, I suppose it should return somewhat more detailed information and not just the status? Could that be related to the fact that I haven't installed a PPD yet? (I did not yet sort out how to do that …)

 

You could also set FullDeviceDiscovery=FALSE (oh dear, last version of my script is almost 13 years old -- please don't assume that I really know what that piece of code is doing ;) ).

 

With FullDeviceDiscovery=TRUE the AppleTalk printer gets queried regarding its so called 'ProductName'. When you integrate my pap backend then this could serve as a hint for CUPS. CUPS calls all active backends at start, if those have implemented device discovery then they search for devices and in this case try also to figure out what's that device internally (since you might name an AppleTalk printer of type "LaserWriter 4/600 PS" also "Foo Bar" so this additional FeatureQuery implements directly talking to the device and asking it 'who are you?').

 

In case your CUPS installation already contains a PPD with a matching 'Product' or 'ModelName' then this PPD will be suggested. If you do not have such a PPD in your system then this step will fail (or is useless).

 

Please see http://www.openprinting.org/ppd-o-matic.php?driver=Postscript&printer=Apple-LaserWriter_4_600&show=1 for a PPD that might match. Next problem could be that this old LaserWriter only is able to understand PostScript LanguageLevel 1 and therefore needs a conversion filter. The openprinting.org PPD above tries to do that (using foomatic, an approach I never liked that much for PostScript devices) and therefore might work.

 

Next step: Open CUPS' web interface and try to add the printer and see how far it goes. In case you want to print from your Armbian box the above PPD might be the right choice (I prefer always using another approach but that's too much for here) in case you're after MacOS nostalgia and want to print from inside Mini vMac or something like that creating a 'raw queue' in CUPS might be the better idea (assigning no PPD means raw) and then you could send unmodified PostScript from a classic MacOS installation through CUPS.

Share this post


Link to post
Share on other sites

You could also set FullDeviceDiscovery=FALSE (oh dear, last version of my script is almost 13 years old -- please don't assume that I really know what that piece of code is doing ;) ).

 

That's okay. I'm happy to try things. By myself I just wouldn't know where to look.

I have now set FullDeviceDiscovery=FALSE.

 

The PPD from openprinting.org wouldn't word for automatic detection. It contains 'LaserWriter 4/600‘ as printer model. 'PS' is missing. It is a PostScript Level 2 printer, so foomatic won't be needed anyway. I have copied the PPD from OS X over to /etc/cups/ppd/.

 

Either RAW or assigning a PPD file would be fine. But when I go to 'Administration' -> 'Add Printer' in CUPS' web interface, I get "Unable to add printer: Forbidden". So following the guide at http://www.topoftheworld.org/linux/laserwriterIIg_cups.htm I created 'printers.conf' at /etc/cups/ and inserted

<DefaultPrinter LaserWriter_4_600_PS>
Info LaserWriter_4_600_PS
DeviceURI pap://LaserWriter%204%2f600%20PS/
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>

After restarting CUPS it recognized the correct PPD and automatically changed printers.conf. I could choose the printer in OS X, but when trying to print nothing arrived at the printer.

I wasn't sure about the slash behind 'DeviceURI pap://LaserWriter%204%2f600%20PS'. I tried both, with the slash and without it. But nothing worked.

 

I can see the printer in CUPS' web interface. But it says: "Unable to get printer status for ":@LaserWriter 4/600 PS""

Share this post


Link to post
Share on other sites

I did now. But doesn't work.

 

That URI is what entering '/usr/lib/cups/backend/pap' returned. But A2SERVER is the machine I am trying to configure as server, NOT the AppleTalk zone. I'm using the standard zone, so it should be pap://*/LaserWriter%204%2f600%20PS/LaserWriter – but that doesn't work either.

 

I'm sure the printer is in the standard zone. 'Cause that's where I can reach it from an old Mac speaking AppleTalk/PAP.

 

If I understand correctly, the URI that '/usr/lib/cups/backend/pap' returnes is wrong. But why? Do you have any idea?

Share this post


Link to post
Share on other sites

No idea, just that the '*' should be URL encoded too: %2a

 

This backend was important maybe 10 years ago when IT departments wanted to ban AppleTalk and users realized that printers didn't work when accessed through TCP/IP. Maybe I'll look into it in a few days/weeks but currently no time for that.

Share this post


Link to post
Share on other sites

DeviceURI according to the above should be pap://A2SERVER/LaserWriter%204%2f600%20PS/LaserWriter instead. Did you try that already?

 

I figured I have to put the DeviceURI like this: LaserWriter%3aLaserWriter%204%2f600%20PS%40A2SERVER. Just 'LaserWriter%204%2f600%20PS' would probably have been enough though.

For now I installed it as RAW printer, so the URI is not relevant for PPD recognition.

 

… A2SERVER is the machine I am trying to configure as server, NOT the AppleTalk zone. … I'm sure the printer is in the standard zone.

 

Actually, the printer appears in any zone. If I add '*' as zone to netatalk, I see the printer in the network twice – once for every zone. So 'A2SERVER' is actually fine. My bad.

 

For me the papwrap.pl backend mentioned earlier in this thread didn't work either. But I found another one with some description here that does the job. Download over here.

As my printer's name is "LaserWriter 4/600 PS", I had to add URL decoding for the slash to the PAP backend (space, colon and @ were already covered). So I added:

| sed -e 's/\%2f///' \

It took me a while to realize that I had to quote the slash with a backslash (I read some explanation online on what 'sed' is used for while trying to understand some of the code of your backend, actually. And that made me realise that in what I had added to the other backend a backslash was missing):

| sed -e 's/\%2f/\//' \

And suddenly I could print!

 

This backend was important maybe 10 years ago when IT departments wanted to ban AppleTalk and users realized that printers didn't work when accessed through TCP/IP. Maybe I'll look into it in a few days/weeks but currently no time for that.

 

That would be great!

 

With the DeviceLookup, your backend is much more automated. I'd really prefer to use that one. Once configured, it should make any PAP printer in the network just show up in the CUPS web interface. This is also important because I want to write a guide for this thing and publish it at emaculation.com. Also on other websites, every now and then there is someone asking how to connect to his AppleTalk printer (well, like the one who started this thread). Especially since Apple removed PAP from Snow Leopard a few years ago.

 

For a while I used SheepShaver with an ethernet bridge for AppleTalk as an LPR print server using Print66. But I had to restart it every time my machine woke up from sleep and it seemed to interfere with Parallels Desktop.

 

I'm sure part of the stuff in this post is not new to you. I explanined it in case someone googling for a solution could find what he needs to know.

 

You wrote that it will take a while until you might find the time to look into the issues with your backend. That's understandable. Once I have written the mentioned guide I will post a link here. I will now buy the hardware for my file and printer server (up 'til now I've worked in a VM for testing).

 

Vielen Dank für deine Hilfe und die Zeit, die du dir genommen hast!

Share this post


Link to post
Share on other sites

Last time I wrote something here I was still working with VM's and testing software components I needed for my system. I have then bought the hardware, compiled Armbian with AppleTalk, and am now finishing the software configuration which made me trying your PAP backend again.

 

In post 31 I pasted the command-line containing the command with the output underneath. I did not paste the new command-line appearing afterwards, but should have actually done that:

…
LaserWriter 4/600 PSuser1@a2server:~$
After appending '>> test' to the command in order to save the output to a file, this is what it looked like in VIM: 
LaserWriter 4/600 PS
~
~
"test" [noeol] 1L, 20C                                        1,1           All
I googled for '[noeol]' and in a forum I found a fix for the missing 'end of line': "sed -e '$a\'" adds a line end in case it's missing. Maybe both sed commands could be merged into one. But I don't know how to do that (sed is fun, but way above me …). The whole command now reads:
echo -e "%%?BeginFeatureQuery: *Product\nstatusdict begin\nproduct print\nend\n%%?EndFeatureQuery: Unknown\n%%EOF" | /usr/bin/timeout -s HUP 15 /usr/local/bin/pap -p "LaserWriter 4/600 PS:LaserWriter@A2SERVER" | sed -e '$a\' | sed 's|^\"(||;s|)\"$||;'
With this fix it is now possible to create the printer from a different computer via the web interface of CUPS by clicking on 'Find New Printers' and assigning the corresponding PPD there manually. But printing from that computer to the shared LW 4/600 PS produces an empty page. However, if I set it up as raw printer and assign the PPD later in OS X, it prints fine.
 
Is it possible to let CUPS choose the correct PPD automatically? I had copied it to /usr/share/ppd/cupsfilters/ on the BPi and restarted CUPS before adding the printer, so it appeared on the list in the CUPS web interface under manufacturer 'Apple'.
 
And how can I find out why, when assigning the PPD on the server side, the printer only produces white pages?

Share this post


Link to post
Share on other sites

@mabam

Realy great article about AppleTalk and the BananaPi!

 

But it is really a shame that these devices are not able to do multicasting in a way that the can handle AppleTalk.  I now have a Orange Pi One, Orange Pi Zero, Pinne64 and all are ruining AppleTalk. I hope someone working on the Ethernet drivers on these boards will pikc up this discussion and fixes this. I don't like to switch to a Raspberry Pi on my projects. I also don't like to stick in a dead cheap USB dongle in these devices if they have a Ethernet devices already on board.

Share this post


Link to post
Share on other sites

Thanks!

 

Things have been sorted out mainly by others. My main contribution was the time it took to gather the required bits of information.

 

Would indeed be great if someone could make the on-board ethernet ports of these devices work for AppleTalk. In my case the adapter would fit perfectly into the housing, as I used the one from my broken Synology NAS. See pics here:

http://www.emaculation.com/forum/viewtopic.php?f=3&p=56492&sid=d0c2882c4f33cdd8930e5f1f01b7b0c5#p55035

Share this post


Link to post
Share on other sites
10 hours ago, op1tjaap said:

You can fix your Banana Pi the same way!

 

This is something completely different here and neither problems nor fixes for H3 devices apply to this different problem (parsing stuff in a script I wrote decades ago)

Share this post


Link to post
Share on other sites

@tkaiser

 

We are talking about two different things. I'm not talking about your scipt.

The initial problem is that eth0 on the Banana Pi doesn't handle appletalk packages well. See the first posting

 

Quote

 

But the Kernel didn´t support AppleTalk, i compiled it in myself successfully.

After i installed Netatalk 2.2.5 and do a nbplkup, the Bpi answers:

 

bananapi:netatalk                           65280.79:4
bananapi:Workstation                        65280.79:4

 

No Printer, no Bridge.

 

I think, the buildin Eth0 dont route AppleTalk Pakets. I tryed Bananian, armbian and strech without success.

 

He doesn't see appletalk devices, like with my problem.

So to make appletalk work on this device i guess you need to fix the driver like I did.

Share this post


Link to post
Share on other sites
On 12/23/2016 at 11:04 PM, mabam said:

And how can I find out why, when assigning the PPD on the server side, the printer only produces white pages?

 

As I didn't know how to fix this problem, I shared the printer as raw printer since two years ago when I set up this system.

But now I want to have the Banana Pi share it via AirPrint in order to print from my iPhone. This only works if the PPD is handled by the CUPS server rather than sharing it raw and assigning the PPD at the client side.

 

It turned out to be a bug. The fix can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=1304869#c12 .

Adding "Option pdftops-renderer pdftops" to /etc/cups/printers.conf produces a PostScript file compatible with a PostScript Level 2 printer like the LaserWriter 4/600 PS. I've just successfully printed a test page from within CUPS.

 

EDIT:

The only difference I noticed so far is that colour conversion to greyscale is a little darker. So when done at the server side there is a different colour profile being used.

 

EDIT 2:

Fixed as of CUPS Filters v1.21.6: https://github.com/OpenPrinting/cups-filters/issues/76.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
2 2