Skip to content

DigiPi Initialization process

Glenn Meader edited this page Oct 12, 2026 · 1 revision

Technical details on how DigiPi is configured.

How DigiPi initialization currently works

There are three key files:

File | Purpose

  • /var/www/html/setup.php | Displays the initialization form and receives its values
  • /home/pi/localize.env | Stores the configuration variables
  • /home/pi/localize.sh | Modifies the actual configuration files

These are the targets referenced by the initialization scripts; not all are necessarily included in the public repository, and availability can differ by DigiPi image version.

An additional complication is that some applications maintain their own runtime settings, and DigiPi has a separate saveconfigs.sh for persisting application configurations and ALSA state. This means storing only localize.env won't capture every possible manual customization made after initialization.

  1. How DigiPi initialization currently works

There are three key files: File Purpose

The initialization sequence is:

  1. Initialization web form setup.php — callsign, passwords, radio interface, GPS, etc.

  2. Save configuration variables /home/pi/localize.env

  3. Execute initialization script sudo /home/pi/localize.sh

  4. Update application and system configuration Direwolf, AX.25, Winlink, rigctld, GPS, sound hardware, and others

  5. Restart New configuration takes effect

Why initialization only runs once

In setup.php, the Initialize button is only displayed when this file is absent: /var/cache/digipi/localized.txt

Inside localize.sh, DigiPi creates that file: source /home/pi/localize.env touch /var/cache/digipi/localized.txt

The PHP form writes its values into localize.env and then calls: $output = shell_exec('sudo /home/pi/localize.sh');

The marker file primarily prevents the interface from offering initialization again. It isn't the underlying reason the configuration script cannot safely be reused.

The central problem with reconfiguration

localize.sh performs string replacements based on OLD and NEW variable pairs. For example: sed -i "s/$OLDCALL/$NEWCALL/gi" etc/ax25/axports

During initial setup, it replaces the factory placeholder callsign with the new callsign. Suppose:

  • Original callsign: KX6XXX
  • Profile A callsign: W6ABC
  • Profile B callsign: K7XYZ

After initialization, the configuration file contains W6ABC. If you subsequently run the script with NEWCALL=K7XYZ, but OLDCALL is still KX6XXX, it won't find anything to replace. This is the main limitation we need to overcome. Some settings are even more complicated. The script changes command-line structure in the rigctld systemd service when selecting RTS/DTR, and changes boot hardware overlays for certain audio interfaces. These are not necessarily reversible by performing another simple string substitution.

Exactly which configuration files are changed?

I reviewed the current localize.sh script and grouped its changes by configuration purpose.

Configuration Files affected
Callsign / AX.25 /etc/ax25/uronode.conf, uronode.perms, nrports, axports, ax25d.conf
Direwolf / APRS /home/pi/direwolf.*.conf and direwolf.node.sh
Winlink Pat /home/pi/config/pat/config.json
Winlink RMS Gateway /usr/local/etc/rmsgw/channels.xml, gateway.conf, banner, sysop.xml
APRS daemon /home/pi/config/aprsd/aprsd.conf
WSJT-X / JS8Call /home/pi/config/WSJT-X.ini, JS8Call.ini
FLDigi / LinPac /home/pi/fldigi/fldigi_def.xml, /home/pi/config/LinPac/macro/init.mac
GPS /etc/default/gpsd
Radio PTT / CAT /etc/systemd/system/rigctld.service
Default boot mode /etc/systemd/system/digipi-boot.service
Display / VNC /home/pi/vnc/xstartup, /etc/tightvncserver.conf
Audio hardware /boot/firmware/config.txt

These are the targets referenced by the initialization scripts; not all are necessarily included in the public repository, and availability can differ by DigiPi image version.

An additional complication is that some applications maintain their own runtime settings, and DigiPi has a separate saveconfigs.sh for persisting application configurations and ALSA state. This means storing only localize.env won't capture every possible manual customization made after initialization.

Clone this wiki locally