Naming your /dev/ttyUSBx devices on a Raspberry Pi

Don’t think I will post this anywhere but here in the blog section, as it is well documented, but I recently needed to name the /dev/ttyUSBx devices on one of my Pi’s. This was because on reboot, sometimes my ARPS TNC would get /dev/ttyUSB0, and other times my Icom 4100 Radio would get /dev/ttyUSB0. Rather than checking and re-writing my APRS and D-Star hotspot configurations at each boot, I found that I can create my own static names for these devices.

First, create a file called /etc/udev/rules.d/99-usb-serial.rules file with the contents similar to this:

SUBSYSTEM=="tty", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0109", SYMLINK+="aprsTNC"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="icomTAP"

I say similar, because really what you are doing is binding the idVendor/idProduct hardware ID’s to the new name. If you have the same idVendor/idProduct for both devices, you may need to add the Serial Number attribute as well. You can find this attributes by executing:

udevadm info --name=/dev/ttyUSBx --attribute-walk

After you have /etc/udev/rules.d/99-usb-serial.rules configured the way you want to, you can either reboot, or execute the following command to read the new rules and setup the new symbolic links to your devices:

sudo udevadm trigger

Credits

Raspberry Pi AMPRNet IPIP Gateway

Last year I discovered AMPRNet, and how any Licensed Amateur Radio operator can have a set of public IP’s. In my spare time, I have been slowly tinkering with AMPRNet and I have recently had some success with creating a Raspberry Pi AMPRNet Gateway. I will post my configuration / how-to in the Amateur Radio section a bit later on over the Christmas break, but here are the highlights:

  • Auto-update AMPRNet portal with local public IP when a change is detected.
    • When this happens, the AMPRNet is inaccessible for about an hour while things refresh – thankfully it does not happen often.
  • AMPR-RIP4D is used for routing.
  • Basic firewall with iptables protects the local AMPRNet network.
  • Raspberry pi auto-updates weekly.

While the only AMPRNet node I am running currently, other than the gateway, is a D-STAR QnetGateway Hotspot, I will probably use this network segment for APRS andother Amateur Radio use in the near future. Future improvements to my gateway will be to add OpenVPN to allow remote access to my segment of the AMPRNet and a local DNS Resolver.

I look forward to hearing if this information helps anyone (once I post it), so please get in touch with me if you have questions or if this information has been helpful in any way.

Update: I have posted the documentation of how I built/configured this IPIP Gateway here.