2025-05-02 13:49:24 +02:00
2025-05-02 13:49:24 +02:00
2025-05-02 13:49:24 +02:00
2025-05-02 19:16:35 +02:00
2025-05-02 13:49:24 +02:00

PiFi

This is a simple tool to create and manage a hotspot on a Raspberry Pi (ARM64).
The code is based on https://github.com/NetworkManager/NetworkManager/blob/main/examples/python/dbus/wifi-hotspot.py, rewritten in Go and adds following features:

  • Environment variables or intput parameters for SSID and password
  • Option to remove the connection

Build

make build

Usage

# sudo ./pifi <ifname> [up|down|remove] [ssid] [password]
sudo ./pifi wlan0 up "My Hotspot" "my password"
sudo ./pifi wlan0 down
sudo ./pifi wlan0 remove

Environment variables

The hotspot will use the environment variables WIFI_SSID and WIFI_PASSWORD if they are set.

export WIFI_SSID="My Hotspot"
export WIFI_PASSWORD="my password"

sudo -E ./pifi wlan0 up

Troubleshooting

No internet access

If a client is connected to the hotspot and the RaspberryPI is connected to the internet via ethernet but no internet access is available for the client, try to enable IPv4 forwarding in /etc/sysctl.conf, reload the configuration and restart NetworkManager.

sudo sysctl -w net.ipv4.ip_forward=1
sudo sysctl -p /etc/sysctl.conf
sudo systemctl restart NetworkManager
Description
Tool for managing a hotspot on a RaspberryPI
Readme 76 KiB
Languages
Go 98.3%
Makefile 1.7%