Jump to content

Banana Pi M1 GMAC won't work with AppleTalk


Recommended Posts

Hi to all,

 

i´d try to setup a Banana PI M1 as AppleTalk Printserver because my old LaserWriter 4/600 only got a LocalTalk

Interface.

 

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.

 

So, what shall i do?

 

Hallmackenreuther

Link to comment
Share on other sites

I wouldn't count on Allwinner's BSP kernels for AppleTalk. Please read through http://forum.armbian.com/index.php/topic/932-appletalk-on-an-orange-pi-one/first and then think about rebuilding the kernel relying on sunxi-next and building AppleTalk as a module. At least then the problem you face (most probably f*cked up multicast handling) has to disappear.

 

EDIT: Should just work: https://github.com/igorpecovnik/lib/blob/master/config/kernel/linux-sunxi-next.config#L1137

I will compile a new kernel with your kernel.config later.

I already read the http://forum.armbian...-orange-pi-one/ Post but it´s for an Orange Pi (another fine chinese Product),

with a different SoC.

Anyway, thanks a lot for your help. Hope it will work.

Link to comment
Share on other sites

Wow, if your expectations are already that low why bothering with this stuff at all?

 

Try to use the vanilla image that has been compiled with the aforementioned settings since all that's needed should be a loaded appletalk module.

LOL, the OPi uses a differnt SoC as a BPi. So i expected that it won´t compile correct.

Link to comment
Share on other sites

Oops, and one additional information since I just did an upgrade at a customer's server (x86_64 running Linux). I shut down a virtual OS X machine there  since we moved all known service to the Linux box before... just to get now complaints that the office staff isn't able to print. Then I realized that we use on the Linux host an IPP queue to print to the aforementioned OS X VM and there the print job will be sent to the old Apple LaserWriter through PAP/AppleTalk (first thought: WTF?!)

 

And then I realized the reason why: Since PAP on Linux sucks :)

 

Especially at this specific customer we had kernel oops a decade ago and this only stopped after we stopped using PAP on Linux. Other customers moved back to Solaris with their servers and the only Linux customer that has no problems used SuSE (they ship with a kernel that seems to have fixed these issues).

 

So in case you're able to fix the multicast issue using our Armbian vanilla image with AppleTalk support you still might run in further troubles when trying to actually print.

 

BTW: I've been in the Netatalk 2.x developer team ages ago and wrote a simple AppleTalk CUPS backend back then that should still work flawlessly: https://translate.google.com/translate?sl=de&tl=en&js=y&prev=_t&hl=de&ie=UTF-8&u=http%3A%2F%2Fkaiser-edv.rexdev.de%2Fde%2Ftipps-und-tricks%2Fcups%2Fappletalk-backend.html&edit-text=

 

Please report back if you run into troubles...

I setup a RPi b+ as a Bonjour/IPP to EtherTalk Printserver with cups, netatalk 2.2.5 and Raspbian Wheezy.

It works without a glitch and prints from all my maschines.

I know your PAP Backend for a log time. It´s the Backend i use. Nice Work, thanks alot.

 

Somebody gave me the Bpi and i thought i´ll give it a try.

Link to comment
Share on other sites

Please report back whether you get it running or not (I doubt it will work using Allwinner's legacy kernel -- the SoC in questions doesn't matter that much since Allwinner started with the same kernel sources including same bugs for both sun7i and sun8i architecture).

 

I'm thinking about adding a networking.md to our documentation that should then also cover these AppleTalk basics (including the requirement to choose vanilla kernel on Allwinner hardware) amongst other things for example explaining the difference between bridging and routing. All this stuff is not really specific to SBCs but questions come in constantly so better document the necessary stuff in one place instead of answering forum questions again and again :)

I will later compile a vanilla kernel, hope it fix all Problems.

A AppleTalk doc would be great. I know it, ´cos i read the whole Netatalk man pages. And sometimes they are hard to understand.

Anyway, i report back what´s going on.

Thanks for your support.

Link to comment
Share on other sites

While I still don't understand why you want to compile anything (it should work by using a stock Armbian vanilla image that uses sunxi-next mainline kernel and then adding appletalk to /etc/modules) I fear that I'm able to improve networking documentation to be better understandable (since most if not all AppleTalk related netatalk docs have been written by me ;) )

 

In fact the Armbian networking documentation would just give some examples (printing to a PAP printer as nice use case for something like an 'IPP to AppleTalk' gateway using an Orange Pi One) and link to the outdated Netatalk 2.2 docs for details.

Hi tkaiser,

i installed as advised Armbian jessie vanilla. loaded the AppleTalk kernel module and....

bananapipro:netatalk                           65280.18:4

bananapipro:Workstation                        65280.18:4

 

thats all, as before.

:(

 

sudo armbianmonitor -u -> http://sprunge.us/jCVK

Link to comment
Share on other sites

I had the same kind of strange behavior with AppleTalk. You should to set your eth0 to promisc mode for a try. After that you might see al your devices.

If the Bpi can use the same Armbian as the Opi 1 you could use my image.

Link to comment
Share on other sites

I had the same kind of strange behavior with AppleTalk. You should to set your eth0 to promisc mode for a try. After that you might see al your devices.

If the Bpi can use the same Armbian as the Opi 1 you could use my image.

Hi,

i try the promiscuous mode on Eth0. No change at all. No Printer, No Bridge.

BTW your image won´t boot at all in an BPi.

Link to comment
Share on other sites

Before i got completly mad, i attached like "op1tjaap" an usb to ehternet adapter i found somewere in a box.

And then some magic appears and all my AppleTalk devices showed up. :D

So i think, why not bridge eth0(BPi) and eth1(USB) ? I connected eth1 only to the EtherTalk bridge.

That´s no problem. all set und fired up and...... my Appletalk devices are gone.

Also not a solution. :angry:

Of course not. the eth0 of the BPi don´t route a single bit of AppleTalk.

So i disconnected eth0 and use only eth1.

But anyway, thanks alot for refresh my AppleTalk knowledge. It´s a long time since...... man, i´m old.

Link to comment
Share on other sites

Well, I fear I have to disagree since routing and bridging is absolutely different stuff ;)

For shure, it is. i mean the eth driver.  :D

 

Note to myself: Mainline Ethernet driver for H3 is confirmed to work regarding AppleTalk service discovery (and that's most likely multicast related) and for A20 not.

 

Maybe some day i´ll find some time left to give the A20 Ethernet driver a bang.

 

Link to comment
Share on other sites

I had the same problem on my Orange Pi One. I compiled a 3.4.110 kernel as you would need to do it. With appletalk.ko module. But no way I got it going. I was also seeing the device itself. I could see the AppleTalk packages coming in (with tcpdump) but netatalk could see anything, tkaiser idea that maybe the Allwinner employees don't know what AppleTalk is and totally forgot to add it in their driver.

 

Only, with the help of tkaiser I could use the newly mainline kernel 4.6.0 it worked (BTW I used the promisc tric on my NTC C.H.I.P.).

 

The problem with the 4.6.0 kernel is that there are lots of RX errors. So much that after two days you will be out of network do you need to reboot.. My hope is that this will be fixed. Then I will have a perfect SoC as AppleTalk router and network server! A quad core for $9.95

I already claimed a name for this device; MacPi :-)

Link to comment
Share on other sites

to tkaiser,

i just take a look at the pap Backend i use. It´s not the one you wrote ´cos it didn´t work anymore.

The pap Backend i use is named papwrap.pl. it did not detect pap printer to cups by itself.

But if you setup the pap printer manually it works.

 

Maybe you can fix you pap backend.

 

your pap says:

 

pi@bananapi:~$ /usr/lib/cups/backend/pap
network pap "Unknown" "AppleTalk Devices via pap"
atp_rresp: Connection timed out
/usr/bin/timeout: failed to run command `--': No such file or directory
-e network pap://%2a/Frodo/LaserWriter "Unknown" "Frodo@* (pap)"
 

Link to comment
Share on other sites

 

Nope, no AppleTalk devices around. But you could give this a try and might be able to resolve the problem on your own:

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

 

I have the same printer (LW 4/600 PS) and am trying the same thing. Except I have never done something like this before and barely know what I'm doing.

 

At first I got an error running your command after installing your pap backend. After amending 'pap' to reflect my netatalk installation path (NetatalkBinDir=/usr/local/bin) the error disappeared.

 

Your backend says:

$ sudo /usr/lib/cups/backend/pap
network pap "Unknown" "AppleTalk Devices via pap"
/usr/lib/cups/backend/pap: 1: /usr/lib/cups/backend/pap: /usr/local/bin/timeout: not found
-e network pap://A2SERVER/LaserWriter%204%2f600%20PS/LaserWriter "Unknown" "LaserWriter 4/600 PS@A2SERVER (pap)"

papwrap.pl says:

$ sudo /usr/lib/cups/backend/pap
network pap://LaserWriter%204%2f600%20PS "Unknown" "PAP Printer 'LaserWriter 4/600 PS'"
network pap "Unknown" "Macintosh-compatible Printer via PAP"

I don't know what that means and which way to go.

Anyone who is willing to help and possibly answer 'stupid' questions as they arise?

Link to comment
Share on other sites

Bad style in my backend, expects the timeout binary at a fixed location. Either you change that inside /usr/lib/cups/backend/pap (remove '/local' since it's /usr/bin/timeout on recent distros Armbian uses) or you set a symlink.

 

Under the line "NetatalkBinDir=/usr/local/bin" I have added "TimeoutDir=/usr/bin" and changed "${NetatalkBinDir}/timeout'" to "${TimeoutDir}/timeout'" in the appropriate line.

 

Now it says:

$ /usr/lib/cups/backend/pap
network pap "Unknown" "AppleTalk Devices via pap"
/usr/bin/timeout: failed to run command `--': No such file or directory
-e network pap://A2SERVER/LaserWriter%204%2f600%20PS/LaserWriter "Unknown" "LaserWriter 4/600 PS@A2SERVER (pap)"

"/bin/bash -x /usr/lib/cups/backend/pap" returns:

$ /bin/bash -x /usr/lib/cups/backend/pap
+ devicetypes=LaserWriter
+ formfeed=FALSE
+ NetatalkBinDir=/usr/local/bin
+ TimeoutDir=/usr/bin
+ FullDeviceDiscovery=TRUE
+ ExaktPageCount=FALSE
+ main
+ CollectAccountingData
++ DecodeDeviceURI
++ perl -ple 's/%([0-9A-Fa-f]{2})/chr(hex($1))/eg'
++ awk -F/ '{print $4 ":" $5 "@" $3}'
++ echo
+ PrinterName=:@
+ Owner=
+ Title=
+ NeededCopies=
+ eval ParseCUPSOptions
++ ParseCUPSOptions
++ i='com\.apple\.print\.'
++ '[' 0 -ge 1 ']'
+ PrepareRequest
++ basename /usr/lib/cups/backend/pap
+ protocol=pap
+ case `uname -s` in
++ uname -s
+ '[' '!' -x /usr/local/bin/papstatus ']'
+ ZoneLookup=/usr/local/bin/getzones
+ ATPErrMsg='atp_rresp\:\ Connection\ timed\ out'
+ TotalPages=1
+ IFS='
'
+ test 0 = 0
+ echo 'network pap "Unknown" "AppleTalk Devices via pap"'
network pap "Unknown" "AppleTalk Devices via pap"
+ uniq
+ sort
+ LookupDevices
++ GetZoneList
++ eval /usr/local/bin/getzones
+++ /usr/local/bin/getzones
++ '[' 0 -eq 0 ']'
++ sed 's|atp_rresp\:\ Connection\ timed\ out|*|;'
++ eval /usr/local/bin/getzones
+ zonelist='+++ /usr/local/bin/getzones
A2SERVER'
+ OIFS='
'
+ IFS=:
+ set LaserWriter
+ IFS='
'
+ for devicetype in '$@'
+ read zone
+ echo '+++ /usr/local/bin/getzones
A2SERVER'
+ read zone
+ read zone
+ read nbpentry
+ NBPLookup =:LaserWriter@A2SERVER
+ read nbpentry
+ perl -ne 'chomp; next if /^$/; m|^\s+(.+)\s+\d+\.\d+:|; my $entry = $1; $entry =~ s/\s+$//; print "$entry\n"'
+ NBPLookup '=:LaserWriter@+++ /usr/local/bin/getzones'
+ /usr/local/bin/nbplkup =:LaserWriter@A2SERVER
+ perl -ne 'chomp; next if /^$/; m|^\s+(.+)\s+\d+\.\d+:|; my $entry = $1; $entry =~ s/\s+$//; print "$entry\n"'
+ /usr/local/bin/nbplkup '=:LaserWriter@+++ /usr/local/bin/getzones'
+ read nbpentry
+ GetPrinterProperties 'LaserWriter 4/600 PS:LaserWriter' A2SERVER pap
++ awk -F: '{print $1}'
++ echo 'LaserWriter 4/600 PS:LaserWriter'
+ name='LaserWriter 4/600 PS'
++ awk -F: '{print $2}'
++ echo 'LaserWriter 4/600 PS:LaserWriter'
+ type=LaserWriter
++ CheckProductName 'LaserWriter 4/600 PS' LaserWriter A2SERVER
++ GuessedDeviceType=Unknown
++ '[' LaserWriter = LaserWriter -a TRUE = TRUE ']'
++ /usr/local/bin/papstatus -p 'LaserWriter 4/600 PS:LaserWriter@A2SERVER'
+++ sed 's|^\"(||;s|)\"$||;'
+++ /usr/bin/timeout -s HUP 15 -- /usr/local/bin/pap -p 'LaserWriter 4/600 PS:LaserWriter@A2SERVER'
+++ echo -e '%%?BeginFeatureQuery: *Product\nstatusdict begin\nproduct print\nend\n%%?EndFeatureQuery: Unknown\n%%EOF'
/usr/bin/timeout: failed to run command `--': No such file or directory
++ DeviceLookup=
++ '[' -n '' ']'
++ echo Unknown
+ model=Unknown
++ EncodeDeviceURI A2SERVER
++ perl -ple 's|([^\w=\-:@])|sprintf( "%%%02x", ord( $1))|ge'
++ echo A2SERVER
++ EncodeDeviceURI 'LaserWriter 4/600 PS'
++ perl -ple 's|([^\w=\-:@])|sprintf( "%%%02x", ord( $1))|ge'
++ echo 'LaserWriter 4/600 PS'
++ EncodeDeviceURI LaserWriter
++ perl -ple 's|([^\w=\-:@])|sprintf( "%%%02x", ord( $1))|ge'
++ echo LaserWriter
+ echo -e 'network pap://A2SERVER/LaserWriter%204%2f600%20PS/LaserWriter "Unknown" "LaserWriter 4/600 PS@A2SERVER (pap)"'
network pap://A2SERVER/LaserWriter%204%2f600%20PS/LaserWriter "Unknown" "LaserWriter 4/600 PS@A2SERVER (pap)"
+ exit 0
Link to comment
Share on other sites

The line now reads:

DeviceLookup=`echo -e "%%?BeginFeatureQuery: *Product\nstatusdict begin\nproduct print\nend\n%%?EndFeatureQuery: Unknown\n%%EOF" | ${TimeoutDir}/timeout -s HUP 15 ${NetatalkBinDir}/pap -p "$1:$2@$3" | sed 's|^\"(||;s|)\"$||;'`

Is the following output as it is supposed to be?

$ /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 ]%%
%%[ status: busy; source: LocalTalk ]%%
-e network pap://A2SERVER/LaserWriter%204%2f600%20PS/LaserWriter "%%[ Error: undefined; OffendingCommand: -e ]%%
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%" "LaserWriter 4/600 PS@A2SERVER (pap)"
$ /bin/bash -x /usr/lib/cups/backend/pap
+ devicetypes=LaserWriter
+ formfeed=FALSE
+ NetatalkBinDir=/usr/local/bin
+ TimeoutDir=/usr/bin
+ FullDeviceDiscovery=TRUE
+ ExaktPageCount=FALSE
+ main
+ CollectAccountingData
++ DecodeDeviceURI
++ perl -ple 's/%([0-9A-Fa-f]{2})/chr(hex($1))/eg'
++ awk -F/ '{print $4 ":" $5 "@" $3}'
++ echo
+ PrinterName=:@
+ Owner=
+ Title=
+ NeededCopies=
+ eval ParseCUPSOptions
++ ParseCUPSOptions
++ i='com\.apple\.print\.'
++ '[' 0 -ge 1 ']'
+ PrepareRequest
++ basename /usr/lib/cups/backend/pap
+ protocol=pap
+ case `uname -s` in
++ uname -s
+ '[' '!' -x /usr/local/bin/papstatus ']'
+ ZoneLookup=/usr/local/bin/getzones
+ ATPErrMsg='atp_rresp\:\ Connection\ timed\ out'
+ TotalPages=1
+ IFS='
'
+ test 0 = 0
+ echo 'network pap "Unknown" "AppleTalk Devices via pap"'
network pap "Unknown" "AppleTalk Devices via pap"
+ uniq
+ sort
+ LookupDevices
++ GetZoneList
++ eval /usr/local/bin/getzones
+++ /usr/local/bin/getzones
++ '[' 0 -eq 0 ']'
++ sed 's|atp_rresp\:\ Connection\ timed\ out|*|;'
++ eval /usr/local/bin/getzones
+ zonelist='+++ /usr/local/bin/getzones
A2SERVER'
+ OIFS='
'
+ IFS=:
+ set LaserWriter
+ IFS='
'
+ for devicetype in '$@'
+ read zone
+ echo '+++ /usr/local/bin/getzones
A2SERVER'
+ read zone
+ read zone
+ read nbpentry
+ NBPLookup =:LaserWriter@A2SERVER
+ read nbpentry
+ perl -ne 'chomp; next if /^$/; m|^\s+(.+)\s+\d+\.\d+:|; my $entry = $1; $entry =~ s/\s+$//; print "$entry\n"'
+ NBPLookup '=:LaserWriter@+++ /usr/local/bin/getzones'
+ /usr/local/bin/nbplkup =:LaserWriter@A2SERVER
+ perl -ne 'chomp; next if /^$/; m|^\s+(.+)\s+\d+\.\d+:|; my $entry = $1; $entry =~ s/\s+$//; print "$entry\n"'
+ /usr/local/bin/nbplkup '=:LaserWriter@+++ /usr/local/bin/getzones'
+ read nbpentry
+ GetPrinterProperties 'LaserWriter 4/600 PS:LaserWriter' A2SERVER pap
++ awk -F: '{print $1}'
++ echo 'LaserWriter 4/600 PS:LaserWriter'
+ name='LaserWriter 4/600 PS'
++ awk -F: '{print $2}'
++ echo 'LaserWriter 4/600 PS:LaserWriter'
+ type=LaserWriter
++ CheckProductName 'LaserWriter 4/600 PS' LaserWriter A2SERVER
++ GuessedDeviceType=Unknown
++ '[' LaserWriter = LaserWriter -a TRUE = TRUE ']'
++ /usr/local/bin/papstatus -p 'LaserWriter 4/600 PS:LaserWriter@A2SERVER'
+++ sed 's|^\"(||;s|)\"$||;'
+++ /usr/bin/timeout -s HUP 15 /usr/local/bin/pap -p 'LaserWriter 4/600 PS:LaserWriter@A2SERVER'
+++ 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 ]%%
++ DeviceLookup='LaserWriter 4/600 PS'
++ '[' -n 'LaserWriter 4/600 PS' ']'
++ GuessedDeviceType='LaserWriter 4/600 PS'
++ echo 'LaserWriter 4/600 PS'
+ model='LaserWriter 4/600 PS'
++ EncodeDeviceURI A2SERVER
++ perl -ple 's|([^\w=\-:@])|sprintf( "%%%02x", ord( $1))|ge'
++ echo A2SERVER
++ EncodeDeviceURI 'LaserWriter 4/600 PS'
++ perl -ple 's|([^\w=\-:@])|sprintf( "%%%02x", ord( $1))|ge'
++ echo 'LaserWriter 4/600 PS'
++ EncodeDeviceURI LaserWriter
++ perl -ple 's|([^\w=\-:@])|sprintf( "%%%02x", ord( $1))|ge'
++ echo LaserWriter
+ echo -e 'network pap://A2SERVER/LaserWriter%204%2f600%20PS/LaserWriter "LaserWriter 4/600 PS" "LaserWriter 4/600 PS@A2SERVER (pap)"'
network pap://A2SERVER/LaserWriter%204%2f600%20PS/LaserWriter "LaserWriter 4/600 PS" "LaserWriter 4/600 PS@A2SERVER (pap)"
+ exit 0
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