cheesestraws
Well-known member
macbook m2
Is the macbook plugged into Ethernet or WiFi? LToUDP is slow and timeout-ridden over wifi for some reason on modern macs - I reckon it's something in macOS's WiFi power management.
macbook m2
/etc/network/interfaces.d/br0
#loopback
auto lo
iface lo inet loopback
# Virtual interface
auto tap2
iface tap2 inet manual
pre-up tunctl -t tap2 -u root
up ip link set dev tap2 up
down ip link set dev tap2 down
# Bridge interface
auto br0
iface br0 inet static
address 10.40.0.216
gateway 10.40.0.1
dns-domain local.default.tel
dns-nameservers 10.40.0.1 1.1.1.1 8.8.8.8
bridge_ports eth0 tap2
bridge_stp off
bridge_maxwait 5
eth0
= the ethernet interface of the pi. I have predictable interface names disabled.tap2
= the network tap. tashrouter will bind to this.br0
= a network bridge of tap2+eth0. Netatalk's atalkd daemon will be bound to this, which will allow netatalk to "hear" tashrouter.tap_router.py
import logging
import time
import tashrouter.netlog
from tashrouter.port.ethertalk.tap import TapPort
from tashrouter.port.localtalk.ltoudp import LtoudpPort
from tashrouter.port.localtalk.tashtalk import TashTalkPort
from tashrouter.router.router import Router
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(message)s')
#tashrouter.netlog.set_log_str_func(logging.debug) # comment this line for speed and reduced spam
router = Router('router', ports=(
LtoudpPort(seed_network=1, seed_zone_name=b'LToUDP Network'),
TashTalkPort(serial_port='/dev/ttyAMA0', seed_network=2, seed_zone_name=b'TashTalk Network'),
TapPort(tap_name='tap2', hw_addr=b'\xDE\xAD\xBE\xEF\xCA\xFE', seed_network_min=3, seed_network_max=5, seed_zone_names=[b'EtherTalk Network']),
))
print('router away!')
router.start()
try:
while True: time.sleep(1)
except KeyboardInterrupt:
router.stop()
from tashrouter.port.ethertalk.tap import TapPort
TapPort(tap_name='tap2', hw_addr=b'\xDE\xAD\xBE\xEF\xCA\xFE', seed_network_min=3, seed_network_max=5, seed_zone_names=[b'EtherTalk Network']),
(\xDE\xAD\xBE\xEF\xCA\xFE)
.br0
#eth0 -phase 2 -net 0-65534 -addr 65280.238
systemctl stop atalkd
python3 ~/tashrouter/tap_router.py
just note that this will NOT run in the background, use tmux or screen to run it in a seperate window for nowsystemctl start atalkd
systemctl status atalkd
Jan 12 20:03:08 raspbx atalkd[543]: zip_getnetinfo for br0
Jan 12 20:03:08 raspbx atalkd[543]: zip gnireply from 3.125 (br0 812)
Jan 12 20:03:08 raspbx atalkd[543]: zip_packet configured br0 from 3.125
Jan 12 20:03:09 raspbx atalkd[543]: rtmp_packet gateway 3.125 up
Jan 12 20:17:41 raspbx atalkd[543]: ready 0/0/0
Jan 12 20:17:41 raspbx systemd[1]: Started Netatalk AppleTalk daemon.
nano /etc/systemd/system/tashrouter.service
[Unit]
Description=TashRouter Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/python3 /root/tashrouter/tap_router.py
[Install]
WantedBy=default.target
/root/tashrouter/tap_router.py
= the location of your tap_router.py file in the tashrouter directory.systemctl daemon-reload
systemctl start tashrouter
systemctl status tashrouter
and check if it's working. If it is, then systemctl enable tashrouter
and it will start at boot.I use systemctl to stop all the netatalk services. You can probably get away with just stopping the atalkd service though...
Thanks for the writeup!So yes, I have tashrouter working in harmony with netatalk on the same raspberry pi.
TashTalk is PIC microcontroller firmware that acts as an interface to LocalTalk, allowing anything with a UART to connect to a LocalTalk network. TashRouter is an AppleTalk router written in Python, able to route between EtherTalk and LocalTalk networks.what is the code in the tashtalk Git project as compared to tashrouter?
If I'm not mistaken, a Pi Zero W is similar to the Pi 3 Model B I use, so the "UART Setup" section of this document should be relevant. Long story short, the UART you want to use is atThe tashtalkd code appears to want the name of an interface, but I do not know what it should be showing up as.
/dev/ttyAMA0
, you just need to make sure that it (the "PL011" UART, not the "mini UART") is the one connected to the UART pins on the GPIO header.Connect your TashTalk hat to a LocalTalk network and start tashtalkd with theHow can I verify the basics before moving on to routing?
-vv
command line switch (two levels of verbosity) - this will force it to make hex dumps of all network activity to the console. Then do something to cause some traffic on the LocalTalk network, such as opening the Chooser and clicking AppleShare. If your hat is working properly and the UART is set up properly, you should see packets going by looking for AppleShare servers.Others are more familiar with this than I am, but as I understand it, some wifi routers damage EtherTalk packets when translating between wifi and wired Ethernet. I believe Linux-based routers (DD-WRT and such) are okay, but your mileage may vary.It's unclear from reading through this topic whether Wifi will work.
As long as the USB Ethernet adapter is supported by your operating system, it will be supported by TashRouter.If it must be ethernet can I plug a USB-Ethernet adapter into the sole USB port?