Configuration#
Two programs read configuration: the bridge (phomemo-bridge) and the printer app (phomemo-printer-app). Both work without any change; every setting is optional. This page lists what you can change and where.
Bridge#
File locations#
Order |
File |
Used by |
|---|---|---|
1 |
|
the system service and every user |
2 |
|
a bridge run by that user |
Both are read in this order, and a key in the later file wins. A file that does not exist is skipped.
phomemo-bridge --config FILE reads only FILE instead of both. Here a missing file is an error: the command prints configuration error: ... and exits with status 2.
The format is TOML: one name = value per line, # starts a comment. The packaged file has every key commented out, so you can see the defaults.
Keys#
Key |
Default |
Valid values |
Meaning |
|---|---|---|---|
|
unset |
|
Auto-off timer the bridge sets on the printer at each new connection. Unset: the printer keeps its own setting. |
|
|
number, |
Minutes without a command before the bridge drops the connection. |
|
|
number, |
Longest wait for an inserted sheet to settle at the print head. |
|
|
number, |
Longest wait in seconds for the motor to stop after a page. |
|
|
number, |
Pause after a cancelled page, so the printer finishes the data it already took, before the sheet is ejected. |
|
see below |
string |
Unix socket the bridge listens on and the command line connects to. |
Note
While the bridge holds the connection, the printer does not advertise itself, so a phone or another computer cannot reach it. Lower idle_disconnect_minutes, or run phomemo-bridge disconnect, if you share the printer.
Tip
auto_off_minutes is written again at every new connection, but only when the printer reports a different value. Setting the timer with phomemo-bridge auto-off lasts only until the next connection while this key is set, so change the key for a lasting setting.
Invalid values#
The bridge never refuses to start over a bad setting. It logs a warning (see journalctl -u phomemo-bridge) and keeps the default for that key. This covers:
unknown keys,
values of the wrong type (a string where a number belongs,
true/falsefor a number),negative numbers,
a file that does not parse as TOML (the whole file is ignored).
auto_off_minutes is adjusted instead of dropped when it is a number:
You write |
Bridge uses |
Rule |
|---|---|---|
|
|
never switch off |
|
|
nearest 5-minute step |
|
|
nearest 5-minute step (halves round up) |
|
|
at least 5 |
|
|
at most 1275 |
|
not set |
not a usable number: logged, the printer keeps its own setting |
Each adjustment is logged with the value used.
Socket path#
Without socket_path and without PHOMEMO_BRIDGE_SOCKET, the bridge and its command line pick the socket like this:
/run/phomemo/bridge.sockwhen it exists (the system service),else
$XDG_RUNTIME_DIR/phomemo-bridge.sock,else
/run/phomemo/bridge.sock.
PHOMEMO_BRIDGE_SOCKET overrides socket_path from any file. The system unit sets it to /run/phomemo/bridge.sock.
Printer app#
File locations#
Each option comes from the first of these that sets it:
Order |
Source |
|---|---|
1 |
|
2 |
|
3 |
|
4 |
|
The system service runs as root and is started with -o log-file=-, so its log goes to the journal. For your own settings, edit /etc/phomemo-printer-app.conf.
Warning
Unknown options are ignored without a message. Check the spelling if a setting seems to have no effect.
Options#
Option |
Default |
Meaning |
|---|---|---|
|
|
Log detail: |
|
automatic, see below |
Port for IPP and the web interface. |
|
all interfaces |
Address to listen on. |
|
the system host name |
Host name advertised in URIs and DNS-SD records. |
|
none |
Comma-separated feature changes: |
|
unset |
PAM service that lets users change settings from other machines. |
|
unset |
Group allowed to change settings once |
|
chosen by the server |
Directory for spooled jobs. |
Note
Changing settings through the web interface is limited to this machine unless you set auth-service (and admin-group).
Which port the printer app uses#
Without server-port, the printer app tries port 8000 + (UID % 1000) and counts up past ports in use. For the system service (root, UID 0) that is 8000; for a server you run as UID 1000 it is 8000 as well, for UID 1001 it is 8001.
Find the port it actually got:
journalctl -u phomemo-printer-app | grep "Listening for connections"
avahi-browse -rt _ipp._tcp
Tip
Clients find the printer through DNS-SD, so they follow a port change on their own. A permanent CUPS queue created with the DNS-SD URI keeps working too. Pin server-port only when something needs a fixed number.
Environment variables#
Variable |
Read by |
Meaning |
|---|---|---|
|
bridge, its command line, printer app |
Bridge socket path. Overrides |
|
bridge, printer app |
Fallback socket directory: |
|
bridge |
Location of the user’s |
|
library, printer app |
Directory of model manifests to use instead of the built-in ones, for trying out a model without a rebuild. |
The printer app resolves the socket slightly differently from the bridge:
PHOMEMO_BRIDGE_SOCKET,else
$XDG_RUNTIME_DIR/phomemo-bridge.sock,else
/run/phomemo/bridge.sock.
Warning
When you run the printer app by hand against the system bridge, set PHOMEMO_BRIDGE_SOCKET=/run/phomemo/bridge.sock. Otherwise it looks in your $XDG_RUNTIME_DIR and finds no bridge there.
PHOMEMO_MODELS_DIR works the same for both: the library reads it at import, the printer app at start. Each subdirectory holds one model’s manifest (model.json) and icons; see src/models/.