Jump to content

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 …)

Link to comment
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""

Link to comment
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?

Link to comment
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!

Link to comment
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?
Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines