{"id":2791,"date":"2024-05-11T15:16:43","date_gmt":"2024-05-11T19:16:43","guid":{"rendered":"https:\/\/biosrhythm.com\/?p=2791"},"modified":"2025-07-21T16:58:23","modified_gmt":"2025-07-21T20:58:23","slug":"building-a-classic-mac-support-server","status":"publish","type":"post","link":"https:\/\/biosrhythm.com\/?p=2791","title":{"rendered":"Building a Classic Mac Support Server"},"content":{"rendered":"\n<p>If you&#8217;re a classic Mac enthusiast, you know that it&#8217;s sometimes difficult to enjoy if you don&#8217;t have the right tools. Things like the choosing the right system software, the right version(s) of Stuffit Expander, and so forth. Then, getting that software to the machine can be a challenge. Floppy disks are problematic for a number of reasons. Using AppleTalk to connect your classic Mac to a modern network if challenging as support was removed years ago from MacOS X.<\/p>\n\n\n\n<p>Luckily for us, there&#8217;s a <a rel=\"noreferrer noopener\" href=\"https:\/\/www.macip.net\/\" target=\"_blank\">great pre-made installation called &#8220;MacIPRpi&#8221; for Raspberry Pi<\/a>. It delivers a suite of tools that are already configured and ready to use. I&#8217;ve used it for a couple of years and it&#8217;s worked great. For most folks, this will serve you well!<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"840\" height=\"568\" src=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-11-at-3.05.34\u202fPM-840x568.png\" alt=\"\" data-id=\"2797\" data-full-url=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-11-at-3.05.34\u202fPM.png\" data-link=\"https:\/\/biosrhythm.com\/?attachment_id=2797#main\" class=\"wp-image-2797\" srcset=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-11-at-3.05.34\u202fPM-840x568.png 840w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-11-at-3.05.34\u202fPM-300x203.png 300w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-11-at-3.05.34\u202fPM-768x519.png 768w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-11-at-3.05.34\u202fPM.png 976w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>However, recently I&#8217;ve attempted to do certain things it couldn&#8217;t handle. This is mainly due to netatalk being updated since the image was created. This blog post contains my notes as I set out to create a newly updated version of this suite of tools from scratch.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2>Some background<\/h2>\n\n\n\n<p>I&#8217;m using a Raspberry Pi Zero W because the HDMI output on it stopped working for unknown reasons. It&#8217;s also incredibly small and power efficient. This project seemed to be a good use for it. Drawbacks are there&#8217;s no Ethernet onboard (only WiFi) and a single USB port. To solve this, I purchased a <a rel=\"noreferrer noopener\" href=\"https:\/\/www.waveshare.com\/eth-usb-hub-hat.htm\" target=\"_blank\">USB hub and Ethernet hat<\/a> which has stacking headers to put another hat on top.<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"840\" height=\"630\" src=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/pizero-netatalk-840x630.jpg\" alt=\"\" data-id=\"2794\" data-full-url=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/pizero-netatalk-scaled.jpg\" data-link=\"https:\/\/biosrhythm.com\/?attachment_id=2794#main\" class=\"wp-image-2794\" srcset=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/pizero-netatalk-840x630.jpg 840w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/pizero-netatalk-300x225.jpg 300w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/pizero-netatalk-768x576.jpg 768w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/pizero-netatalk-1536x1152.jpg 1536w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/pizero-netatalk-2048x1536.jpg 2048w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>On top of that, I&#8217;m using a <a rel=\"noreferrer noopener\" href=\"https:\/\/ko-fi.com\/s\/60b561a0e3\" target=\"_blank\">TashTalk 2 Hat<\/a> which allows you to connect to LocalTalk devices like any Mac (pre-iMac), an ImageWriter II with LocalTalk option card installed, or a LaserWriter II. Get out your PhoneNET dongles and terminating resistor plugs!<\/p>\n\n\n\n<p>Update (2025 Jul 21): <a href=\"https:\/\/www.printables.com\/model\/1361759-pi-zero-waveshare-ethernet-usb-tashtalk-2-hats-cas\">I&#8217;ve created a 3D printable case for the Pi Zero, WaveShare Ethernet\/USB Hat, and the TashTalk 2 hat.<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"840\" height=\"630\" src=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2025\/07\/IMG_1364-840x630.jpg\" alt=\"\" class=\"wp-image-3094\" srcset=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2025\/07\/IMG_1364-840x630.jpg 840w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2025\/07\/IMG_1364-300x225.jpg 300w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2025\/07\/IMG_1364-768x576.jpg 768w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2025\/07\/IMG_1364-1536x1152.jpg 1536w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2025\/07\/IMG_1364-2048x1536.jpg 2048w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<p>When we&#8217;re finished, we can connect to devices over <strong>Ethernet<\/strong> (EtherTalk), <strong>TashTalk<\/strong> (LocalTalk), and <strong>LToUDP<\/strong> (LocalTalk over UDP, like Mini VMac).<\/p>\n\n\n\n<p>I should mention that you can&#8217;t use netatalk over WiFi. You must have Ethernet connected to your Raspberry Pi, either via a built in port or a USB to Ethernet adapter. You can still use WiFi to configure and control if you want, but you&#8217;ll already have Ethernet so it&#8217;s not really necessary.<\/p>\n\n\n\n<p>I&#8217;m going to assume that you&#8217;re comfortable getting into a Linux system, editing config files, using apt-get, setting permissions, etc. If you&#8217;re not, this project may be a bit much.<\/p>\n\n\n\n<p>You might be asking yourself why didn&#8217;t I just update netatalk on the original MacIPRpi image? The reason is because I wanted to use this as a learning opportunity to build and configure a similar (almost identical) set of tools from scratch, something I&#8217;ve never done before.<\/p>\n\n\n\n<p>If you run into issues, <a rel=\"noreferrer noopener\" href=\"https:\/\/mastodon.social\/@paulrickards\" target=\"_blank\">let me know on Mastodon<\/a> or leave a comment here and I&#8217;ll see if I can assist. This document is long so work on it in small sections and take a break in between.<\/p>\n\n\n\n<h3>What&#8217;s missing?<\/h3>\n\n\n\n<p>Currently, AURP (the protocol that drives #GlobalTalk) isn&#8217;t working (or at least I can&#8217;t figure out how to get it working properly). I&#8217;ve had mixed success running an emulated Apple Internet Router on QEmu as well as on actual hardware. There&#8217;s also a work-in-progress <a rel=\"noreferrer noopener\" href=\"https:\/\/gitea.drjosh.dev\/josh\/jrouter\" target=\"_blank\">AURP router called jrouter written in Go by Josh Deprez<\/a>. There&#8217;s surely a configuration that can make these all work together and it may take someone smarter than me to figure it out.<\/p>\n\n\n\n<h2>Getting started<\/h2>\n\n\n\n<p>I&#8217;m using a 32GB SanDisk Ultra Micro SD card for storage. I used the <a href=\"https:\/\/www.raspberrypi.com\/software\/\">Raspberry Pi Imager<\/a> to install RaspbianOS 11 (bullseye). It&#8217;s super handy since it allows you to pre-set certain settings such as WiFi AP and password. This is important for my case since I don&#8217;t have a monitor.<\/p>\n\n\n\n<p>On first boot, run <code>sudo raspi-config<\/code> to configure the usual things like locale, timezone, machine name, etc. I also created a new account to work in, instead of the usual &#8220;pi&#8221; account.<\/p>\n\n\n\n<p><em><strong>Note<\/strong>: As of this writing, RaspbianOS 12 (bookworm) is now available. I suspect everything in this document will still work but it hasn&#8217;t been tested. YMMV.<\/em><\/p>\n\n\n\n<p><em><strong>Tip: <\/strong>Make sure you use a good +5V USB power supply for the Raspberry Pi as they will pull more power than you&#8217;d expect. I&#8217;m using an older 1A iPad charger.<\/em><\/p>\n\n\n\n<p><em><strong>Tip<\/strong>: You can find out what version of Rasbian you&#8217;re using by typing:<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/os-release<\/code><\/pre>\n\n\n\n<p>It&#8217;s probably a good idea to assign a static IP to your Raspberry Pi&#8217;s Ethernet port. Rather than disabling DHCP client on your Raspberry Pi, it&#8217;s much easier to configure your router&#8217;s DHCP service to assign the static IP based on the Raspberry Pi&#8217;s MAC address. You can get your Ethernet MAC address by typing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifconfig eth0<\/code><\/pre>\n\n\n\n<h2>Configure serial for TashTalk 2 hat<\/h2>\n\n\n\n<p>We need to configure the built in serial port for the <a href=\"https:\/\/ko-fi.com\/s\/60b561a0e3\" target=\"_blank\" rel=\"noreferrer noopener\">TashTalk 2 hat<\/a> (Bluetooth uses it by default). Edit this file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/boot\/config.txt<\/code><\/pre>\n\n\n\n<p>Add the following to the end:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Add the following to the end\n# TashTalk Hat\n dtoverlay=miniuart-bt\n gpio=16-17=a3<\/code><\/pre>\n\n\n\n<p>Save and exit. Next, we need to enable the serial port in raspi-config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo raspi-config<\/code><\/pre>\n\n\n\n<p>Choose <strong>&#8220;Interface Options&#8221;<\/strong> and then <strong>&#8220;Serial Port.&#8221;<\/strong> Answer <strong>no<\/strong> to &#8220;Would you like a login shell to be accessible over serial.&#8221; Answer <strong>yes<\/strong> to &#8220;Would you like the serial port hardware to be enabled.&#8221;<\/p>\n\n\n\n<p>Reboot your system.<\/p>\n\n\n\n<h2>Install netatalk<\/h2>\n\n\n\n<p>What I thought was going to be the biggest hurdle turned out to be not so bad. Installing netatalk needs to be done from source which sounds scary but there was a <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Netatalk\/netatalk\/wiki\/Installing-Netatalk-2-on-Debian\" target=\"_blank\">great set of step by step of instructions from the netatalk folks that I followed<\/a>. At the time of this writing, I used netatalk 2.3.2. Follow that and come back here&#8211; it all &#8220;just worked.&#8221; Come back here when you&#8217;re done.<\/p>\n\n\n\n<p>You should now have all of the netalk binaries, config files, and man files installed on your system. Netatalk contains several services including atalkd, timelord, afpd, papd, cnid, and a2boot. We&#8217;re going to configure some of them, so we need to stop all of these services.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop afpd.service cnid.service papd.service timelord.service a2boot.service atalkd.service<\/code><\/pre>\n\n\n\n<p>Next, we&#8217;ll configure the netatalk services. If you reboot, remember to stop them again.<\/p>\n\n\n\n<h3>Configure atalkd<\/h3>\n\n\n\n<p>To configure atalkd, edit the following file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/netatalk\/atalkd.conf<\/code><\/pre>\n\n\n\n<p>Comment out any existing devices and add the following to the end. Note, you should change the net numbers and the zone name(s) to suit your network. <strong>Net numbers must be unique<\/strong>, but zone names don&#8217;t have to be.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tap0 -seed -phase 2 -net 11 -zone \"Biosrhythm\"\neth0 -seed -phase 2 -net 10 -zone \"Biosrhythm\"<\/code><\/pre>\n\n\n\n<p><em><strong>Tip<\/strong>: If you use the same zone name everywhere, your devices will all appear in the same zone regardless of how they are connected to your AppleTalk network. This will make them easier to locate.<\/em><\/p>\n\n\n\n<p><em><strong>Note<\/strong>: If you later view the atalkd.conf file and find it contains something different than what you remember entering, you&#8217;re not going crazy! Atalkd will modify this file while it&#8217;s running if it finds something incompatible on your network (such as a seed router that already exists). Make sure to stop the service before editing again.<\/em><\/p>\n\n\n\n<h3>Configure timelord service<\/h3>\n\n\n\n<p>The timelord service provides date and time to your classic Mac. To configure the timelord service to use the localtime of your Raspberry Pi, first stop it and then edit the systemd config file for it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/lib\/systemd\/system\/timelord.service<\/code><\/pre>\n\n\n\n<p>Change the line that starts with <code>ExecStart<\/code> to the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ExecStart=\/usr\/local\/sbin\/timelord -l -n LocalTime<\/code><\/pre>\n\n\n\n<p>Save, exit, and reload the systemd daemons.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl daemon-reload<\/code><\/pre>\n\n\n\n<h3>Configure afpd service<\/h3>\n\n\n\n<p>The afpd service provides file sharing over AppleTalk as well as TCP\/IP.<\/p>\n\n\n\n<p>Create a directory for a global AppleShare directory and set permissions. This will allow guests access to your directory.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/AppleShare\nsudo chown root:$USER \/AppleShare\nsudo chmod 775 \/AppleShare<\/code><\/pre>\n\n\n\n<p>Edit the afpd configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/netatalk\/afpd.conf<\/code><\/pre>\n\n\n\n<p>Comment out any existing lines and add this single line to the end (it looks like multiple lines, but it wraps). This config came from the MacIPRpi install.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"MacIPpi\" -transall -uamlist uams_guest.so,uams_clrtxt.so,uams_dhx.so -defaultvol \/etc\/netatalk\/AppleVolumes.default -systemvol \/etc\/netatalk\/AppleVolumes.system -nouservol -guestname \"nobody\" -setuplog \"default log_maxdebug \/var\/log\/afpd.log\" -minicmodel \"Macintosh\"\n<\/code><\/pre>\n\n\n\n<p>This will give you a global share in <code>\/AppleShare<\/code> with the name of <code>MacIPpi<\/code> as well as provide a each user&#8217;s own &#8220;home&#8221; directory on your Raspberry Pi.<\/p>\n\n\n\n<h2>Install the MacIPGW service<\/h2>\n\n\n\n<p>MacIPGW allows your classic Mac to have TCP\/IP access over AppleTalk.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ~\/Downloads\ngit clone \u201chttps:\/\/github.com\/jasonking3\/macipgw.git\u201d<\/code><\/pre>\n\n\n\n<p>Next, we need to configure some new IP routing rules using iptables. This is also the same configuration that is found in the MacIPRpi install.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano iptables-save<\/code><\/pre>\n\n\n\n<p>Paste in the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Generated by xtables-save v1.8.2 on Tue Sep 22 00:34:20 2020\n*nat\n:PREROUTING ACCEPT &#91;7525:1718344]\n:INPUT ACCEPT &#91;1807:207358]\n:POSTROUTING ACCEPT &#91;1127:49840]\n:OUTPUT ACCEPT &#91;1893:105234]\n-A PREROUTING -s 172.16.2.0\/24 -i tun0 \n-A POSTROUTING -o eth0 -j MASQUERADE\nCOMMIT\n# Completed on Tue Sep 22 00:34:20 2020\n# Generated by xtables-save v1.8.2 on Tue Sep 22 00:34:20 2020\n*filter\n:INPUT ACCEPT &#91;68453:59034824]\n:FORWARD ACCEPT &#91;36:2671]\n:OUTPUT ACCEPT &#91;44985:7851604]\n-A INPUT -s 172.16.2.0\/24 -p tcp -m tcp --dport 23 -j ACCEPT\n-A INPUT -s 192.168.178.0\/24 -p tcp -m tcp --dport 23 -j ACCEPT\n-A INPUT -s 127.0.0.1\/32 -p tcp -m tcp --dport 23 -j ACCEPT\n-A INPUT -p tcp -m tcp --dport 23 -j REJECT --reject-with icmp-port-unreachable\nCOMMIT\n# Completed on Tue Sep 22 00:34:20 2020<\/code><\/pre>\n\n\n\n<p>Next, we need to enable these new rules as well as enable forwarding.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sysctl -w net.ipv4.ip_forward=1\nsudo iptables-restore -c &lt; iptables-save<\/code><\/pre>\n\n\n\n<p><em><strong>Note:<\/strong> This will enable it now, but it will be lost after we reboot. Don&#8217;t panic, we&#8217;ll resolve that later.<\/em><\/p>\n\n\n\n<p>To start the MacIPGW, use one of the following commands. The first runs in debug mode which echoes useful information to the terminal. The second detaches and runs in the background. Again, you probably don&#8217;t need to run this individually now, we&#8217;ll start everything with a script below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Run MacIPGW (debug):\nsudo macipgw -d0x111 -n 8.8.8.8 172.16.2.1 255.255.255.0\n\nRun MacIPGW (detach):\nsudo macipgw -n 8.8.8.8 172.16.2.1 255.255.255.0<\/code><\/pre>\n\n\n\n<h2>Install samba<\/h2>\n\n\n\n<p>Samba file sharing is useful if you want to connect to it with a modern Windows or Mac machine. Install Samba then edit the config file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install samba samba-common-bin\nsudo nano \/etc\/samba\/smb.conf<\/code><\/pre>\n\n\n\n<p>Add the following to the end of the file. Again, this came from MacIPRpi.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;MacIPpi-Samba]\npath = \/AppleShare\ncomment= MacIPpi shared SAMBA (Windows) disk. Also by AFP and root dir of FTP.\nread only = no\nbrowsable = yes\npublic = yes\nguest ok = yes\nwritable = yes\ncreate mode = 0664\nforce create mode = 0664\ndirectory mode = 0775\nforce directory mode = 0775\n#tegen xattr by MACOSX\nnt acl support = no\n# helpt dit tegen directories die weer niet te vullen zijn met een nieuwe directory?\ninherit permissions = yes\nunix extensions = no<\/code><\/pre>\n\n\n\n<p>Set a SMB user password for your account.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo smbpasswd -a $USER\nsudo systemctl restart smbd<\/code><\/pre>\n\n\n\n<p>Then restart the SMB service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service smbd reload<\/code><\/pre>\n\n\n\n<h2>Installing a web rendering proxy<\/h2>\n\n\n\n<p>A <a href=\"https:\/\/github.com\/tenox7\/wrp\" target=\"_blank\" rel=\"noreferrer noopener\">web rendering proxy (WRP)<\/a> allows vintage web browsers to access the modern web by retreiving sites as an image with a clickable map overlaid on top of it.<\/p>\n\n\n\n<p>I didn&#8217;t end up using a WRP simply because it doesn&#8217;t work on a Raspberry Pi Zero W. Chromium doesn&#8217;t run on it anymore. This took me a long time to <a rel=\"noreferrer noopener\" href=\"https:\/\/forums.raspberrypi.com\/viewtopic.php?t=347333\" target=\"_blank\">figure out<\/a>!<\/p>\n\n\n\n<p>If you happen to be using a Raspberry Pi that can run Chromium, here&#8217;s how you get it working.<\/p>\n\n\n\n<p>Download the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/tenox7\/wrp\/releases\/\" target=\"_blank\">appropriate release binary<\/a>. I used \u201cwrp-arm-linux\u201d binary. The latest version 4.6.2 (at the time of writing) didn\u2019t work for me&#8211; I had to use 4.6).<\/p>\n\n\n\n<p>Set permissions, display, and start Chromium.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 755 wrp-arm-linux\nexport DISPLAY=:0\nchromium-browser --headless<\/code><\/pre>\n\n\n\n<p>Finally, run WRP.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/wrp<\/code><\/pre>\n\n\n\n<p>If you end up using a WRP, you&#8217;ll likely want put this into a startup script so it starts each time. See section below on starting and stopping services.<\/p>\n\n\n\n<h2>Install TashRouter<\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/lampmerchant\/tashrouter\" target=\"_blank\">TashRouter<\/a> will be the &#8220;glue&#8221; that ties together the different AppleTalk networks.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd Downloads\ngit clone https:\/\/github.com\/lampmerchant\/tashrouter\ncd tashrouter<\/code><\/pre>\n\n\n\n<p>Create a new Python file that will be used to launch TashRouter with the appropriate settings. I called mine simply <code>router.py<\/code>. You&#8217;ll need to change the <code>seed_network<\/code> numbers as well as the <code>seed_zone_name<\/code> with your own settings. This also enables lots of debugging messages but see note below about how to comment it out.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import logging\nimport time\n\nimport tashrouter.netlog\nfrom tashrouter.port.ethertalk.tap import TapPort\nfrom tashrouter.port.localtalk.ltoudp import LtoudpPort\nfrom tashrouter.port.localtalk.tashtalk import TashTalkPort\nfrom tashrouter.router.router import Router\n\nlogging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(message)s')\ntashrouter.netlog.set_log_str_func(logging.debug)  # comment this line for speed and reduced spam\n\nrouter = Router('router', ports=(\n  LtoudpPort(seed_network=12, seed_zone_name=b'Biosrhythm'),\n  TashTalkPort(serial_port='\/dev\/ttyAMA0', seed_network=13, seed_zone_name=b'Biosrhythm', verify_checksums=False),\n  TapPort(tap_name='tap0', hw_addr=b'\\xAA\\xBB\\xCC\\xDD\\x11\\x22'),\n))\nprint('Router started!')\nrouter.start()\n\ntry:\n  while True: time.sleep(1)\nexcept KeyboardInterrupt:\n  router.stop()<\/code><\/pre>\n\n\n\n<p>We need to use a &#8220;tap&#8221; device to make this work as it allows TashRouter to &#8220;see&#8221; the AppleTalk packets from netatalk on the same machine. These settings also don&#8217;t survive a reboot (again, don&#8217;t panic&#8211; I address that below).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ip tuntap add mode tap tap0\nsudo ip link set dev tap0 up\necho -n \" tap0\"<\/code><\/pre>\n\n\n\n<p>To start TashRouter, simply call it with the following. Again, you probably don&#8217;t need to run this individually now, we&#8217;ll start everything with a script below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo python3 router.py<\/code><\/pre>\n\n\n\n<h2>Fixing the AppleTalk kernel module<\/h2>\n\n\n\n<p>There&#8217;s a bug in the AppleTalk kernel module that appears when you run netatalk along with another service (like TashRouter). <a rel=\"noreferrer noopener\" href=\"https:\/\/68kmla.org\/bb\/index.php?threads\/tashrouter-an-appletalk-router.46047\/post-531182\" target=\"_blank\">More background on the issue can be found here<\/a>.<\/p>\n\n\n\n<p><em><strong>Note: <\/strong>It&#8217;s not absolutely critical that this is fixed. Simply listing the devices in the <code>netatalk\/atalkd.config<\/code> file with <code>tap0<\/code> first followed by eth0 (the way mentioned in this post) seems enough to make it work.<\/em><\/p>\n\n\n\n<p>Install the Raspberry Pi Kernel source. You can follow the instructions below or <a href=\"https:\/\/github.com\/RPI-Distro\/rpi-source\" target=\"_blank\" rel=\"noreferrer noopener\">see the steps here<\/a>. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install git bc bison flex libssl-dev\nsudo apt install libncurses5-dev\ncd ~\/Downloads\nsudo wget https:\/\/raw.githubusercontent.com\/RPi-Distro\/rpi-source\/master\/rpi-source -O \/usr\/local\/bin\/rpi-source &amp;&amp; sudo chmod +x \/usr\/local\/bin\/rpi-source &amp;&amp; \/usr\/local\/bin\/rpi-source -q --tag-update\nrpi-source<\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/gist.github.com\/VinDuv\/4db433b6dce39d51a5b7847ee749b2a4\" target=\"_blank\" rel=\"noreferrer noopener\">Follow these instructions to compile a new AppleTalk kernel module.<\/a><\/p>\n\n\n\n<p><em><strong>Note:<\/strong> This patch was submitted and <a rel=\"noreferrer noopener\" href=\"https:\/\/68kmla.org\/bb\/index.php?threads\/tashrouter-an-appletalk-router.46047\/post-531982\" target=\"_blank\">accepted on May 8, 2024<\/a> so look for it to be included in future distributions<\/em>.<\/p>\n\n\n\n<h2>Configuring CUPS<\/h2>\n\n\n\n<p>This will install the CUPS filters for the ImageWriter II and ImageWriter LQ printers.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install foomatic-filters<\/code><\/pre>\n\n\n\n<p>If for some reason CUPS get hosed, you can reinstall it with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install --reinstall cups<\/code><\/pre>\n\n\n\n<p>Configure CUPS to enable the web admin console by editing the config file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/cups\/cupsd.conf<\/code><\/pre>\n\n\n\n<p>Make the following changes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Comment out \u201cListen localhost:631\u201d\nAdd: \u201cPort 631\u201d\n\nFind \u201c&lt;Location \/&gt;\u201d\nAdd: \u201cAllow @local\u201d\n\nFind \u201c&lt;Location \/admin&gt;\u201d\nAdd: \u201cAllow @local\u201d\n\nFind \u201cDefaultAuthType Basic\u201d\nAdd below: \"DefaultEncryption IfRequested\u201d<\/code><\/pre>\n\n\n\n<p>Save and exit. To restart CUPS, issue the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart cups<\/code><\/pre>\n\n\n\n<h3>Configuring CUPS for AppleTalk printers<\/h3>\n\n\n\n<p>Download and install a new <code>pap<\/code> backend for CUPS to enable communicating to AppleTalk printers. Follow step 4 at this site <a rel=\"noreferrer noopener\" href=\"https:\/\/www.emaculation.com\/doku.php\/appletalk_printserver_macos_and_osx\" target=\"_blank\">https:\/\/www.emaculation.com\/doku.php\/appletalk_printserver_macos_and_osx<\/a><\/p>\n\n\n\n<p>Edit the new <code>pap<\/code> backend <code>\/usr\/lib\/cups\/backend\/pap<\/code> and find these two settings and change them to the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>devicetypes=\"LaserWriter:ImageWriter:DeskWriter:LQ\"\n\nNetatalkBinDir=\/usr\/local\/bin<\/code><\/pre>\n\n\n\n<p>If netatalk is running, you should now be able to list AppleTalk printers with the following.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo \/usr\/lib\/cups\/backend\/pap<\/code><\/pre>\n\n\n\n<p>If it worked, you should get something like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>%%&#91; status: busy ]%%\n%%&#91; status: busy ]%%\n%%&#91; status: busy ]%%\n%%&#91; status: busy ]%%\n%%&#91; status: busy; source: AppleTalk ]%%\n%%&#91; status: busy; source: AppleTalk ]%%\n%%&#91; status: busy; source: AppleTalk ]%%\nnetwork pap:\/\/Biosrhythm\/HP%20LaserJet%204000%20Series\/LaserWriter \"HP LaserJet 4000 Series\" \"HP LaserJet 4000 Series@Biosrhythm (pap)\"\nnetwork pap:\/\/Biosrhythm\/Itchy%20%26%20Scratchy\/ImageWriter \"Unknown\" \"Itchy &amp; Scratchy@Biosrhythm (pap)\"<\/code><\/pre>\n\n\n\n<p>In this example, there are two AppleTalk printers responding. The format of the URI is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pap:\/\/Zone\/PrinterName\/PrinterType<\/code><\/pre>\n\n\n\n<p>If you don&#8217;t have an AppleTalk zone, the zone is an asterisk (*). The printer name is what you&#8217;ve named the printer. The printer type is one of &#8220;ImageWriter&#8221;, &#8220;LQ&#8221;, &#8220;LaserWriter&#8221;, &#8220;DeskWriter&#8221;, and possibly others. All three names should be URL encoded.<\/p>\n\n\n\n<p>This is the URI you&#8217;ll enter when adding an AppleTalk printer (PAP) in CUPS.<\/p>\n\n\n\n<p><em>Note: You can change the name of an ImageWriter II or ImageWriter LQ (with LocalTalk option card) using <a rel=\"noreferrer noopener\" href=\"https:\/\/macintoshgarden.org\/apps\/namer\" target=\"_blank\">Namer<\/a>. Similarly, you can change the name of a LaserWriter II with the LaserWriter Utility or a HP LaserJet with the <a rel=\"noreferrer noopener\" href=\"https:\/\/macintoshgarden.org\/apps\/hp-laserjet-drivers-utility-installer-1999\" target=\"_blank\">LaserJet Utility<\/a>.<\/em><\/p>\n\n\n\n<h3>Fixing LaserWriter IIg prints<\/h3>\n\n\n\n<p>For some reason, prints from CUPS to a LaserWriter IIg don&#8217;t work out of the box. There&#8217;s an issue where GhostScript isn&#8217;t sending the fonts needed to the printer (it passes the <code>-noembtt<\/code> command when it shouldn&#8217;t). You&#8217;ll either get weird font substitution or a print that won&#8217;t work at all, especially when using AirPrint on iOS. I worked around this by doing the following.<\/p>\n\n\n\n<p>First, add the LaserWriter IIg (in my case one with a IIg card so it has EtherTalk) in CUPS and choose Other for the PPD. I used a PPD from MacOS 9 labeled <code>LaserWriter IIg v2010.130.ppd<\/code>. The last few lines contain this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*% For \"LaserWriter IIg\" version 2010.130\n*% Last Edit Date: Aug 3, 1994 (sns@sqa)\n*% end of PPD file for Apple LaserWriter IIg\"<\/code><\/pre>\n\n\n\n<p>Stop CUPS and edit the CUPS printer config file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop cups\nsudo nano \/etc\/cups\/printers.conf<\/code><\/pre>\n\n\n\n<p>Add an option for that printer you just added. This enables PostScript Level 2.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Option pdftops-renderer pdftops<\/code><\/pre>\n\n\n\n<p>Save and exit. Next, we need to remove the <code>-noembtt<\/code> command being passed to <code>pdftops<\/code>. I did this by renaming the old <code>pdftops<\/code> and creating a new one as a script to remove the <code>-noembtt<\/code> option (like a man-in-the-middle).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/usr\/bin\/\nsudo mv pdftops pdftops-orig\nsudo nano pdftops<\/code><\/pre>\n\n\n\n<p>Paste in the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/bash\n\n\/usr\/bin\/pdftops-orig `echo \"$@\" | sed 's\/-noembtt\/\/g'`<\/code><\/pre>\n\n\n\n<p>Set permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chwon root:root pdftops\nsudo chmod 755 pdftops<\/code><\/pre>\n\n\n\n<p>Start CUPS.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start cups<\/code><\/pre>\n\n\n\n<h3>Improving ImageWriter II prints<\/h3>\n\n\n\n<p>The default settings for ImageWriter II results in printouts that are way to dark. It may have something to do with the dithering or halftone routines&#8211; I&#8217;m not quite sure why.<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"840\" height=\"673\" src=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/comparison-840x673.jpg\" alt=\"\" data-id=\"2815\" data-full-url=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/comparison.jpg\" data-link=\"https:\/\/biosrhythm.com\/?attachment_id=2815#main\" class=\"wp-image-2815\" srcset=\"https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/comparison-840x673.jpg 840w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/comparison-300x240.jpg 300w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/comparison-768x615.jpg 768w, https:\/\/biosrhythm.com\/wp-content\/uploads\/2024\/05\/comparison.jpg 1024w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>After much trial and error, I figured out a way to improve the printouts. It looks almost as good as the <a rel=\"noreferrer noopener\" href=\"https:\/\/macintoshgarden.org\/apps\/macpalette-ii\" target=\"_blank\">MacPalette II driver<\/a> (which is also much better than the built-in Apple drivers). <a rel=\"noreferrer noopener\" href=\"https:\/\/www.openprinting.org\/printer\/Apple\/Apple-ImageWriter\" target=\"_blank\">Download the &#8220;iwhi&#8221; PPD<\/a> and edit it, adding the following block after the resolution section. I changed the defaults to 31 as that looked best in my testing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*FoomaticRIPOption DitherPPI: int CmdLine A\n*FoomaticRIPOptionPrototype DitherPPI: \" -dDITHERPPI=%s\"\n*FoomaticRIPOptionRange DitherPPI: 25 600\n*OrderDependency: 300 AnySetup *DitherPPI\n*DefaultDitherPPI: 31\n*FoomaticRIPDefaultDitherPPI: 31<\/code><\/pre>\n\n\n\n<p>Add the printer in CUPS, choose other for the PPD, and browse to the PPD you just edited. Set the default paper size, the default resolution to 160&#215;144.<\/p>\n\n\n\n<h3>CUPS admin web interface<\/h3>\n\n\n\n<p>To add or delete printers in CUPS, use a browser and go to <a rel=\"noreferrer noopener\" href=\"http:\/\/raspberrypi.local:631\/\" target=\"_blank\">http:\/\/raspberrypi.local:631\/<\/a> (or the name of your Raspberry Pi if you&#8217;ve changed it).<\/p>\n\n\n\n<p>To add an AppleTalk printer, choose &#8220;AppleTalk Devices via pap&#8221; and enter the pap URI as mentioned above.<\/p>\n\n\n\n<h2>Starting and stopping services<\/h2>\n\n\n\n<p>You&#8217;re finally done configuring everything&#8211; congratulations! Now it&#8217;s time to start everything up.<\/p>\n\n\n\n<p>I found that allowing the netatalk services to start up freely at boot with systemctl wasn&#8217;t always working. I think some dependencies get messed up so it wasn&#8217;t always reliable on start up. So I diabled netatalk from auto starting with the line below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl disable atalkd.service afpd.service cnid.service papd.service timelord.service a2boot.service<\/code><\/pre>\n\n\n\n<p>I then made the following two commands that start and stop each service. They also load in some other things like the iptables file.<\/p>\n\n\n\n<p>You can place the <code>netatalk-start<\/code> command to startup in the <code>\/etc\/rc.local<\/code> file. I&#8217;d give it a significant sleep delay (like 120 seconds or more) to let the machine settle before starting it. You can also run these manually if you&#8217;d like. Don&#8217;t forget to set these scripts executable.<\/p>\n\n\n\n<p>You&#8217;ll need to change the directories below to what you&#8217;ve chosen to place things. I used &#8220;Downloads&#8221; because I&#8217;m lazy!<\/p>\n\n\n\n<h3>netatalk-start<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\necho -n \"Starting\"\n\n# Setup tap0 for Netatalk immediately\nif &#91;&#91; $(ifconfig -a |grep tap0) ]]; then\n  echo -n \" (tap0)\"\nelse\n  sudo ip tuntap add mode tap tap0\n  sudo ip link set dev tap0 up\n  echo -n \" tap0\"\n  sleep 1\nfi\n\necho -n \" print2pdf\"\nsudo \/usr\/sbin\/ippeveprinter -v -c \/AppleShare\/Print\/pdfsave -f application\/pdf \"Print to PDF\" &gt;\/home\/rickards\/Downloads\/print2pdf.log 2&gt;&amp;1 &amp;\nsleep 1\necho -n \" atalkd\"\nsudo systemctl start atalkd.service\nsleep 1\necho -n \" afpd\"\nsudo systemctl start afpd.service\nsleep 1\necho -n \" cnid\"\nsudo systemctl start cnid.service\nsleep 1\necho -n \" papd\"\nsudo systemctl start papd.service\nsleep 1\necho -n \" timelord\"\nsudo systemctl start timelord.service\nsleep 1\necho -n \" a2boot\"\nsudo systemctl start a2boot.service\nsleep 1\necho -n \" tashrouter\"\nsudo python3 \/home\/rickards\/Downloads\/tashrouter\/router.py &gt;\/home\/rickards\/Downloads\/tashrouter\/tashrouter.log 2&gt;&amp;1 &amp;\nsleep 1\necho -n \" iptables\"\nsudo iptables-restore -c &lt; \/home\/rickards\/Downloads\/macipgw\/iptables-save\nsleep 1\necho -n \" macipgw\"\nsudo sysctl -w net.ipv4.ip_forward=1\nsudo macipgw -d0x111 -n 8.8.8.8 172.16.2.0 255.255.255.0 &gt;\/home\/rickards\/Downloads\/macipgw\/macipgw.log 2&gt;&amp;1 &amp;\nsleep 1\n\necho \" started\"\necho \"Pausing..\"\nsleep 5\necho \"Scanning AppleTalk Zones\"\n\ngetzones | while read line ; do echo \"$line zone:\" ; nbplkup \"@$line\" ;done<\/code><\/pre>\n\n\n\n<h3>netatalk-stop<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\necho -n \"Stopping\"\n\nPID=$(pgrep -f -u root \"ippeveprinter\" |tail -1)\nif &#91;&#91; $PID ]]; then\n  sudo kill -15 $PID\n  echo -n \" print2pdf\"\nelse\n  echo -n \" (print2pdf)\"\nfi\n\nPID=$(pgrep -f -u root \"macipgw\" |tail -1)\nif &#91;&#91; $PID ]]; then\n  sudo kill -15 $PID\n  echo -n \" macipgw\"\nelse\n  echo -n \" (macipgw)\"\nfi\n\nPID=$(pgrep -f -u root \"router.py\" |tail -1)\nif &#91;&#91; $PID ]]; then\n  sudo kill -15 $PID\n  echo -n \" tashrouter\"\nelse\n  echo -n \" (tashrouter)\"\nfi\n\nsudo systemctl stop afpd.service\necho -n \" afpd\"\nsudo systemctl stop cnid.service\necho -n \" cnid\"\nsudo systemctl stop papd.service\necho -n \" papd\"\nsudo systemctl stop timelord.service\necho -n \" timelord\"\nsudo systemctl stop a2boot.service\necho -n \" a2boot\"\nsudo systemctl stop atalkd.service\necho -n \" atalkd\"\n\necho \" stopped\"<\/code><\/pre>\n\n\n\n<h2>Useful Troubleshooting Tips<\/h2>\n\n\n\n<h3>Scan for AppleTalk<\/h3>\n\n\n\n<p>To get a list of all AppleTalk devices, add the following line to your .bash_aliases file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>alias lookupall='getzones | while read line ; do echo \"$line zone:\" ; nbplkup \"@$line\" ;done'<\/code><\/pre>\n\n\n\n<p>Logout and login again (or use <code>rehash<\/code>) and after your netatalk services have started, type <code>lookupall<\/code>. It will get a list of all zones and find all devices and services.<\/p>\n\n\n\n<h3>Monitor AppleTalk traffic<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tcpdump -i eth0 atalk<\/code><\/pre>\n\n\n\n<h3>View debug logs in real time<\/h3>\n\n\n\n<p>If you&#8217;re running into trouble, viewing log files in real time can be very useful.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># netatalk\nsudo tail -f \/var\/log\/syslog\n\n# afpd\ntail -f \/var\/log\/afpd.log\n\n# TashRouter\ntail -f ~\/Downloads\/tashrouter\/tashrouter.log\n\n# CUPS\nsudo tail -f \/var\/log\/cups\/error_log<\/code><\/pre>\n\n\n\n<h3>CUPS verbose logging<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Enable CUPS debug logging:\ncupsctl --debug-logging\n\n# Disable CUPS debug logging\ncupsctl --no-debug-logging\n\n# Restart after making changes\nsudo systemctl restart cups<\/code><\/pre>\n\n\n\n<h3>Turn WiFi off and on<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Turn off:\nrfkill block wifi\n\n# Turn on:\nrfkill unblock wifi\n\n# Get status\nrfkill<\/code><\/pre>\n\n\n\n<h3>Install a CUPS print-to-PDF driver<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install cups-pdf<\/code><\/pre>\n\n\n\n<p><strong>Update:<\/strong> It turns out the CUPS print to PDF driver isn&#8217;t that great so I&#8217;ve turned to a different method that uses ippeveprinter. I followed <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/OpenPrinting\/cups\/discussions\/770\" target=\"_blank\">this post as a guide<\/a> and will list my steps below.  Adjust path names as needed for your system.<\/p>\n\n\n\n<p>Make new folder in my AppleTalk share directory called &#8220;Print&#8221; to save the PDFs in i.e. <code>mkdir \/AppleShare\/Print<\/code><\/p>\n\n\n\n<p>Add a new startup item to our netatalk-start script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo -n \" print2pdf\"\nsudo \/usr\/sbin\/ippeveprinter -v -c \/AppleShare\/Print\/pdfsave -f application\/pdf \"Print to PDF\" &gt;\/home\/rickards\/Downloads\/print2pdf.log 2&gt;&amp;1 &amp;\nsleep 1<\/code><\/pre>\n\n\n\n<p>And a new item in netatalk-stop script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PID=$(pgrep -f -u root \"ippeveprinter\" |tail -1)\nif &#91;&#91; $PID ]]; then\n  sudo kill -15 $PID\n  echo -n \" print2pdf\"\nelse\n  echo -n \" (print2pdf)\"\nfi<\/code><\/pre>\n\n\n\n<p><strong>Note:<\/strong> These new items have been added to the scripts listed above.<\/p>\n\n\n\n<p>Crerate a new shell script called <code>pdfsave<\/code> that will process the print file and save it as a PDF. Set it executable with <code>chmod 775 pdfsave<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\nA=$(pdfinfo \"$1\" | grep texttopdf)\nif &#91; ! -z \"$A\" ]\nthen\n   \/usr\/bin\/pdftocairo -pdf \"$1\" \/AppleShare\/Print\/$(basename $1)\nelse\n   cp $1 \/AppleShare\/Print\nfi<\/code><\/pre>\n\n\n\n<p>Restart and you should see the new printer called &#8220;Print to PDF&#8221; in your CUPS administration page (see CUPS admin web interface section).<\/p>\n\n\n\n<p>Next, let&#8217;s share it over AppleTalk using netatalk&#8217;s papd. Edit the papd config file with <code>sudo nano \/etc\/netatalk\/papd.conf <\/code>and add the following lines to the end.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Print to PDF:\\\n:pr=|lp -d \"Print_to_PDF\":\\\n:pd=\/home\/rickards\/Downloads\/LaserWriter_IIg.ppd:<\/code><\/pre>\n\n\n\n<p>The &#8220;PD&#8221; directive is the location to a printer&#8217;s PPD file. Here, I&#8217;ve used one for a LaserWriter IIg but you could use any that you&#8217;d like that speak PostScript. Restart papd with <code>sudo systemctl restart papd <\/code>and you should now see the printer in the Chooser with the LaserWriter driver.<\/p>\n\n\n\n<h3>Get the status of the netatalk services<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status atalkd.service afpd.service cnid.service papd.service timelord.service a2boot.service<\/code><\/pre>\n\n\n\n<h3>Set clocks on classic Macs automatically<\/h3>\n\n\n\n<p>Install the <a rel=\"noreferrer noopener\" href=\"https:\/\/macintoshgarden.org\/apps\/tardis-and-timelord\" target=\"_blank\">Tardis control panel<\/a> on your classic Mac. Open the Chooser, select Tardis, and select Timelord that shows up on the right. Your Mac will now set the date and time automatically at startup!<\/p>\n\n\n\n<h3>Current classic Mac zone<\/h3>\n\n\n\n<p>Open the Network control panel (or in later MacOS versions, the AppleTalk control panel). The current zone should be listed at the bottom. If it&#8217;s an asterisk (*) that means there&#8217;s no seed router found. Check your atalkd config file.<\/p>\n\n\n\n<h3>Configure classsic Mac for Internet<\/h3>\n\n\n\n<p>MacIPGW provides IP services tunneled over Appletalk giving your classic Mac access to the Internet.<\/p>\n\n\n\n<p>In the MacTCP control panel, LocalTalk should be selected and it should have your zone name. Enter an IP address of <code>172.16.2.2<\/code>. Then click More. Enter a gateway address of <code>172.16.2.1<\/code>. Choose obtain an address manually. Choose a class B address. In the DNS section, enter a single period for the domain, an IP address of <code>8.8.8.8<\/code>, and check the box for default. Click OK and verify the IP address is correct. If not, change it here. For your next classic Mac, give it the next available IP address (i.e. <code>172.16.2.3<\/code>, you&#8217;re the DHCP server now).<\/p>\n\n\n\n<p>Test your Mac with <a rel=\"noreferrer noopener\" href=\"https:\/\/macintoshgarden.org\/apps\/mactcp-ping\" target=\"_blank\">MacTCP Ping<\/a> or use <a rel=\"noreferrer noopener\" href=\"https:\/\/macintoshgarden.org\/apps\/netscape-2x\" target=\"_blank\">Netscape<\/a> and visit <a rel=\"noreferrer noopener\" href=\"http:\/\/frogfind.com\/\" target=\"_blank\">http:\/\/frogfind.com\/<\/a> or <a rel=\"noreferrer noopener\" href=\"http:\/\/68k.news\/\" target=\"_blank\">http:\/\/68k.news\/<\/a><\/p>\n\n\n\n<h3>Use CUPS\/GhostScript to convert PS\/PDF to ImageWriter II out file<\/h3>\n\n\n\n<p>The one-liner below will use CUPS\/GhostScript to create a file that contains the data that would be sent to an ImageWriter II. This is useful if you&#8217;d like to render it yourself (with something like this <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/shysaur\/ImageWriter2\/blob\/2f34b9174de10b2a22d825854159468a5a3c45e2\/TestOutput\/imwii_sim.py#L4\" target=\"_blank\">ImageWriter II Simulator script in Python<\/a>).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gs -dShowAcroForm  -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -dNOMEDIAATTRS -dNOINTERPOLATE  -sDEVICE=iwhi -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -dDITHERPPI=31 -sOutputFile=outfile.iw infile.pdf<\/code><\/pre>\n\n\n\n<h3>Print plain text to an AppleTalk ImageWriter II<\/h3>\n\n\n\n<p>Printing a textfile from the Raspberry Pi to an ImageWriter with a LocalTalk option card is easy. See example below and remember to change the printer name and zone to match the format <code>name:ImageWriter@zone<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pap -p \"Itchy &amp; Scratchy:ImageWriter@Biosrhythm\" &lt;file.txt&gt;<\/code><\/pre>\n\n\n\n<h3>Don&#8217;t use NetworkManager<\/h3>\n\n\n\n<p>Make sure you&#8217;re using &#8220;dhcpd&#8221; and not &#8220;NetworkManager&#8221; as the network configuration on your Raspberry Pi. This settings are typically changed in &#8220;Advanced Options -&gt; Network Config&#8221; using the raspi-config tool. Symptoms include weird one-way communication issues between different mediums (i.e. LToUDP can see Ethertalk printers, but can&#8217;t actually communicate with it).<\/p>\n\n\n\n<h3>Printer drivers stop working?<\/h3>\n\n\n\n<p>I&#8217;ve encountered a strange issue where a network printer driver (AppleTalk ImageWriter, LaserWriter 8, MacPalette II AppleTalk, etc) suddenly is unable to locate your printers? It usually coincides with your Mac having previously joined a different zone, especially one that&#8217;s no longer available. If you use the Chooser extension &#8220;Who&#8217;s There&#8221; does it report looking for the printer in the wrong zone?<\/p>\n\n\n\n<p>It seems the driver itself can somehow remember previous zone names and seems to look for devices there instead of your current zone.<\/p>\n\n\n\n<p>The only way I&#8217;ve found around this is to completely replace the driver in the extensions folder with a fresh copy. You don&#8217;t even need to reboot your machine, just replace it and open the Chooser and it should now work.<\/p>\n\n\n\n<h2>Thanks for the help!<\/h2>\n\n\n\n<p>I&#8217;d like to thank mactjaap for creating the MacIPRpi distribution as it showed what was actually possible and was invaluable in configuring my own server. I&#8217;d also like to thank the folks on the 68KMLA forum, especially tashtari and NJRoadfan for their assistance in troubleshooting and debugging to get this far!<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re a classic Mac enthusiast, you know that it&#8217;s sometimes difficult to enjoy if you don&#8217;t have the right tools. Things like the choosing the right system software, the right version(s) of Stuffit Expander, and so forth. Then, getting that software to the machine can be a challenge. Floppy disks are problematic for a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[46,32,53,128,127],"_links":{"self":[{"href":"https:\/\/biosrhythm.com\/index.php?rest_route=\/wp\/v2\/posts\/2791"}],"collection":[{"href":"https:\/\/biosrhythm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/biosrhythm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/biosrhythm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/biosrhythm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2791"}],"version-history":[{"count":23,"href":"https:\/\/biosrhythm.com\/index.php?rest_route=\/wp\/v2\/posts\/2791\/revisions"}],"predecessor-version":[{"id":3095,"href":"https:\/\/biosrhythm.com\/index.php?rest_route=\/wp\/v2\/posts\/2791\/revisions\/3095"}],"wp:attachment":[{"href":"https:\/\/biosrhythm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/biosrhythm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/biosrhythm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}