Guides

Reach a Raspberry Pi behind 4G or CGNAT

A shell on a Pi with no public IP, no port forwarding and little mobile data.

A Pi on a 4G modem or a customer's network usually has no public address: the carrier puts it behind carrier-grade NAT, and nothing from the internet can connect to it. SSH and port forwarding don't work there, and a VPN means another service to run on every device.

Fieldhand turns it around. The agent on the Pi opens one outbound connection on port 443, the same traffic as a web browser, and your shell travels over it.

1. Install the agent

In the dashboard, click Add devices and copy the install command. On the Pi, signed in as the account you want shells to open as (usually pi), run it:

curl -fsSL https://api.fieldhand.dev/install.sh | sudo sh -s -- --token fhe_…

The Pi shows up in your dashboard within a few seconds. Raspberry Pi OS, Debian, Ubuntu and Alpine on armv6, armv7 and arm64 all use the same static binary; nothing to compile, no reflash.

2. Check the data use

Carriers drop idle connections after anything from 1 to 30 minutes, without telling either side. The agent learns how long your link can stay quiet and sends a small heartbeat just before that: every 30 seconds at first, stepping up to every 10 minutes when the network allows. At 30 seconds that is about 13 MB a month; at 3 minutes, about 2 MB. Shells and file transfers use what they send.

The interval the Pi settled on is on its page in the dashboard, under Keepalive.

3. Name and tag it

Rename the device and add tags such as site:austin or 4g. Tags let you filter the fleet, run a command on a group, and limit who can reach which devices.

4. Know when it drops off

Fieldhand emails you when a device has been offline for more than 10 minutes, when its disk passes 90% and when it runs above 80 °C. Send the same alerts to Slack, Teams, Discord or PagerDuty from alerts.

If it doesn't show up

  • The clock is wrong. A Pi has no battery-backed clock; until NTP sets the time, TLS certificates look invalid. The agent keeps retrying, so it connects once the time is right. Check with timedatectl.
  • The network needs a proxy. Set HTTPS_PROXY as in agent configuration.
  • Anything else: journalctl -u fieldhand -n 50 says why. See troubleshooting.

Something wrong or missing on this page? Tell us.