Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

spserver

Verified · no code on this page · docs-verify

The badge reports the whole docs-verify suite, not this chapter alone.

Serve an EPICS database file over PVAccess. No code, no build step — the soft-IOC equivalent of softIoc -d my.db.

spserver [OPTIONS]

Requires the server feature.

Flags

FlagDefaultMeaning
--db-file PATHEPICS .db file to load
--listen-addr ADDR0.0.0.0address to bind
--tcp-port PORT5075PVA TCP port
--udp-port PORT5076PVA search port
--reload-interval SECS2how often to re-read the .db file
--advertise-addr ADDRaddress to put in search responses
--beacon-period SECSbeacon interval
--beacon-addr IP:PORTbeacon target
--conn-timeout SECSidle connection timeout
--compute-alarmsoffderive severity from LOW/HIGH/LOLO/HIHI
--pvlist-mode MODElistoff, discover, or list
--pvlist-max N1024cap on names returned by a listing
--pvlist-allow-pattern REregex filter on names exposed by a listing
--debugoffverbose protocol logging

Running it

$ spserver --db-file spvirit-server/examples/example.db --compute-alarms
INFO spserver: Loaded DB file 'spvirit-server/examples/example.db' with 4 PVs
INFO spserver: Starting PVA server: udp=0.0.0.0:5076 tcp=0.0.0.0:5075
     reload=2s pvlist_mode=List pvlist_max=1024 filter=<none>

Every connection and operation is logged:

INFO spserver: TCP connection 1 from 127.0.0.1:52125
INFO spserver: Conn 1: channel 'DEMO:SETPOINT' cid=1 sid=2
INFO spserver: Conn 1: put init pv='DEMO:SETPOINT' ioid=1

That startup line is worth reading. It tells you the effective ports and listing policy, which is faster than guessing when a client cannot find anything.

--compute-alarms

Off by default. With it on, LOW/HIGH produce MINOR and LOLO/HIHI produce MAJOR on every write:

$ spput DEMO:SETPOINT 46 && spget DEMO:SETPOINT
DEMO:SETPOINT  46 MAJOR READ HIHI

This is currently the only route to computed alarms — limits set through the Pv handle API are published but never evaluated. See Alarms.

Reload

The .db file is re-read every --reload-interval seconds, so editing it in place changes the served records without a restart. Set the interval higher on a slow filesystem.

Listing policy

--pvlist-mode controls whether clients may enumerate:

ModeSearchsplist <target>
list (default)answeredfull list
discoveransweredrefused, "RPC list endpoint disabled"
offansweredrefused

Note that discover and off do not hide the server — a broadcast search still finds it and named PVs still read and write. They only suppress enumeration.

See also

Serving a .db file covers the database syntax and which fields spvirit acts on.