Skip to content

CocoHusky/Traveling-Pi-Router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

Many coffee/guest Wi-Fi networks require a portal login that a Tesla can’t complete reliably. With this setup:

  1. Your Pi joins the Wi-Fi
  2. You complete the portal login from your phone/laptop while connected to the Pi AP
  3. Once authorized, the network usually whitelists the Pi’s WAN MAC, and your system (Tesla Car) gets internet through NAT.

Traveling Pi Router (AR9271 only)

This repository installs a travel-router stack for Raspberry Pi that only supports Qualcomm Atheros AR9271 USB Wi‑Fi adapters using ath9k_htc.

Before you run install.sh (Pi setup)

  1. Use Raspberry Pi OS (Bookworm or older supported Debian-based Pi OS variants).
  2. Ensure internet is working on your Pi for package installation.
  3. Plug in the Qualcomm Atheros AR9271 USB Wi‑Fi dongle. (https://amzn.to/4tpAeai)
  4. Install git if needed:
    sudo apt update
    sudo apt install -y git
  5. Clone this repo to a stable location on the Pi (recommended: /opt/traveling-pi-router):
    sudo mkdir -p /opt
    cd /opt
    sudo git clone https://github.com/CocoHusky/Traveling-Pi-Router.git traveling-pi-router
    cd /opt/traveling-pi-router

You can run the installer from any folder, but /opt/traveling-pi-router is recommended so scripts stay in a predictable location for future updates.

Quick install

From the cloned repo directory:

cd /opt/traveling-pi-router
sudo ./install.sh

The installer fails fast if AR9271/ath9k_htc is not detected.

Find your dongle MAC

  1. Plug in your AR9271 dongle.
  2. Run:
    iw dev
    (or ip link)
  3. Copy the MAC address of the USB Wi‑Fi interface.

Edit config

sudo nano /etc/travelrouter/config.env

Change at least these values:

  • SSID
  • PASSPHRASE
  • AP_IFACE_MAC
  • COUNTRY

Default config generated by installer:

SSID=TravelRouter
PASSPHRASE=changeme123
AP_IFACE_MAC=00:11:22:33:44:55
COUNTRY=US
WAN_IF=wlan0
LAN_IF=wlan1
LAN_CIDR=192.168.50.1/24
DHCP_START=192.168.50.20
DHCP_END=192.168.50.150

Start/enable

sudo systemctl enable --now travelrouter

If your interface name does not immediately become LAN_IF (wlan1 by default), reboot once:

sudo reboot

Verify

iw dev
ip a show wlan1
systemctl status travelrouter hostapd dnsmasq
cat /var/lib/misc/dnsmasq.leases

Expected:

  • iw dev: LAN interface is type AP and shows your SSID.
  • ip a show wlan1: includes 192.168.50.1/24.
  • systemctl status ...: services are active/running.
  • dnsmasq.leases: clients appear after connecting.

Notes

  • Interface naming is done via systemd .link using your configured AP_IFACE_MAC (/etc/systemd/network/10-travelrouter.link), not udev NAME= rules.
  • If NetworkManager is installed, installer/startup automatically mark LAN_IF unmanaged so hostapd can own AP mode.
  • If dhcpcd is installed, installer/startup enforce denyinterfaces LAN_IF.
  • Installer/startup automatically unmask and enable hostapd and dnsmasq.
  • The AP config uses nl80211 and a fixed channel (channel=6); AR9271/ath9k_htc can be quirky with ACS/auto-channel selection.
  • Scripts avoid logging your plaintext passphrase.

Uninstall (optional)

sudo ./uninstall.sh

This removes installed service/scripts/link files and keeps /etc/travelrouter/config.env for reuse.

About

This repo documents a Raspberry Pi setup that acts like a router

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages