ROAMSWITCH POCKET · Last updated: 2026-12-02

RoamSwitch Pocket manual

RoamSwitch Pocket turns an M5Stack CardputerZero into a pocket travel gateway. It checks a public Wi-Fi network before and after you join, opens your own WireGuard or Tailscale tunnel, and lets your phone or laptop join the Pocket's Wi-Fi so their traffic goes through the tunnel. If the tunnel drops, device traffic is blocked instead of leaving outside the tunnel.

There are two packages.

PackageContentsHow to install
roamswitch-pocket-corethe network service pocketd (runs as root) and the pocketctl commandapt
roamswitch-pocketthe screen and keyboard app (runs as your user; depends on roamswitch-pocket-core)apt

The screen app runs as your user, and everything that changes the network is in pocket-core, which runs as root. Both come from lafine.net/apt (the same repository as RoamSwitch for Linux).

1. Install

pocket-core uses the Tailscale package. Tailscale is not in Debian's own repositories, so add Tailscale's apt repository (Tailscale documents the steps for Debian 13) and the RoamSwitch apt repository, then install.

curl -fsSL https://pkgs.tailscale.com/stable/debian/trixie.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
curl -fsSL https://pkgs.tailscale.com/stable/debian/trixie.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
curl -fsSL https://lafine.net/apt/roamswitch-archive-keyring.asc \
  | sudo gpg --dearmor -o /usr/share/keyrings/roamswitch-archive-keyring.gpg
echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/roamswitch-archive-keyring.gpg] https://lafine.net/apt stable main" \
  | sudo tee /etc/apt/sources.list.d/roamswitch.list
sudo apt update
sudo apt install roamswitch-pocket-core roamswitch-pocket
sudo reboot

2. Set up the tunnel

In the app, press 8 “Settings”, select the “Tunnel” row and press Enter to open the tunnel setup screen. Z/C switches between the WireGuard and Tailscale screens. Settings cannot be changed while protected. Saved settings are used from the next protected session.

WireGuard

The Pocket creates its own key pair the first time you open this screen. The private key is encrypted with a key made from your PIN and kept on the Pocket. It is never shown or sent out.

  1. Select “This device's key” and press Enter to show the public key as a QR code. Add it as PublicKey in the server's [Peer] section.
  2. Give the Pocket the server settings. There are two ways.
    • Use the guide page (recommended)
      Press 8 “Guide” to show a QR code. Scan it with your phone to open the guide page on roamswitch.com. The page includes this Pocket's IP address, user name and public key. These values are in the URL after #, so they are not sent to the site. Following the page, write wg0.conf on your computer, copy it to ~/wg0.conf on the Pocket with scp, then press 6 “Import”. Leave out the PrivateKey line in wg0.conf. The Pocket adds its own key. After importing, ~/wg0.conf is deleted.
    • Type them on the Pocket
      Select each row (server public key, server endpoint as IPv4:port, this device's address, DNS if you want), press Enter to type it, then press 5 “Save”.
  3. Press 7 “New key” twice to create a new key pair. Then register the new public key on the server.

Tailscale

  1. Press 6 “Get list”. The first time, a login QR code appears. Scan it on another device, log in to Tailscale and approve.
  2. The exit nodes in your tailnet are listed. Select one with F/X, press Enter, then press 5 “Save”.
  3. “This device's name” is the name in your tailnet. Use only letters, digits and -.
  4. On the “Tunnel” row of the “Settings” screen, switch to Tailscale with Z/C.

3. First use

  1. When you open the app, it asks you to choose a PIN. Type 4 to 8 digits, press Enter, then type the same PIN again to confirm.
  2. The PIN itself is not stored. The Pocket makes a key from the PIN with Argon2id, encrypts the WireGuard private key with it, and keeps the result in /var/lib/pocket/vault/ (readable by root only). The PIN is checked by decrypting this.
  3. After that, you unlock with this PIN each time the Pocket starts.

If you forget the PIN, run the following on the Pocket and choose a new one.

sudo rm -rf /var/lib/pocket/vault /var/lib/pocket/pin
sudo systemctl restart pocketd

The WireGuard private key cannot be decrypted without the PIN, so it is deleted too. After choosing a new PIN, open Settings → Tunnel (Enter) → WireGuard. The Pocket creates a new key pair, so replace the PublicKey in the server's [Peer] with the new public key. The other WireGuard settings and the Tailscale settings are kept.

After 5 wrong PINs in a row, the Pocket ignores PINs for 30 seconds.

4. Use

ScreenWhat to do
Wi-Fi networksPress 4 to scan. Select with F/X and press Enter to check. Look-alike access points are shown in red.
CheckRead the result before joining. Press 6 “Continue” to join, and type the password if asked. If a result is critical, press 6 again to join anyway.
Login pagePages that only ask you to accept terms are passed automatically. If the page needs input such as an email address, press 6 “Help login”, join the temporary Wi-Fi shown on the screen with your phone, and open the shown URL in its browser to log in. Traffic is not protected during this step.
StatusWhen it says “Protected”, press 5 “Devices” to show the Pocket's Wi-Fi name, password and a QR code. Scan the QR code with your phone's camera to join. With USB, it shows the address range and the number of connected devices.
StopPress 7 “Stop” twice. Device traffic stops, the rules are removed and the Pocket's own traffic goes back to normal.

If the tunnel drops, Status shows “Traffic blocked” and device traffic does not leave. When the tunnel comes back, it returns to “Protected”.

Connect over USB

You can connect a device with a USB cable instead of the Pocket's Wi-Fi. The Pocket then does not start its Wi-Fi access point and uses its Wi-Fi only for the upstream.

  1. Set the Pocket's USB-SW switch to Slave. In this position, USB Wi-Fi and wired LAN adapters plugged into the Pocket cannot be used, so the upstream is the Pocket's own Wi-Fi.
  2. While not protecting, open 8 “Settings”, select “Devices” and press Z/C to choose USB. The choice is saved in /var/lib/pocket/downlink and kept after a restart. It cannot be changed while protected.
  3. Choose a Wi-Fi network and continue as usual. When it says “Protected”, the Pocket starts sharing over USB.
  4. Connect your device to the USB-C port on the right side of the Pocket. A new wired network appears on the device and gets an address in 10.78.0.0/24. No password is needed. 5 “Devices” shows the address range and the number of connected devices.

Use it from a terminal (pocket-tui)

pocket-core includes pocket-tui, which gives the screen app's controls in a terminal. Connect from a computer over SSH and start it with a terminal allocated (-t).

ssh -t <user>@<address> pocket-tui

5. At boot

Choose with boot in /etc/pocket/pocketd.conf.

If pocketd stops unexpectedly, its rules stay in place, so traffic stays blocked. At the next start it keeps traffic blocked until you unlock, and tells you on the screen.

6. Troubleshooting

SymptomCheck
The app says “Cannot reach pocketd”systemctl status pocketd shows it running. id lists pocket-ui (if not, reboot).
“pocketd is not set up”/etc/pocket/pocketd.conf exists and is valid. journalctl -u pocketd shows the reason.
“WireGuard is not set up” / “No Tailscale exit node is set”Set up that tunnel in “Settings” → “Tunnel” (Enter).
The WireGuard tunnel does not openThe server's UDP port is reachable and the keys match. If the public Wi-Fi blocks UDP, try Tailscale.
The phone joins the Pocket's Wi-Fi but cannot reach the internetIf your WireGuard server runs in a Docker Desktop container on a Mac, TCP through the tunnel arrives with incorrect checksums, and only device traffic does not get through. Run the server on the host, not in a container.
WireGuard dropped but Status does not change to “Traffic blocked” right awayWith no traffic, WireGuard handshakes about every 3 minutes, so detecting the drop takes up to about 3.5 minutes. Device traffic does not leave outside the tunnel in the meantime.
The Tailscale tunnel does not openThe exit node is running and approved as an exit node in the admin console.
No new network appears on the device after connecting USBIs USB-SW set to Slave? Does the cable carry data (a charge-only cable will not work)? Does Status say “Protected” (USB sharing runs only while protected)? journalctl -u pocketd shows the reason.
“Restarting in N s” appearsThe Pocket's Wi-Fi chip stopped and cannot reconnect (this rarely happens when the Pocket's own Wi-Fi is turned off). A restart fixes it, so pocketd restarts after 30 seconds. ESC cancels, but Wi-Fi then stays unavailable until a restart.
Protection ended while upgrading with aptAn upgrade stops pocketd, which ends protection. Upgrade while not protecting.

Logs are in journalctl -u pocketd. You can also check the current state with pocketctl '{"type":"get_state"}'.

7. Not in this version

8. Remove

sudo apt remove roamswitch-pocket-core   # keeps settings
sudo apt purge roamswitch-pocket-core    # also deletes the PIN-encrypted key, known access points and tunnel settings

pocketd is stopped first, so its rules are removed and the Pocket's own traffic goes back to normal.

M5Stack and CardputerZero are trademarks or product names of their respective owners. RoamSwitch Pocket is not an official M5Stack product.